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
00001 #include "WakeupLight.h" 00002 00003 typedef enum 00004 { 00005 LUS_CLOCK, 00006 LUS_CLOCK_IN_WORDS, 00007 LUS_SLIDESHOW, 00008 00009 } LAST_USED_SCREENSAVER_ENUM; 00010 00011 int32_t timeOut; 00012 LAST_USED_SCREENSAVER_ENUM lastUsedScreensaver=LUS_CLOCK; 00013 00014 void UI_MainHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui) 00015 { 00016 switch (reason) 00017 { 00018 case UR_CLICK: 00019 timeOut=RTC_Get(NULL); // actually, this is only needed for LED_... because these will not issue UR_SHOW 00020 if (index==0) 00021 { 00022 lastUsedScreensaver=LUS_CLOCK; 00023 UI_Show(&uiClock); 00024 } 00025 else if (index==1) 00026 { 00027 lastUsedScreensaver=LUS_CLOCK_IN_WORDS; 00028 UI_Show(&uiClockInWords); 00029 } 00030 else if (index==2) 00031 { 00032 lastUsedScreensaver=LUS_SLIDESHOW; 00033 UI_Show(&uiSlideshow); 00034 } 00035 else if (index==3) 00036 UI_WakeupShow(); 00037 else if (index==4) 00038 UI_TimeShow(); 00039 else if (index==5) 00040 LED_StartAnimation(LAE_WAKEUP); 00041 else if (index==6) 00042 LED_StartAnimation(LAE_OFF); 00043 else if (index==7) 00044 UI_Show(&uiColorTest); 00045 break; 00046 00047 case UR_TIMER: 00048 if ((RTC_Get(NULL)-timeOut)>10) 00049 { 00050 switch (lastUsedScreensaver) 00051 { 00052 case LUS_CLOCK: UI_Show(&uiClock); break; 00053 case LUS_CLOCK_IN_WORDS: UI_Show(&uiClockInWords); break; 00054 case LUS_SLIDESHOW: UI_Show(&uiSlideshow); break; 00055 } 00056 } 00057 break; 00058 00059 case UR_SHOW: 00060 timeOut=RTC_Get(NULL); 00061 break; 00062 } 00063 }
Generated on Tue Jul 12 2022 21:40:04 by 1.7.2