Modification into 17th July New display demo code

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Ext_Demo_17July2017_newdis by SenseSemi

Revision:
20:7c64e6ecad76
Parent:
12:ab85607bb10a
Child:
24:d992ee8369f4
--- a/touch_modules.cpp	Fri Jun 09 17:12:21 2017 +0000
+++ b/touch_modules.cpp	Sat Jun 17 09:36:18 2017 +0000
@@ -1,4 +1,5 @@
 #include "mbed.h"
+#include "eeprom_pgm.h"
 //#include "ili9325.h"
 //#include "lcd_base.h"
 #include "display_modules.h"
@@ -75,7 +76,7 @@
                   if ( ((xt >=35) && (xt<=100)) && ( (yt>= 135) && (yt<= 185) ) ) // ble
                        {
                           
-                         // state=3;
+                          state=12;
                         }
     
                  else if ( ((xt >=130) && (xt<=195)) && ( (yt>= 135) && (yt<= 185) ) ) // erase
@@ -165,13 +166,23 @@
 {
       
       unsigned char state;
+      int8_t type=0;
+       type=eprom_read(3);
                  
-    
-            if ( ((xt >=70) && (xt<=170)) && ( (yt>=70) && (yt<=140) ) ) // press on return box
+                  if ( ((xt >= 35) && (xt<=100)) && ( (yt>= 65) && (yt<= 118) ) ) // RET   //CHANGED 12/06/17// 
                       {
-                           state=3;
-                 } 
-              
+                                state=3;
+                         
+                       }
+                 else if ( ((xt >= 130) && (xt<=195)) && ( (yt>= 65) && (yt<= 118) ) ) // RETEST
+                       {
+                                 if (type==0)
+                                     state=7;
+                                 else if (type==1)
+                                     state=8;
+                                     else if (type==2)
+                                     state=9;
+                       }
               else 
                      state=10;                      
            return state;
@@ -206,7 +217,7 @@
     {
         unsigned char state;
 
-                if ( ((xt >=70) && (xt<=170)) && ( (yt>= 140) && (yt<= 195) ) ) // START
+               /* if ( ((xt >=70) && (xt<=170)) && ( (yt>= 140) && (yt<= 195) ) ) // START
                        {
                           
                           state=7;
@@ -215,9 +226,37 @@
                  else if ( ((xt >=70) && (xt<=170)) && ( (yt>=70) && (yt<=140) ) ) // RETURN
                       {
                            state=3;
-                 }  
-            else 
-                  state=10;
+                 } */
+                 
+                   if ( ((xt >=35) && (xt<=100)) && ( (yt>= 135) && (yt<= 185) ) ) //fasting     // 12/06/17       newly added
+                       {
+                          
+                          state=7;
+                          eprom_write(2,0);  
+                        }
+    
+                 else if ( ((xt >=130) && (xt<=195)) && ( (yt>= 135) && (yt<= 185) ) ) // pp
+                      {
+                           state=7;
+                           eprom_write(2,1);    
+                        
+                          
+                       }
+                 else if ( ((xt >= 35) && (xt<=100)) && ( (yt>= 65) && (yt<= 118) ) ) // random
+                      {
+                           state=7;
+                           eprom_write(2,2); 
+                         
+                       }
+                 else if ( ((xt >= 130) && (xt<=195)) && ( (yt>= 65) && (yt<= 118) ) ) // return
+                       {
+                           state=3;         //////////
+                 
+                       }
+                 
+                 
+              else 
+                     state=10;
            
            return state;
     }