Add a ring buffer to the serial repeater. Uncompiled on the STM32

platform.
This commit is contained in:
Jonathan Naylor 2017-04-24 18:02:36 +01:00
parent 6161d298f7
commit 99ac6146d9
5 changed files with 96 additions and 53 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -54,6 +54,20 @@ int CSerialPort::availableInt(uint8_t n)
}
}
int CSerialPort::availableForWriteInt(uint8_t n)
{
switch (n) {
case 1U:
return Serial.availableForWrite();
case 2U:
return Serial2.availableForWrite();
case 3U:
return Serial3.availableForWrite();
default:
return false;
}
}
uint8_t CSerialPort::readInt(uint8_t n)
{
switch (n) {