Registration disabled due to an overwhelming number of spam messages.This forum is now only kept in read-only mode as a reference.
--- helpers.c (revision 165)+++ helpers.c (working copy)@@ -69,6 +69,11 @@ #define BATT_LOW 2 //!< Battery under voltage //@} ++extern uint16_t mainstate;+#define MS_PLAYWINDOW 0x0002 // info about current song (from main.c)++ /** \fn void init_lowlevel_io(void) * Low level initialization of the controller * @@ -447,17 +452,48 @@ } //- // if any event has been created, - // post it and turn on display light+ // handle events different from EV_IDLE and the display backlight //+ // If we are in charge info screen, power down+ //+ // If backlight is on (tlight) or dimming in progress (pwm>127) post + // event and turn backlight on (will implicitly reset display off counter) + //+ // If the backlight is completely off,+ // - and we are in play window,+ // - EV_LONGPRESS will turn backlight on+ // - EV_UPFAST or EV_DOWNFAST will be passed through (backlight stays off)+ // - and we are in any other window,+ // - EV_LONGPRESS will turn backlight on+ // anything else will be ignored to prevent accidental actions.+ //+ int pwm = *AT91C_PWMC_CH0_CDTYR; if (event != EV_IDLE) {- light_on(); if (charge_info_screen) power_off(); //set_event(EV_RESET); else- set_event(event);+ if ((tLight) || ((!tLight) && (pwm < 127)))+ {+ light_on();+ set_event(event);+ }+ else if (mainstate!=MS_PLAYWINDOW)+ {+ if (event == EV_LONGPRESS)+ light_on();+ }+ else+ switch (event)+ {+ case EV_LONGPRESS:+ light_on();+ break;+ case EV_UPFAST:+ case EV_DOWNFAST:+ set_event(event);+ } tOffTime = POWER_OFF_TIMEOUT; // rekick the poweroff timeout }