Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
18:55f1581f2ee4
Parent:
16:744ce85aede2
Child:
19:74155d652c37
diff -r 4687bf932b8c -r 55f1581f2ee4 SnConfigFrame.h
--- a/SnConfigFrame.h	Wed Sep 12 22:50:25 2012 +0000
+++ b/SnConfigFrame.h	Sat Sep 29 04:54:15 2012 +0000
@@ -27,7 +27,8 @@
             kMaxSizeOfV1 + sizeof(uint32_t) + sizeof(uint8_t);
     static const uint32_t   kMaxSizeOfV3 =
             kMaxSizeOfV2 + (2u*sizeof(uint16_t)) + (4u*kIPLen*sizeof(char));
-    static const uint32_t   kMaxSizeOf = kMaxSizeOfV3;
+    static const uint32_t   kMaxSizeOfV4 = kMaxSizeOfV3 + (sizeof(float)-sizeof(uint16_t));
+    static const uint32_t   kMaxSizeOf = kMaxSizeOfV4;
     
     enum EDatPackBit {
         kSDcard = BIT(0),
@@ -90,7 +91,7 @@
     uint16_t    fPLA[kNplas];              //[pattern id] (same for each card)
     uint8_t     fNumCardsMajLog;           // number of cards participating in the MajLogic trigger (1 to 4)
     uint8_t     fEnableThermTrig;          // (1byte bool) whether or not to allow thermal triggers
-    uint16_t    fForceTrigPeriod;          // number of seconds between force triggers (0=none)
+    float       fForceTrigPeriod;          // number of seconds between force triggers (0=none)
     uint16_t    fHeartBeatPeriod;          // number of seconds between heartbeats (0=none)
     uint8_t     fAmpsOn;                   // which amps are on (bit word. uint8_t => 8 amps max)
     uint16_t    fEvtThrtlPeriodMs;         // throttle period to write events (ms)
@@ -160,7 +161,7 @@
     uint32_t GetFirstEvt() const { return fFirstEvt; }
     uint32_t GetEvtsPerFile() const { return fEvtsPerSeq; }
     uint16_t GetEvtThrtlPeriodMs() const { return fEvtThrtlPeriodMs; }
-    uint16_t GetForceTrigPeriod() const { return fForceTrigPeriod; }
+    float    GetForceTrigPeriod() const { return fForceTrigPeriod; }
     uint16_t GetHeartbeatPeriod() const { return fHeartBeatPeriod; }
     uint16_t GetBatVoltLowPwr() const { return fBatVoltLowPwr; }
     uint16_t GetVoltCheckPeriod() const { return fVoltCheckPeriod; }
@@ -320,9 +321,15 @@
 #ifdef DEBUG
             printf("thm=%d\r\n",(int)fEnableThermTrig);
 #endif
-            b           = SnBitUtils::ReadFrom(b, fForceTrigPeriod);
+            if (Rv>3) {
+                b       = SnBitUtils::ReadFrom(b, fForceTrigPeriod);
+            } else {
+                uint16_t ftrg(0);
+                b       = SnBitUtils::ReadFrom(b, ftrg);
+                fForceTrigPeriod = ftrg;
+            }
 #ifdef DEBUG
-            printf("force=%hu\r\n",fForceTrigPeriod);
+            printf("force=%g\r\n",fForceTrigPeriod);
 #endif
             b           = SnBitUtils::ReadFrom(b, fHeartBeatPeriod);
 #ifdef DEBUG