Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
Diff: main.cpp
- Revision:
- 31:b5bd3b189150
- Parent:
- 30:f869ed4bcc08
- Child:
- 32:20877f862cf0
--- a/main.cpp Wed Nov 28 01:24:23 2012 +0000 +++ b/main.cpp Wed Jan 23 19:29:01 2013 +0000 @@ -3,6 +3,8 @@ #include "Watchdog.h" Watchdog::SnKickStarter gKickStarter(WDFAILSAFE); +#define DISABLE_CONFIG_SAFETYNETS + #define ENABLE_AFAR_COMM #define ENABLE_SBD_COMM //#define ENABLE_USB_COMM @@ -48,6 +50,7 @@ #include "RtosTimer.h" #endif + // // MBED PINS (ordered by number) // @@ -155,7 +158,11 @@ #endif static Timer gTrgTimer; static Timer gAdcToMBtimer; +#ifdef DISABLE_CONFIG_SAFETYNETS +static SnConfigFrame gConf(false); +#else static SnConfigFrame gConf; +#endif static SnEventFrame gEvent; static SnPowerFrame gPower; // parameters @@ -326,7 +333,7 @@ } } if (changed) { - SetPower(isCommWin); + SetPower(isCommWin); // TODO: This will fail if isCommWin==false? (currently not possible, but..) #ifdef DEBUG printf("Using config %s\r\n",gConf.GetLabel()); #endif @@ -1399,9 +1406,9 @@ (*cw)->CloseConn(gConf.GetTimeoutTime(gLastCommWin,gConf.GetCommWinDuration())); Watchdog::kick(); // don't reset! // after normal Afar connection closed, try to tweet +#if defined(ENABLE_AFAR_TWITTER) && defined(ENABLE_AFAR_COMM) if ((*cw)->GetCommType()==SnConfigFrame::kAfar) { // tweet -#if defined(ENABLE_AFAR_TWITTER) && defined(ENABLE_AFAR_COMM) #ifdef DEBUG printf("for twitter: gTwit=%p, doTwitter=%d\r\n",gTwit,(int)doTwitter); #endif