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.
Fork of football_project by
Diff: io/MySerial.cpp
- Revision:
- 9:95dc84e9fb7f
- Parent:
- 8:d5d055be2bb8
- Child:
- 15:b86c4b798aa1
--- a/io/MySerial.cpp Sat Apr 18 22:14:18 2015 +0000
+++ b/io/MySerial.cpp Sun Apr 19 19:59:46 2015 +0000
@@ -92,19 +92,19 @@
obj->uart->PSELCTS = ((NC == cts) ? 0xFFFFFFFF : cts); // CTS_PIN_NUMBER
obj->uart->PSELRXD = rx; // RX_PIN_NUMBER
+ // set default baud rate and format
+ serial_baud ( obj, baudrate );
+ serial_format( obj, 8, ParityNone, 1 );
+
if( (NC != rts) || (NC != cts) )
{
- obj->uart->CONFIG |= 0x01; // Enable HWFC
+ obj->uart->CONFIG |= UART_CONFIG_HWFC_Msk; // Enable HWFC
} else
{
- obj->uart->CONFIG &= ~0x01; // Disable HWFC;
+ obj->uart->CONFIG &= ~UART_CONFIG_HWFC_Msk; // Disable HWFC;
}
- // set default baud rate and format
- serial_baud ( obj, baudrate );
- serial_format( obj, 8, ParityNone, 1 );
-
obj->uart->ENABLE = (UART_ENABLE_ENABLE_Enabled << UART_ENABLE_ENABLE_Pos);
obj->uart->TASKS_STARTTX = 1;
obj->uart->TASKS_STARTRX = 1;
@@ -114,7 +114,7 @@
obj->uart->TXD = 0;
obj->index = 0;
-
+
// set rx/tx pins in PullUp mode
if (tx != NC) {
pin_mode(tx, PullUp);
