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 25
25
/* Private define ------------------------------------------------------------*/
26
26
/* Private macro -------------------------------------------------------------*/
27
27
/* Private variables ---------------------------------------------------------*/
28
+ #if USART_BUFFER_STACK == ENABLE
29
+ circularBuffer_st * m_cb_rx_svptr ;
30
+ #endif
28
31
/* Private function prototypes -----------------------------------------------*/
29
32
/* Private functions ---------------------------------------------------------*/
30
33
@@ -41,3 +44,20 @@ USART_Read()
41
44
while ( BIT_IsClear (UCSR0A , RXC0 ) );
42
45
return (REG_Read (UDR0 ));
43
46
}
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 35
35
/* Includes ------------------------------------------------------------------*/
36
36
#include "mcu.h"
37
37
38
+ #if USART_BUFFER_STACK == ENABLE
39
+ #include "circular-buffer.h"
40
+ #endif
41
+
38
42
#if defined(USART_PRINTF_REDIRECT )
39
43
#include "print.h"
40
44
#endif
@@ -59,6 +63,15 @@ USART_Write(uint8_t ch);
59
63
uint8_t
60
64
USART_Read ();
61
65
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
62
75
63
76
#ifdef __cplusplus
64
77
}
You can’t perform that action at this time.
0 commit comments