changeset 404:ea97015f6bc5

merge
author Matt Johnston <matt@ucc.asn.au>
date Mon, 16 Jul 2012 22:58:33 +0800
parents 11b486950f4a (diff) 45d96250387c (current diff)
children 594d8be26bfb
files
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Mon Jul 16 22:56:41 2012 +0800
+++ b/main.c	Mon Jul 16 22:58:33 2012 +0800
@@ -67,7 +67,7 @@
 
 // eeprom-settable parameters. all timeouts should
 // be a multiple of TICK (6 seconds probably)
-static uint16_t measure_wake = 120;
+static uint16_t measure_wake = 138; // not a divisor of comms_wake
 static uint16_t comms_wake = 3600;
 static uint8_t wake_secs = 30;
 
@@ -797,12 +797,6 @@
             need_comms = 1;
             comms_timeout = wake_secs;
             button_pressed = 0;
-        }
-
-        if (need_measurement)
-        {
-            need_measurement = 0;
-            do_measurement();
             continue;
         }
 
@@ -813,6 +807,13 @@
             continue;
         }
 
+        if (need_measurement)
+        {
+            need_measurement = 0;
+            do_measurement();
+            continue;
+        }
+
         deep_sleep();
     }
 
--- a/web/log.py	Mon Jul 16 22:56:41 2012 +0800
+++ b/web/log.py	Mon Jul 16 22:58:33 2012 +0800
@@ -160,7 +160,7 @@
 
 def time_rem(name, entries):
     val_ticks = int(entries[name])
-    val_rem = int(entries[name])
+    val_rem = int(entries['%s_rem' % name])
     tick_wake = int(entries['tick_wake'])
     tick_secs = int(entries['tick_secs'])
     return val_ticks + float(val_rem) * tick_secs / tick_wake