Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
40:1324da35afd4
Parent:
39:2f17131d22a5
Child:
42:ac162d15e578
--- a/SnConstants.h	Tue Jul 30 02:03:21 2013 +0000
+++ b/SnConstants.h	Sat Oct 05 04:45:22 2013 +0000
@@ -7,12 +7,14 @@
 //
 // constants
 //
-static const bool     kIridAfarPwrSame  = false; // true if Iridium & Afar are on the same relay, false if not
+// if these change, it is likely that some i/o version (config, event, etc) will need to change
+static const bool     kIridPwrFromAfar  = false; // true if Iridium & Afar are on the same relay, false if not
 static const uint32_t kBStime           = 946684800u; // 1/1/2000 00:00:00 UTC
 static const uint8_t  kNchans           = 4u;
 static const uint8_t  kNsamps           = 128u;
 static const uint8_t  kNfpgaDacs        = 4u;
-static const uint8_t  kNplas            = 5u;//72;
+static const uint8_t  kNplasV1          = 5u;//72;  // update config i/o version if this changes
+static const uint8_t  kNplas            = kNplasV1; // update config i/o version if this changes
 static const uint16_t kNoTrigPla        = 0x0000u;
 static const uint8_t  kNcomms           = 1u;
 static const uint16_t kNvoltsAve        = 500u; // must be greater than ~10 (but not checked. <2 will result in divide by 0)
@@ -20,14 +22,22 @@
 
 static const uint32_t kAbsMaxTimer      = 1800u; // timers use integers counting us and can't go longer than ~ this many secs
 
+// NOTE: these times (in sec) must be less than kAbsMaxTimer (this is not checked, however)
+static const uint8_t  kDefTimeoutMin    = 3u;    // minutes. used in case a clock error is detected or range needs enforcing
+static const uint32_t kCommWinLongPrdTk = 300u;  // seconds. check if it's time for a comm win every X sec. this way comm per can be longer than Timer allows
+
+static const uint16_t kMaxConsecCommFails = 4;    // (exclusive) number of times a comm win can fail before the mbed resets
+
 // safety nets
+static const uint16_t kMaxFirstSeq      = 25000;  // max specifiable seq number -- leave room to grow
 static const float    kMinForcePer      = 0.05;   // seconds -- safety net for max force trigger rate
 static const uint16_t kMaxThrottlePerMs = 60000;  // ms -- max time between thermal triggers
 static const uint16_t kMaxBatVoltLowPwr = 25000;  // ADCs -- probably futile, but try to prevent it from being in low power mode always
+static const uint32_t kMinCommWinPeriod = 120;    // seconds -- min time between communication windows
 static const uint32_t kMaxCommWinPeriod = 259200; // seconds -- max time between communication windows
-static const uint32_t kMinCommWinDur    = 300;    // seconds -- min communication window duration -- must be >= Ncomms*listen/connect timeout
+static const uint32_t kMinCommWinDur    = 600;    // seconds -- min communication window duration -- must be >= Ncomms*listen/connect timeout
 static const uint32_t kMaxWatchDogPer   = 3600;   // seconds -- max time before watchdog reset on idle
-static const uint32_t kMinWatchDogPer   = 30;     // seconds -- min time before watchdog reset on idle
+static const uint32_t kMinWatchDogPer   = 300;    // seconds -- min time before watchdog reset on idle
 
 static const uint16_t kTotSamps         = kNchans*kNsamps;
 static const uint16_t kTotDacs          = kNchans*kNfpgaDacs;