Wakeup Light with touch user interface, anti-aliased Font, SD card access and RTC usage on STM32F746NG-DISCO board
Dependencies: BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src
Diff: UI_Main.cpp
- Revision:
- 3:ecf7f1f8d749
- Child:
- 5:13c70bcde7f6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UI_Main.cpp Thu Oct 29 18:09:31 2015 +0000 @@ -0,0 +1,31 @@ +#include "WakeupLight.h" + +int32_t timeOut; + +void UI_MainHandler(UI_REASON_ENUM reason,uint32_t index,UI_STRUCT *ui) +{ + switch (reason) + { + case UR_CLICK: + if (index==0) + UI_Show(&uiClock); + else if (index==1) + UI_Show(&uiClockInWords); + else if (index==2) + UI_Show(&uiWakeup); + else if (index==3) + LED_StartAnimation(LAE_WAKEUP); + else if (index==4) + LED_StartAnimation(LAE_OFF); + break; + + case UR_TIMER: + if ((time(NULL)-timeOut)>10) + UI_Show(&uiClock); + break; + + case UR_SHOW: + timeOut=time(NULL); + break; + } +}