From e4c9d9588b1f8de78196e30874db413cdaaa8ab4 Mon Sep 17 00:00:00 2001 From: Balazs Racz Date: Sat, 8 Jul 2023 14:38:07 +0200 Subject: [PATCH] Fix comments. --- include/freertos/tc_ioctl.h | 1 - src/freertos_drivers/ti/CC32xxUart.cxx | 13 +++++++------ src/freertos_drivers/ti/TivaUart.cxx | 13 +++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/freertos/tc_ioctl.h b/include/freertos/tc_ioctl.h index 64bc2152b..258d6fe03 100644 --- a/include/freertos/tc_ioctl.h +++ b/include/freertos/tc_ioctl.h @@ -53,7 +53,6 @@ /// Two stop bits #define TCSTOPTWO IO(TERMIOS_IOC_MAGIC, 0xF9) - /// Argument is a Notifiable* pointer. This notifiable will be invoked when all /// bytes have completed transferring and the transmit engine is idle. #define TCDRAINNOTIFY IOW(TERMIOS_IOC_MAGIC, 0xE0, 4) diff --git a/src/freertos_drivers/ti/CC32xxUart.cxx b/src/freertos_drivers/ti/CC32xxUart.cxx index 4d22e5020..04abfcd22 100644 --- a/src/freertos_drivers/ti/CC32xxUart.cxx +++ b/src/freertos_drivers/ti/CC32xxUart.cxx @@ -314,15 +314,16 @@ void CC32xxUart::interrupt_handler() rxBuf->signal_condition_from_isr(); } } - else + else if (data >= 0 && data <= 0xff) { - if (data >= 0 && data <= 0xff) + if (rxBuf->space() < 1) + { + ++overrunCount; + } + else { unsigned char c = data; - if (rxBuf->put(&c, 1) == 0) - { - ++overrunCount; - } + rxBuf->put(&c, 1); rxBuf->signal_condition_from_isr(); } } diff --git a/src/freertos_drivers/ti/TivaUart.cxx b/src/freertos_drivers/ti/TivaUart.cxx index 8733123f4..597e51b3f 100644 --- a/src/freertos_drivers/ti/TivaUart.cxx +++ b/src/freertos_drivers/ti/TivaUart.cxx @@ -236,15 +236,16 @@ void TivaUart::interrupt_handler() rxBuf->signal_condition_from_isr(); } } - else + else if (data >= 0 && data <= 0xff) { - if (data >= 0 && data <= 0xff) + if (rxBuf->space() < 1) + { + ++overrunCount; + } + else { unsigned char c = data; - if (rxBuf->put(&c, 1) == 0) - { - overrunCount++; - } + rxBuf->put(&c, 1); rxBuf->signal_condition_from_isr(); } }