File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ SOFTWARE.
3030#include " RingBuffer.h"
3131
3232#ifndef AP3_UART_RINGBUFF_SIZE
33- #define AP3_UART_RINGBUFF_SIZE 256
33+ #define AP3_UART_RINGBUFF_SIZE 256 * 16
3434#endif
3535
3636#ifndef AP3_UART_LINBUFF_SIZE
37- #define AP3_UART_LINBUFF_SIZE 256
37+ #define AP3_UART_LINBUFF_SIZE 256 * 16
3838#endif
3939
4040typedef RingBufferN<AP3_UART_RINGBUFF_SIZE> AP3UartRingBuffer;
@@ -78,7 +78,7 @@ class Uart : public HardwareSerial
7878 operator bool () { return true ; } // todo: wait for a serial terminal to be open... probably depends on RTS or CTS...
7979
8080private:
81- public: // temporary
81+ public: // temporary
8282 AP3UartRingBuffer _rx_buffer; // These buffers guarantee the lifespan of the data to transmit
8383 AP3UartRingBuffer _tx_buffer; // to allow for asynchronous tranfsers
8484
Original file line number Diff line number Diff line change @@ -543,19 +543,16 @@ inline void Uart::uart_isr(void)
543543 {
544544 .ui32Direction = AM_HAL_UART_READ,
545545 .pui8Data = (uint8_t *)&rx_c,
546- .ui32NumBytes = 1 ,
546+ .ui32NumBytes = sizeof (rx_c) ,
547547 .ui32TimeoutMs = 0 ,
548548 .pui32BytesTransferred = &ui32BytesRead,
549549 };
550550
551- do
551+ am_hal_uart_transfer (_handle, &sRead );
552+ if (ui32BytesRead)
552553 {
553- am_hal_uart_transfer (_handle, &sRead );
554- if (ui32BytesRead)
555- {
556- _rx_buffer.store_char (rx_c);
557- }
558- } while (ui32BytesRead);
554+ _rx_buffer.store_char (rx_c);
555+ }
559556 }
560557}
561558
You can’t perform that action at this time.
0 commit comments