Contains the main execution of the clock uses headers to import functions

Dependencies:   RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor

Fork of TFT_Mikroelectronika_IL9341_sketchpad by Oxford CWM Team

Revision:
48:76ac309a2bd9
Parent:
41:3f2e75e7fbeb
--- a/clocklogic.h	Fri May 26 08:45:43 2017 +0000
+++ b/clocklogic.h	Fri May 26 09:34:38 2017 +0000
@@ -21,8 +21,10 @@
         else if (x > 0 && x < 50 && y > 150 && y < 200) // side button 4 
         {
             //set desired state to 4
-            //f_cycle = !f_cycle;
-            return 4;
+            f_cycle = !f_cycle;
+            f_cycle_secs = tm_c.sec;
+            //wait(0.5);
+           // return 4;
             
         }else if (x > 0 && x < 50 && y > 200 && y < 240) // button home
         {
@@ -120,8 +122,10 @@
         TFT.locate(220,210);    
         TFT.printf("%d",tm_c.year);     */
         if (f_cycle){
+            if ((f_cycle_secs + f_cycle_wait) == tm_c.sec){
             f_state = 2;
-            wait(1);
+            f_cycle_secs = tm_c.sec;
+            }
         }
         switch (digital_clock_press()){
             case (-1): break;