Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
39:2f17131d22a5
Parent:
31:b5bd3b189150
Child:
40:1324da35afd4
--- a/SnConfigFrame.cpp	Wed May 29 18:54:19 2013 +0000
+++ b/SnConfigFrame.cpp	Tue Jul 30 02:03:21 2013 +0000
@@ -9,7 +9,7 @@
 extern "C" void mbed_mac_address(char *);
 
 bool              SnConfigFrame::fgApplySafetyNets     = true;
-const uint8_t     SnConfigFrame::kIOVers               = 4;
+const uint8_t     SnConfigFrame::kIOVers               = 6;
 const char* const SnConfigFrame::kDefConfFile          = "/local/DEFCONF.DAT";
 const char* const SnConfigFrame::kDefIPflag            = "DEF";
 const uint32_t    SnConfigFrame::kMinCommWinPrdLowPwr  = 14400;    // exclusive min low power comm win period (s)
@@ -60,7 +60,8 @@
     fAmpsOn             = 0x0Fu;
     fEvtThrtlPeriodMs   = 50u;
     fPowerMode          = kAmpsDatTak|kCardDatTak|kAmpsComWin|kCardComWin|kIridComWin|kAfarComWin;
-    fBatVoltLowPwr      = 0;
+    fBatVoltToLowPwr    = 0;
+    fBatVoltFromLowPwr  = 0;
     fVoltCheckPeriod    = 600u;
     fCommWinPeriod      = 3600u;
     fCommWinDuration    = 600u;
@@ -149,8 +150,14 @@
         EnablePowerFor(kIridComWin);
         EnablePowerFor(kAfarComWin);
     }
-    if (fBatVoltLowPwr>kMaxBatVoltLowPwr) {
-        fBatVoltLowPwr=kMaxBatVoltLowPwr;
+    if (fBatVoltToLowPwr>kMaxBatVoltLowPwr) {
+        fBatVoltToLowPwr=kMaxBatVoltLowPwr;
+    }
+    if (fBatVoltFromLowPwr>kMaxBatVoltLowPwr) {
+        fBatVoltFromLowPwr=kMaxBatVoltLowPwr;
+    }
+    if (fBatVoltFromLowPwr<fBatVoltToLowPwr) {
+        fBatVoltFromLowPwr=fBatVoltToLowPwr;
     }
     if (fCommWinPeriod>kMaxCommWinPeriod) {
         fCommWinPeriod=kMaxCommWinPeriod;
@@ -282,7 +289,7 @@
    
    const int8_t start = (r2l) ?             0 : BITS_IN_SHORT-2;
    const int8_t end   = (r2l) ? BITS_IN_SHORT : -2;
-   const int8_t step  = (r2l) ?                        2 : -2;
+   const int8_t step  = (r2l) ?             2 : -2;
    
    uint8_t hi= (r2l) ? 0x2 : 0x1;
    uint8_t lo= (r2l) ? 0x1 : 0x2;