diff --git a/libraries/mbed/api/SerialBase.h b/libraries/mbed/api/SerialBase.h index f3b1a9e0d7..57705f3262 100644 --- a/libraries/mbed/api/SerialBase.h +++ b/libraries/mbed/api/SerialBase.h @@ -107,6 +107,7 @@ public: */ void send_break(); +#if DEVICE_SERIAL_FC /** Set the flow control type on the serial port * * @param type the flow control type (Disabled, RTS, CTS, RTSCTS) @@ -114,6 +115,7 @@ public: * @param flow2 the second flow control pin (CTS for RTSCTS) */ void set_flow_control(Flow type, PinName flow1=NC, PinName flow2=NC); +#endif static void _irq_handler(uint32_t id, SerialIrq irq_type); diff --git a/libraries/mbed/common/SerialBase.cpp b/libraries/mbed/common/SerialBase.cpp index 10a6fb61dd..93cbbb9fa4 100644 --- a/libraries/mbed/common/SerialBase.cpp +++ b/libraries/mbed/common/SerialBase.cpp @@ -81,6 +81,7 @@ void SerialBase::send_break() { serial_break_clear(&_serial); } +#ifdef DEVICE_SERIAL_FC void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) { FlowControl flow_type = (FlowControl)type; switch(type) { @@ -100,6 +101,7 @@ void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) { break; } } +#endif } // namespace mbed diff --git a/libraries/mbed/common/not_implemented.c b/libraries/mbed/common/not_implemented.c deleted file mode 100644 index 53170b0dd2..0000000000 --- a/libraries/mbed/common/not_implemented.c +++ /dev/null @@ -1,28 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Default versions of various HAL functions that might not be implemented for some platforms. - -#include "toolchain.h" -#include "serial_api.h" -#include "error.h" - -WEAK void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow); -WEAK void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow) { - if (FlowControlNone != type) - error("hardware flow control not implemented on this platform"); -} - diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/device.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/device.h index 50bd1f980a..a4646b7a00 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/device.h +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/device.h @@ -26,6 +26,7 @@ #define DEVICE_ANALOGOUT 1 #define DEVICE_SERIAL 1 +#define DEVICE_SERIAL_FC 1 #define DEVICE_I2C 1 #define DEVICE_I2CSLAVE 1 diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC81X/device.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC81X/device.h index 88e5cf66b3..4ec1781cea 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC81X/device.h +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC81X/device.h @@ -26,6 +26,7 @@ #define DEVICE_ANALOGOUT 0 #define DEVICE_SERIAL 1 +#define DEVICE_SERIAL_FC 1 #define DEVICE_I2C 1 #define DEVICE_I2CSLAVE 0