mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Ability to see how many Tx bytes are free in serial port buffer
This commit is contained in:
parent
d0b940bf75
commit
6e504ca52a
13 changed files with 90 additions and 22 deletions
|
@ -360,7 +360,7 @@ void gpsThread(void)
|
|||
{
|
||||
// read out available GPS bytes
|
||||
if (gpsPort) {
|
||||
while (serialTotalBytesWaiting(gpsPort))
|
||||
while (serialRxBytesWaiting(gpsPort))
|
||||
gpsNewData(serialRead(gpsPort));
|
||||
}
|
||||
|
||||
|
@ -1036,14 +1036,14 @@ void gpsEnablePassthrough(serialPort_t *gpsPassthroughPort)
|
|||
#endif
|
||||
char c;
|
||||
while(1) {
|
||||
if (serialTotalBytesWaiting(gpsPort)) {
|
||||
if (serialRxBytesWaiting(gpsPort)) {
|
||||
LED0_ON;
|
||||
c = serialRead(gpsPort);
|
||||
gpsNewData(c);
|
||||
serialWrite(gpsPassthroughPort, c);
|
||||
LED0_OFF;
|
||||
}
|
||||
if (serialTotalBytesWaiting(gpsPassthroughPort)) {
|
||||
if (serialRxBytesWaiting(gpsPassthroughPort)) {
|
||||
LED1_ON;
|
||||
serialWrite(gpsPort, serialRead(gpsPassthroughPort));
|
||||
LED1_OFF;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue