Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
76:f8383f0292c2
Parent:
75:25917891f08a
Child:
77:c08e5662d464
--- a/SnConfigFrame.cpp	Tue Feb 10 23:31:10 2015 +0000
+++ b/SnConfigFrame.cpp	Sun Feb 22 20:42:44 2015 +0000
@@ -7,6 +7,7 @@
 #include "SnBitUtils.h"
 #include "SnHeaderFrame.h"
 #include "Watchdog.h"
+#include "SnSDUtils.h"
 
 extern "C" void mbed_mac_address(char *);
 
@@ -53,7 +54,7 @@
 }
 
 void SnConfigFrame::SetHardDefaults() {
-    sprintf(fLabel,"Stn15HardDefaults");
+    sprintf(fLabel,"Stn14HardDefR76");
     fConfTime           = 1338854400u; // Tue, 05 Jun 2012 00:00:00 GMT
     fRun                = 0;
     fFirstSeq           = 0;
@@ -85,7 +86,7 @@
     fHeartBeatPeriod    = 0;
     fAmpsOn             = 0x0Fu;
     fEvtThrtlPeriodMs   = 0;
-    fPowerMode          = kIridComWin;
+    fPowerMode          = kIridComWin | kAfarComWin;
     fBatVoltToLowPwr    = 0;
     fBatVoltFromLowPwr  = 0;
     fVoltCheckPeriod    = 127u; 
@@ -200,8 +201,8 @@
                     ipbytes[2], ipbytes[3]);
             ok = nc>0;
         }
+        fclose(ipf);
     }
-    fclose(ipf);
 #ifdef DEBUG
     printf("ReadOneIPInto : ipstr=[%s], ok=%d\r\n",
         ipstr, (int)ok);
@@ -228,8 +229,8 @@
     FILE* pf = fopen(kDefRemPortFilen, "r"); 
     if (pf!=0) {
         ok = (1==fscanf(pf, "%hu\n", &fRemotePort));
+        fclose(pf);
     }
-    fclose(pf);
 #ifdef DEBUG
     printf("port   = %hu\r\n", fRemotePort);
 #endif
@@ -576,4 +577,9 @@
         fclose(cf);
     }
     return ret;
-}
\ No newline at end of file
+}
+
+void SnConfigFrame::SetSDNeedToInitFlag() {
+    // reset the SD card init cache, in case the SD ignore run mode changed
+    SnSDUtils::SetDoNeedToInit();
+}