mirror of https://github.com/ARMmbed/mbed-os.git
Implement override of enable_* functions
parent
7b8ca37bd7
commit
0214a156e7
|
@ -143,6 +143,35 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
/** Enable or disable input
|
||||
*
|
||||
* Control enabling of device for input. This is primarily intended
|
||||
* for temporary power-saving; the overall ability of the device to operate
|
||||
* for input and/or output may be fixed at creation time, but this call can
|
||||
* allow input to be temporarily disabled to permit power saving without
|
||||
* losing device state.
|
||||
*
|
||||
* @param enabled true to enable input, false to disable.
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return Negative error code on failure
|
||||
*/
|
||||
int enable_input(bool enabled) override;
|
||||
|
||||
/** Enable or disable output
|
||||
*
|
||||
* Control enabling of device for output. This is primarily intended
|
||||
* for temporary power-saving; the overall ability of the device to operate
|
||||
* for input and/or output may be fixed at creation time, but this call can
|
||||
* allow output to be temporarily disabled to permit power saving without
|
||||
* losing device state.
|
||||
*
|
||||
* @param enabled true to enable output, false to disable.
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return Negative error code on failure
|
||||
*/
|
||||
int enable_output(bool enabled) override;
|
||||
|
||||
/** Check for poll event flags
|
||||
* Check the events listed in events to see if data can be read or written
|
||||
|
@ -157,8 +186,6 @@ public:
|
|||
|
||||
using SerialBase::attach;
|
||||
using SerialBase::baud;
|
||||
using SerialBase::enable_input;
|
||||
using SerialBase::enable_output;
|
||||
using SerialBase::format;
|
||||
using SerialBase::readable;
|
||||
using SerialBase::writeable;
|
||||
|
|
|
@ -99,6 +99,24 @@ short UnbufferedSerial::poll(short events) const
|
|||
return revents;
|
||||
}
|
||||
|
||||
int UnbufferedSerial::enable_input(bool enabled)
|
||||
{
|
||||
lock();
|
||||
SerialBase::enable_input(enabled);
|
||||
unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UnbufferedSerial::enable_output(bool enabled)
|
||||
{
|
||||
lock();
|
||||
SerialBase::enable_output(enabled);
|
||||
unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if DEVICE_SERIAL_FC
|
||||
void UnbufferedSerial::set_flow_control(Flow type, PinName flow1, PinName flow2)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue