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

Revision:
7:dc29f6647486
Parent:
5:13c70bcde7f6
Child:
9:fe2c9b3a312b
--- a/UI_Main.cpp	Tue Nov 10 22:39:50 2015 +0000
+++ b/UI_Main.cpp	Thu Nov 12 21:21:48 2015 +0000
@@ -1,6 +1,14 @@
 #include "WakeupLight.h"
 
+typedef enum
+{
+    LUS_CLOCK,
+    LUS_CLOCK_IN_WORDS,
+
+} 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)
 {
@@ -8,11 +16,17 @@
     {
         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)
-                UI_Show(&uiWakeup);
+                UI_WakeupShow();
             else if (index==3)
                 LED_StartAnimation(LAE_WAKEUP);
             else if (index==4)
@@ -23,7 +37,13 @@
 
         case UR_TIMER:
             if ((time(NULL)-timeOut)>10)
-                UI_Show(&uiClock);
+            {
+                switch (lastUsedScreensaver)
+                {
+                    case LUS_CLOCK:                 UI_Show(&uiClock);          break;
+                    case LUS_CLOCK_IN_WORDS:        UI_Show(&uiClockInWords);   break;
+                }
+            }
             break;
             
         case UR_SHOW: