Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Hosted targets Fix timer cycle calculation overflow

at 1 GHZ the intermediate calculation for cycles overflows 32 bits
this makes timer fail even with sensible values
solution divide both sides by 100

Change-Id: I18a4054c2d06fb72531d5496bba562f71b03984f

authored by

William Wilgus and committed by
William Wilgus
3a7a46d1 186dbb45

+5 -2
+4 -1
apps/plugins/lua/rocklib_events.c
··· 424 424 IF_COP(, COP)); 425 425 426 426 /* Timer is used to poll waiting events */ 427 - rb->timer_register(1, NULL, EV_TIMER_FREQ, rev_timer_isr IF_COP(, CPU)); 427 + if (!rb->timer_register(1, NULL, EV_TIMER_FREQ, rev_timer_isr IF_COP(, CPU))) 428 + { 429 + rb->splash(100, "No timer available!"); 430 + } 428 431 } 429 432 430 433 static void playback_event_callback(unsigned short id, void *data)
+1 -1
firmware/target/hosted/kernel-unix.c
··· 104 104 } 105 105 106 106 #define cycles_to_microseconds(cycles) \ 107 - ((int)((1000000*cycles)/TIMER_FREQ)) 107 + ((int)((10000*cycles)/(TIMER_FREQ / 100))) 108 108 109 109 110 110 static timer_t timer_tid;