Reduced LCD buffer size to 20 char
authoraidan@aidan-laptop
Thu, 27 May 2010 15:53:48 +0100
changeset 18 01c2efa497f9
parent 17 24e1b1c89f6a
child 19 2ed1f378b677
child 20 ce0cf7f999ed
Reduced LCD buffer size to 20 char
pbmd
stateManager.c
Binary file pbmd has changed
--- a/stateManager.c	Thu May 27 14:36:36 2010 +0100
+++ b/stateManager.c	Thu May 27 15:53:48 2010 +0100
@@ -292,7 +292,7 @@
     
     time_t timenow, prevVoltageTime, VoltageTime;
     
-    const int bufferSize = 80;
+    const int bufferSize = 20;
     char buffer0 [bufferSize];
     char buffer1 [bufferSize];
     char *wakeTimeStr = malloc(20);
@@ -370,8 +370,8 @@
         {
             syslog ( LOG_ERR, "Error initial voltage spike continuing after %d tests, closing program", spikecount );
                            
-            snprintf (buffer0, bufferSize, "Error Reading Voltage");
-            snprintf (buffer1, bufferSize, "Power Management Restarting");
+            snprintf (buffer0, bufferSize, "Voltage Spike");
+            snprintf (buffer1, bufferSize, "Power App Restart");
 
             CPhidgetTextLCD_setDisplayString (LCD, 0, buffer0); 
             CPhidgetTextLCD_setDisplayString (LCD, 1, buffer1);  
@@ -447,7 +447,7 @@
             tts = OVERRIDE_TIME - (timenow - boottime);
             syslog ( LOG_DEBUG, "In OVERRIDE %d sec to sleep", tts ); 
             
-            snprintf (buffer1, bufferSize, "%-s Time:%dmin", getStateDesc(newState), tts/60);
+            snprintf (buffer1, bufferSize, "%-s Time:%dmin", getStateDesc(newState), (tts/60)+1);
             CPhidgetTextLCD_setDisplayString (LCD, 1, buffer1);
     
             if (timenow > boottime + OVERRIDE_TIME)