Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
28:484943132bb0
Parent:
27:efc4d654b139
Child:
30:f869ed4bcc08
--- a/SnConstants.h	Thu Nov 01 07:00:17 2012 +0000
+++ b/SnConstants.h	Sat Nov 24 06:38:43 2012 +0000
@@ -18,21 +18,29 @@
 static const uint8_t  kNfpgaDacs        = 4u;
 static const uint8_t  kNplas            = 5u;//72;
 static const uint16_t kNoTrigPla        = 0x0000u;
-static const uint8_t  kNcomms           = 1u;
+static const uint8_t  kNcomms           = 2u;
 static const uint16_t kNvoltsAve        = 500u; // must be greater than ~10 (but not checked. <2 will result in divide by 0)
 static const float    kAsfClkPrdUs      = 8.535; // us -- change kAdcToMBtimeCut if this is <=2us
 
-
 static const uint32_t kAbsMaxTimer      = 1800u; // timers use integers counting us and can't go longer than ~ this many secs
 // NOTE: these times below must be less than kAbsMaxTimer (this is not checked, however)
-static const uint32_t kDefTimeout       = 300u;  // seconds
-static const uint32_t kConnectTimeout   = 30u;   // seconds
-static const uint32_t kListenTimeout    = 300u;  // seconds
-static const uint32_t kConnectSBDTO     = 300u;  // seconds
+static const uint32_t kDefTimeout       = 120u;  // seconds
+static const uint32_t kConnectTimeout   = 120u;  // seconds
+static const uint32_t kListenTimeout    = 120u;  // seconds
+static const uint32_t kConnectSBDTO     = 180u;  // seconds
 static const uint32_t kCommWinLongPrdTk = 300u;  // seconds
 static const uint32_t kSecsPerDay       = 3600u*24u;
 static const uint32_t kSecsPerYear      = kSecsPerDay*365u;
 
+// safety nets
+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 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 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 uint16_t kTotSamps         = kNchans*kNsamps;
 static const uint16_t kTotDacs          = kNchans*kNfpgaDacs;