Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
6:6f002d202f59
Parent:
5:9cea89700c66
Child:
7:079617408fec
--- a/main.cpp	Fri Aug 03 00:04:34 2012 +0000
+++ b/main.cpp	Fri Aug 03 23:50:57 2012 +0000
@@ -102,12 +102,14 @@
 // i/o
 static time_t         gLastCommWin      = 0;
 static const uint32_t gBufSize=SnStatusFrame::kMaxSizeOf + SnHeaderFrame::kMaxSizeOf;
-static const uint32_t gB64Bsize=BASE64ENC_LEN(gBufSize)+1;
-static char           gB64Buf[gB64Bsize];
+//static const uint32_t gB64Bsize=BASE64ENC_LEN(gBufSize)+1;
+//static char           gB64Buf[gB64Bsize];
 static char           gGenBuf[gBufSize]; // must be big enough for event or status or config!
 //static SnCommWin*     gComms[kNcomms]   = { new SnCommAfar, new SnCommUsb(&gCpu) }; // order => priority
 //static SnCommWin*     gComms[kNcomms]   = { new SnCommUsb(&gCpu) }; // order => priority
-static SnCommWin*     gComms[kNcomms]   = { new SnCommAfar(gB64Buf, gB64Bsize) }; // order => priority
+//static SnCommWin*     gComms[kNcomms]   = { new SnCommAfar(gB64Buf, gB64Bsize) }; // order => priority
+//static SnCommWin*     gComms[kNcomms]   = { new SnCommAfarTCP(false) }; // order => priority
+static SnCommWin*     gComms[kNcomms]   = { 0 }; // order => priority
 
 void procForceTrigger() {
     led3=!led3;
@@ -343,6 +345,9 @@
         PIN_afar_power = gConf.GetPowPinSetting(SnConfigFrame::kAfarDatTak);
         wait_ms(10);
     }
+    printf("set power (iscom %d, pw %hhu): cards %d, amps %d, irid %d, afar %d\r\n",
+        isCommWin, gConf.GetPowerMode(), PIN_turn_on_system.read(), PIN_turn_on_amps.read(),
+        PIN_iridSbd_power.read(), PIN_afar_power.read());
 }
 
 //
@@ -371,7 +376,7 @@
     MakeOutputFile();
     
     // TODO: turn on amps individually, when that's possible
-    PIN_turn_on_amps = gConf.IsEachAmpOn() ? 0 : 1;
+    // PIN_turn_on_amps = gConf.IsEachAmpOn() ? 0 : 1;
     
     // Set PLA value(s)
     PIN_spi.format( 16, 0 ); // change mode for DAC & PLA value setting
@@ -478,6 +483,10 @@
 void WaitTrigAndSendClock() {
     
     printf("WaitTrigAndSendClock\r\n");
+    printf("wait trig: (pw %hhu): cards %d, amps %d, irid %d, afar %d\r\n",
+        gConf.GetPowerMode(), PIN_turn_on_system.read(), PIN_turn_on_amps.read(),
+        PIN_iridSbd_power.read(), PIN_afar_power.read());
+
     if (gFirstEvt==false) {
         PIN_DoNotRestartAllClocks    = 0;
         wait_us(1);