diff main.c @ 97:bf707a3775d2

change default comms_wake
author Matt Johnston <matt@ucc.asn.au>
date Mon, 16 Jul 2012 22:58:25 +0800
parents f18fd4257296
children 2ba9065e7c4f
line wrap: on
line diff
--- a/main.c	Mon Jul 16 22:01:33 2012 +0800
+++ b/main.c	Mon Jul 16 22:58:25 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();
     }