Daniel Vizcaya / Mbed OS 04_RTOS_Embebidos
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers greentea_serial.cpp Source File

greentea_serial.cpp

00001 #include "greentea-client/greentea_serial.h"
00002 
00003 /**
00004  * Macros for setting console flow control.
00005  */
00006 #define CONSOLE_FLOWCONTROL_RTS     1
00007 #define CONSOLE_FLOWCONTROL_CTS     2
00008 #define CONSOLE_FLOWCONTROL_RTSCTS  3
00009 #define mbed_console_concat_(x) CONSOLE_FLOWCONTROL_##x
00010 #define mbed_console_concat(x) mbed_console_concat_(x)
00011 #define CONSOLE_FLOWCONTROL mbed_console_concat(MBED_CONF_TARGET_CONSOLE_UART_FLOW_CONTROL)
00012 
00013 SingletonPtr<GreenteaSerial> greentea_serial;
00014 
00015 GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE) {
00016 #if   CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
00017     set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC);
00018 #elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS
00019     set_flow_control(SerialBase::CTS, NC, STDIO_UART_CTS);
00020 #elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTSCTS
00021     set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS);
00022 #endif
00023 }