Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
Diff: SnCommUsb.cpp
- Revision:
- 25:57b2627fe756
- Parent:
- 18:55f1581f2ee4
--- 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);
}