/*! \fn activityDetectedRoutine(void) * \brief What to do when user activity has been detected */ void activityDetectedRoutine(void) { #ifdef HARDWARE_V1 return; #endif // Activate timers for automatic switch off activateTimer(TIMER_LIGHT, LIGHT_TIMER_DEL); activateTimer(TIMER_SCREEN, SCREEN_TIMER_DEL); // If the screen was off, turn it on! if (oledIsOn() == FALSE) { oledOn(); screenComingOnDelay(); } // If the lights were off, turn them on! if (areLightsOn == FALSE) { setPwmDc(MAX_PWM_VAL); activateGuardKey(); areLightsOn = TRUE; } }
/*! \fn activityDetectedRoutine(void) * \brief What to do when user activity has been detected */ void activityDetectedRoutine(void) { // Activate timers for automatic switch off & user interaction timeout activateTimer(TIMER_LIGHT, LIGHT_TIMER_DEL); activateTimer(TIMER_SCREEN, SCREEN_TIMER_DEL); activateTimer(SLOW_TIMER_LOCKOUT, getMooltipassParameterInEeprom(LOCK_TIMEOUT_PARAM)); activateTimer(TIMER_USERINT, ((uint16_t)controlEepromParameter(getMooltipassParameterInEeprom(USER_INTER_TIMEOUT_PARAM), MIN_USER_INTER_DEL/1000, MAX_USER_INTER_DEL/1000)) << 10); // If the screen was off, turn it on! if (oledIsOn() == FALSE) { oledOn(); screenComingOnDelay(); } // If we are in screen saver mode, exit it! if (screenSaverOn == TRUE) { screenSaverOn = FALSE; } // There are only lights in the Mooltipass standard version #if defined(HARDWARE_OLIVIER_V1) // If the lights were off, turn them on! if (areLightsOn == FALSE) { setPwmDc(MAX_PWM_VAL); activateGuardKey(); areLightsOn = TRUE; } #endif }