Skip to content

ST targets: Replace UARTSerial references with BufferedSerial #12208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ nsapi_error_t STModCellular::soft_power_off()
}

#if MBED_CONF_STMOD_CELLULAR_PROVIDE_DEFAULT
#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"
CellularDevice *CellularDevice::get_default_instance()
{
tr_debug("STMOD_CELLULAR default instance");

static UARTSerial serial(MBED_CONF_STMOD_CELLULAR_TX, MBED_CONF_STMOD_CELLULAR_RX, MBED_CONF_STMOD_CELLULAR_BAUDRATE);
static BufferedSerial serial(MBED_CONF_STMOD_CELLULAR_TX, MBED_CONF_STMOD_CELLULAR_RX, MBED_CONF_STMOD_CELLULAR_BAUDRATE);
if ((MBED_CONF_STMOD_CELLULAR_CTS != NC) && (MBED_CONF_STMOD_CELLULAR_RTS != NC)) {
serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "platform/mbed_thread.h"
#include "PinNames.h"

#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"
#include "ONBOARD_TELIT_HE910.h"
#include "ThisThread.h"
#include "CellularLog.h"
Expand Down Expand Up @@ -80,7 +80,7 @@ void ONBOARD_TELIT_HE910::press_power_button(int time_ms)

CellularDevice *CellularDevice::get_target_default_instance()
{
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
static BufferedSerial serial(MDMTXD, MDMRXD, 115200);
#if DEVICE_SERIAL_FC
if (MDMRTS != NC && MDMCTS != NC) {
tr_debug("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "platform/mbed_thread.h"
#include "PinNames.h"

#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"
#include "ONBOARD_TELIT_HE910.h"
#include "ThisThread.h"
#include "CellularLog.h"
Expand Down Expand Up @@ -76,7 +76,7 @@ void ONBOARD_TELIT_HE910::press_power_button(int time_ms)

CellularDevice *CellularDevice::get_target_default_instance()
{
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
static BufferedSerial serial(MDMTXD, MDMRXD, 115200);
#if DEVICE_SERIAL_FC
if (MDMRTS != NC && MDMCTS != NC) {
tr_debug("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "platform/mbed_wait_api.h"
#include "PinNames.h"

#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"
#include "ONBOARD_TELIT_HE910.h"
#include "ThisThread.h"
#include "CellularLog.h"
Expand Down Expand Up @@ -80,7 +80,7 @@ void ONBOARD_TELIT_HE910::press_power_button(int time_ms)

CellularDevice *CellularDevice::get_target_default_instance()
{
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
static BufferedSerial serial(MDMTXD, MDMRXD, 115200);
#if DEVICE_SERIAL_FC
if (MDMRTS != NC && MDMCTS != NC) {
tr_debug("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@
#include "ONBOARD_UBLOX_AT.h"
#include "ONBOARD_UBLOX_PPP.h"
#include "ONBOARD_UBLOX_N2XX.h"
#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"

using namespace mbed;

CellularDevice *CellularDevice::get_target_default_instance()
{
#if defined(TARGET_UBLOX_C030_R41XM)
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static BufferedSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static ONBOARD_UBLOX_AT device(&serial);
#elif defined(TARGET_UBLOX_C030_N211)
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static BufferedSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static ONBOARD_UBLOX_N2XX device(&serial);
#elif defined(TARGET_UBLOX_C030_U201)
#if (NSAPI_PPP_AVAILABLE)
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static BufferedSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static ONBOARD_UBLOX_PPP device(&serial);
#else
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static BufferedSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static ONBOARD_UBLOX_AT device(&serial);
#endif
#else //UBLOX_C027
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static BufferedSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
static ONBOARD_UBLOX_PPP device(&serial);
#endif
return &device;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "gpio_api.h"
#include "platform/mbed_thread.h"
#include "PinNames.h"
#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"

#define WAIT_AFTER_POWR_CHANGED (1000) // [msec.]

Expand Down Expand Up @@ -115,7 +115,7 @@ void ONBOARD_QUECTEL_UG96::onboard_modem_power_down()

CellularDevice *CellularDevice::get_target_default_instance()
{
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
static BufferedSerial serial(MDMTXD, MDMRXD, 115200);
static ONBOARD_QUECTEL_UG96 device(&serial);
return &device;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "gpio_api.h"
#include "platform/mbed_thread.h"
#include "PinNames.h"
#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"

#define WAIT_AFTER_POWR_CHANGED (1000) // [msec.]

Expand Down Expand Up @@ -111,7 +111,7 @@ void ONBOARD_QUECTEL_BG96::onboard_modem_power_down()

CellularDevice *CellularDevice::get_target_default_instance()
{
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
static BufferedSerial serial(MDMTXD, MDMRXD, 115200);
static ONBOARD_QUECTEL_BG96 device(&serial);
return &device;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "gpio_api.h"
#include "platform/mbed_thread.h"
#include "PinNames.h"
#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"
#include "CellularLog.h"
#include "mbed_wait_api.h"

Expand Down Expand Up @@ -56,7 +56,7 @@ nsapi_error_t ONBOARD_SARA4_PPP::soft_power_off()

CellularDevice *CellularDevice::get_target_default_instance()
{
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
static BufferedSerial serial(MDMTXD, MDMRXD, 115200);
#if DEVICE_SERIAL_FC
if (MDMRTS != NC && MDMCTS != NC) {
tr_debug("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "ONBOARD_QUECTEL_BC95.h"

#include "UARTSerial.h"
#include "drivers/BufferedSerial.h"
#include "CellularLog.h"

using namespace mbed;
Expand Down Expand Up @@ -49,7 +49,7 @@ nsapi_error_t ONBOARD_QUECTEL_BC95::soft_power_off()

CellularDevice *CellularDevice::get_target_default_instance()
{
static UARTSerial serial(MDMTXD, MDMRXD, 9600);
static BufferedSerial serial(MDMTXD, MDMRXD, 9600);
#if DEVICE_SERIAL_FC
if (MDMRTS != NC && MDMCTS != NC) {
tr_debug("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
Expand Down