File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ SOFTWARE.
30
30
#include " RingBuffer.h"
31
31
32
32
#ifndef AP3_UART_RINGBUFF_SIZE
33
- #define AP3_UART_RINGBUFF_SIZE 256
33
+ #define AP3_UART_RINGBUFF_SIZE 256 * 16
34
34
#endif
35
35
36
36
#ifndef AP3_UART_LINBUFF_SIZE
37
- #define AP3_UART_LINBUFF_SIZE 256
37
+ #define AP3_UART_LINBUFF_SIZE 256 * 16
38
38
#endif
39
39
40
40
typedef RingBufferN<AP3_UART_RINGBUFF_SIZE> AP3UartRingBuffer;
@@ -78,7 +78,7 @@ class Uart : public HardwareSerial
78
78
operator bool () { return true ; } // todo: wait for a serial terminal to be open... probably depends on RTS or CTS...
79
79
80
80
private:
81
- public: // temporary
81
+ public: // temporary
82
82
AP3UartRingBuffer _rx_buffer; // These buffers guarantee the lifespan of the data to transmit
83
83
AP3UartRingBuffer _tx_buffer; // to allow for asynchronous tranfsers
84
84
Original file line number Diff line number Diff line change @@ -543,19 +543,16 @@ inline void Uart::uart_isr(void)
543
543
{
544
544
.ui32Direction = AM_HAL_UART_READ,
545
545
.pui8Data = (uint8_t *)&rx_c,
546
- .ui32NumBytes = 1 ,
546
+ .ui32NumBytes = sizeof (rx_c) ,
547
547
.ui32TimeoutMs = 0 ,
548
548
.pui32BytesTransferred = &ui32BytesRead,
549
549
};
550
550
551
- do
551
+ am_hal_uart_transfer (_handle, &sRead );
552
+ if (ui32BytesRead)
552
553
{
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
+ }
559
556
}
560
557
}
561
558
You can’t perform that action at this time.
0 commit comments