mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-28 06:24:10 +01:00
LP-457 Add missing PIOS_COM_ClearRxBuffer() to simposix target
This commit is contained in:
parent
a564a45cb6
commit
7b6cce7bcb
@ -280,6 +280,26 @@ int32_t PIOS_COM_ChangeBaud(uint32_t com_id, uint32_t baud)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear Rx buffer
|
||||
* \param[in] port COM port
|
||||
* \return -1 if port not available
|
||||
* \return 0 on success
|
||||
*/
|
||||
int32_t PIOS_COM_ClearRxBuffer(uint32_t com_id)
|
||||
{
|
||||
struct pios_com_dev *com_dev = PIOS_COM_find_dev(com_id);
|
||||
|
||||
if (!PIOS_COM_validate(com_dev)) {
|
||||
/* Undefined COM port for this board (see pios_board.c) */
|
||||
return -1;
|
||||
}
|
||||
|
||||
fifoBuf_clearData(&com_dev->rx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a package over given port
|
||||
* \param[in] port COM port
|
||||
|
Loading…
Reference in New Issue
Block a user