RealtimeCompLab2
Dependencies: mbed
Fork of PPP-Blinky by
Diff: main.cpp
- Revision:
- 54:13f83621db80
- Parent:
- 53:3a8a37fda757
- Parent:
- 51:a86d56844324
- Child:
- 55:43faae812be3
--- a/main.cpp Sun Jan 29 21:24:43 2017 +0000 +++ b/main.cpp Sun Jan 29 21:34:46 2017 +0000 @@ -34,11 +34,10 @@ Serial xx(PC_10, PC_11); // Not necessary to run - if you have a compile error here change line 31 to SERIAL_PORT_MONITOR_NO #define debug(x...) xx.printf (x) #else -// no debug monitoring #define debug(x...) {} #endif -Serial pc(USBTX, USBRX); // The serial port on your mbed hardware. Your PC thinks this is a dial-up modem. +Serial pc(USBTX, USBRX); // The serial port on your mbed hardware. Your PC thinks this serial port is a dial-up modem. int v0=1; int v1=1; // verbosity flags used in debug printouts - change to 1/0 to see more/less debug info @@ -859,8 +858,7 @@ ppp.hdlc.frameBusy=0; // done gathering frame if (ppp.rx.tail == 0) { // did we just wrap around? ppp.hdlc.frameEndIndex=BUFLEN-1; // wrap back to end of buffer - } - else { + } else { ppp.hdlc.frameEndIndex=ppp.rx.tail-1; // remember where frame ends } processHDLCFrame(ppp.hdlc.frameStartIndex, ppp.hdlc.frameEndIndex); @@ -897,7 +895,7 @@ pppInitStruct(); // initialize all the PPP properties pc.attach(&rxHandler,Serial::RxIrq); // start the receive handler while(1) { - scanForConnectString(); // respond to connect string from PC + scanForConnectString(); // respond to connect command from windows dial up networking wait_for_HDLC_frame(); } }