Merge pull request #8671 from mray19027/uart_break

Feature: Add non-blocking serial break/unbreak functions
pull/8803/head
Martin Kojtal 2018-11-19 13:14:55 +00:00 committed by GitHub
commit 9aef9d3661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -118,6 +118,20 @@ int SerialBase::_base_putc(int c)
return c;
}
void SerialBase::set_break()
{
lock();
serial_break_set(&_serial);
unlock();
}
void SerialBase::clear_break()
{
lock();
serial_break_clear(&_serial);
unlock();
}
void SerialBase::send_break()
{
lock();

View File

@ -137,6 +137,16 @@ public:
attach(callback(obj, method), type);
}
/** Generate a break condition on the serial line
* NOTE: Clear break needs to run at least one frame after set_break is called
*/
void set_break();
/** Clear a break condition on the serial line
* NOTE: Should be run at least one frame after set_break is called
*/
void clear_break();
/** Generate a break condition on the serial line
*/
void send_break();