Browse Source

adding storage manager

phyto 1 year ago
parent
commit
a4104e21f7
3 changed files with 26 additions and 3 deletions
  1. 3
    1
      simulator/rdtemp/cli.ino
  2. 9
    2
      simulator/rdtemp/rdtemp.ino
  3. 14
    0
      simulator/rdtemp/storage.ino

+ 3
- 1
simulator/rdtemp/cli.ino View File

@@ -69,7 +69,8 @@ prtln("");
69 69
 /* --------------------------------------------------------------- */
70 70
 static void clihelp()
71 71
 {
72
- prtln("x\texit cli"); 
72
+ prtln("x\texit cli");
73
+ prtln("I\tinit storage"); 
73 74
 }
74 75
 /* --------------------------------------------------------------- */
75 76
 void phytocli(void)
@@ -94,6 +95,7 @@ do  {
94 95
   switch(key) {
95 96
     case 'x':  flag_exit=1;                     break;
96 97
     case '?':  clihelp();                       break;
98
+    case 'I':  init_storage();                  break;
97 99
     }
98 100
   
99 101
   } while (!flag_exit);

+ 9
- 2
simulator/rdtemp/rdtemp.ino View File

@@ -14,7 +14,7 @@ void setup() {
14 14
   
15 15
   Serial.print("\n");
16 16
 
17
-  phytocli();
17
+  phytocli();         /* XXX */
18 18
   
19 19
   /* XXX */
20 20
   /*  changing the voltage reference of the ADC
@@ -90,7 +90,14 @@ void loop() {
90 90
 
91 91
   if (foo++ > 5) {
92 92
     readlight();    foo = 0;
93
-  }
93
+    }
94
+
95
+ /* check for CLI request */
96
+ if (Serial.available() && 0x55==Serial.read())
97
+    {
98
+    Serial.println("M cli request");
99
+    phytocli();
100
+    }
94 101
  
95 102
   delay(DELAI);
96 103
 }

+ 14
- 0
simulator/rdtemp/storage.ino View File

@@ -0,0 +1,14 @@
1
+/* --------------------------------------------------------------- */
2
+#include <EEPROM.h>
3
+/* --------------------------------------------------------------- */
4
+int init_storage(void)
5
+{
6
+Serial.println(__func__);
7
+
8
+Serial.print("eeprom length: ");
9
+Serial.println(EEPROM.length());
10
+
11
+
12
+}
13
+/* --------------------------------------------------------------- */
14
+/* --------------------------------------------------------------- */

Loading…
Cancel
Save