File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 2525/* Private define ------------------------------------------------------------*/
2626/* Private macro -------------------------------------------------------------*/
2727/* Private variables ---------------------------------------------------------*/
28+ #if USART_BUFFER_STACK == ENABLE
29+ circularBuffer_st * m_cb_rx_svptr ;
30+ #endif
2831/* Private function prototypes -----------------------------------------------*/
2932/* Private functions ---------------------------------------------------------*/
3033
@@ -41,3 +44,20 @@ USART_Read()
4144 while ( BIT_IsClear (UCSR0A , RXC0 ) );
4245 return (REG_Read (UDR0 ));
4346}
47+
48+ #if USART_BUFFER_STACK == ENABLE
49+
50+ void
51+ USART_BufferLink (circularBuffer_st * cirbuf_svptr )
52+ {
53+ m_cb_rx_svptr = cirbuf_svptr ;
54+ }
55+
56+ void
57+ USART_BufferEngin ()
58+ {
59+ uint8_t read_byte_u8 = REG_Read (UDR0 );
60+ CIRCULAR_BUFFER_Write (m_cb_rx_svptr , read_byte_u8 );
61+ }
62+
63+ #endif
Original file line number Diff line number Diff line change 3535/* Includes ------------------------------------------------------------------*/
3636#include "mcu.h"
3737
38+ #if USART_BUFFER_STACK == ENABLE
39+ #include "circular-buffer.h"
40+ #endif
41+
3842#if defined(USART_PRINTF_REDIRECT )
3943#include "print.h"
4044#endif
@@ -59,6 +63,15 @@ USART_Write(uint8_t ch);
5963uint8_t
6064USART_Read ();
6165
66+ #if USART_BUFFER_STACK == ENABLE
67+
68+ void
69+ USART_BufferLink (circularBuffer_st * cirbuf_svptr );
70+
71+ void
72+ USART_BufferEngin ();
73+
74+ #endif
6275
6376#ifdef __cplusplus
6477}
You can’t perform that action at this time.
0 commit comments