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
UI_Main.cpp
- Committer:
- the_sz
- Date:
- 2015-11-14
- Revision:
- 9:fe2c9b3a312b
- Parent:
- 7:dc29f6647486
- Child:
- 12:a89096944f20
File content as of revision 9:fe2c9b3a312b:
#include "WakeupLight.h" typedef enum { LUS_CLOCK, LUS_CLOCK_IN_WORDS, LUS_SLIDESHOW, } LAST_USED_SCREENSAVER_ENUM; int32_t timeOut; LAST_USED_SCREENSAVER_ENUM lastUsedScreensaver=LUS_CLOCK; void UI_MainHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui) { switch (reason) { case UR_CLICK: if (index==0) { lastUsedScreensaver=LUS_CLOCK; UI_Show(&uiClock); } else if (index==1) { lastUsedScreensaver=LUS_CLOCK_IN_WORDS; UI_Show(&uiClockInWords); } else if (index==2) { lastUsedScreensaver=LUS_SLIDESHOW; UI_Show(&uiSlideshow); } else if (index==3) UI_WakeupShow(); else if (index==4) LED_StartAnimation(LAE_WAKEUP); else if (index==5) LED_StartAnimation(LAE_OFF); else if (index==6) UI_Show(&uiColorTest); break; case UR_TIMER: if ((time(NULL)-timeOut)>10) { switch (lastUsedScreensaver) { case LUS_CLOCK: UI_Show(&uiClock); break; case LUS_CLOCK_IN_WORDS: UI_Show(&uiClockInWords); break; case LUS_SLIDESHOW: UI_Show(&uiSlideshow); break; } } break; case UR_SHOW: timeOut=time(NULL); break; } }