Add TX Delay buffer protection.

This commit is contained in:
Jonathan Naylor 2017-04-02 13:48:40 +01:00
parent e93b264d9c
commit c0941c4856
5 changed files with 14 additions and 2 deletions

View file

@ -152,6 +152,9 @@ void CYSFTX::writeByte(uint8_t c)
void CYSFTX::setTXDelay(uint8_t delay)
{
m_txDelay = 600U + uint16_t(delay) * 12U; // 500ms + tx delay
if (m_txDelay > 1200U)
m_txDelay = 1200U;
}
uint8_t CYSFTX::getSpace() const