S K UCI / Mbed 2 deprecated AutonomousDAQ

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
25:57b2627fe756
Parent:
18:55f1581f2ee4
diff -r 7d725fc8201e -r 57b2627fe756 SnCommUsb.cpp
--- a/SnCommUsb.cpp	Tue Oct 23 20:58:29 2012 +0000
+++ b/SnCommUsb.cpp	Tue Oct 30 05:23:57 2012 +0000
@@ -10,6 +10,8 @@
 
 #include "Watchdog.h"
 
+//#define DEBUG
+
 #define CALL_MEMBER_FN(object,ptrToMember)  ((object).*(ptrToMember))
 
 SN_USB_SERIAL* SnCommUsb::fgCpu     =  0;
@@ -18,11 +20,14 @@
 
 SnCommWin::ECommWinResult SnCommUsb::SetupPort(SN_USB_SERIAL* cpu) {
     fgCpu = cpu;
-    
+
+#ifdef DEBUG
+    printf("fgCpu=%p\r\n",fgCpu);
+#endif
+
     // set up serial-usb port
     if (fgCpu!=0) {
-        //fgCpu->baud( 230400 );
-        fgCpu->baud( 115200 );
+        fgCpu->baud( CPUBAUD_SN );
         fgCpu->format( 8, Serial::None, 1 );
 #ifdef USE_MODSERIAL
         fgCpu->txBufferFlush();
@@ -95,6 +100,10 @@
 
 int32_t SnCommUsb::SendAll(char* const data, const uint32_t length,
                            const uint32_t timeout_clock) {
+#ifdef DEBUG
+    printf("calling (PutC)DoIO len=%u, to=%u, time=%u\r\n",
+        length, timeout_clock, time(0));
+#endif
     return DoIO(data, length, timeout_clock, &SN_USB_SERIAL::writeable, &SnCommUsb::PutC);
 }
 
@@ -116,6 +125,9 @@
         Connect(timeout) ? SnCommWin::kConnected : SnCommWin::kCanNotConnect;
     
     if (sendStatus) {
+#ifdef DEBUG
+        printf("SnCommUsb calling SendStatus\r\n");
+#endif
         ret = SendStatus(conf, evt, pow, seq, thmrate, evtrate, genBuf, timeout);
     }