diff --git a/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp b/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp index 4b5628ea7f..fc4de7f8a7 100644 --- a/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp +++ b/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp @@ -109,7 +109,6 @@ nsapi_error_t STModCellular::soft_power_on() tr_debug("Modem %sready to receive AT commands\r\n", rdy ? "" : "NOT "); -#if DEVICE_SERIAL_FC if ((MBED_CONF_STMOD_CELLULAR_CTS != NC) && (MBED_CONF_STMOD_CELLULAR_RTS != NC)) { tr_debug("Enable flow control\r\n"); @@ -133,7 +132,6 @@ nsapi_error_t STModCellular::soft_power_on() tr_error("Failed to enable hw flow control\r\n"); } } -#endif rtos::ThisThread::sleep_for(500); @@ -165,10 +163,10 @@ CellularDevice *CellularDevice::get_default_instance() tr_debug("MODEM default instance\r\n"); static UARTSerial serial(MBED_CONF_STMOD_CELLULAR_TX, MBED_CONF_STMOD_CELLULAR_RX, MBED_CONF_STMOD_CELLULAR_BAUDRATE); -#if defined (MBED_CONF_STMOD_CELLULAR_RTS) && defined(MBED_CONF_STMOD_CELLULAR_CTS) - tr_debug("STMOD_CELLULAR flow control: RTS %d CTS %d\r\n", MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS); - serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS); -#endif + if ((MBED_CONF_STMOD_CELLULAR_CTS != NC) && (MBED_CONF_STMOD_CELLULAR_RTS != NC)) { + tr_debug("STMOD_CELLULAR flow control: RTS %d CTS %d\r\n", MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS); + serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS); + } static STModCellular device(&serial); return &device; } diff --git a/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json b/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json index d1f65bb004..ec5c02537b 100644 --- a/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json +++ b/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json @@ -65,5 +65,10 @@ "help": "Provide as default CellularDevice [true/false]", "value": false } + }, + "target_overrides": { + "DISCO_L4R9I": { + "rts": "NC" + } } }