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
Diff: src/serial.cpp
- Revision:
- 2:46faae84b8b0
- Parent:
- 1:9f8583ba2431
- Child:
- 3:d8948c5b2951
--- a/src/serial.cpp Sun Nov 25 00:36:35 2018 +0000 +++ b/src/serial.cpp Sun Nov 25 01:23:33 2018 +0000 @@ -16,14 +16,14 @@ // set up serial port for 115200 baud -Serial pc(USBTX, USBRX, 115200); +Serial dcm1(USBTX, USBRX, 115200); // initialize the serial port variables void initSerial(void) { // create the RxIRQ callback - pc.attach(&Rx_IRQHandler, Serial::RxIrq); + dcm1.attach(&Rx_IRQHandler, Serial::RxIrq); } @@ -35,10 +35,10 @@ serialStatus.repeat = FALSE; // check if the USART1 receive interrupt flag was set - while (pc.readable()) + while (dcm1.readable()) { //led_usb = 0; - rxbuf[bufloc] = pc.getc(); + rxbuf[bufloc] = dcm1.getc(); if (rxbuf[bufloc] == CR) // check for end of command { @@ -61,7 +61,7 @@ // Echo character back out the serial port if (!serialStatus.computer) { - pc.putc((unsigned char)rxbuf[bufloc]); + dcm1.putc((unsigned char)rxbuf[bufloc]); } // handle backspace @@ -132,7 +132,7 @@ void sendSerial(char *buf) { //led_usb = 0; - pc.printf(buf); + dcm1.printf(buf); //led_usb = 1; }