@@ -61,13 +61,13 @@ void UART::WrapperCallback(uart_callback_args_t *p_args) {
61
61
case UART_EVENT_TX_COMPLETE:
62
62
case UART_EVENT_TX_DATA_EMPTY:
63
63
{
64
- if (uart_ptr->txBuffer .available ()){
65
- static char txc;
66
- txc = uart_ptr->txBuffer .read_char ();
67
- R_SCI_UART_Write (&(uart_ptr->uart_ctrl ), (uint8_t *)&txc , 1 );
68
- } else {
69
- uart_ptr->tx_done = true ;
70
- }
64
+ if (uart_ptr->txBuffer .available ()){
65
+ static char txc;
66
+ txc = uart_ptr->txBuffer .read_char ();
67
+ R_SCI_UART_Write (&(uart_ptr->uart_ctrl ), (uint8_t *)&txc , 1 );
68
+ } else {
69
+ uart_ptr->tx_done = true ;
70
+ }
71
71
break ;
72
72
}
73
73
case UART_EVENT_RX_CHAR:
@@ -112,31 +112,31 @@ bool UART::setUpUartIrqs(uart_cfg_t &cfg) {
112
112
/* -------------------------------------------------------------------------- */
113
113
size_t UART::write (uint8_t c) {
114
114
/* -------------------------------------------------------------------------- */
115
- if (init_ok) {
116
- while (txBuffer.isFull ()){;}
117
- txBuffer.store_char (c);
118
- if (tx_done){
119
- tx_done = false ;
120
- txc = txBuffer.read_char (); // clear out the char we just added and send it to start transmission.
121
- R_SCI_UART_Write (&uart_ctrl, (uint8_t *)&txc , 1 );
122
- }
123
- return 1 ;
124
- }
125
- else {
126
- return 0 ;
127
- }
115
+ if (init_ok) {
116
+ while (txBuffer.isFull ()){;}
117
+ txBuffer.store_char (c);
118
+ if (tx_done){
119
+ tx_done = false ;
120
+ txc = txBuffer.read_char (); // clear out the char we just added and send it to start transmission.
121
+ R_SCI_UART_Write (&uart_ctrl, (uint8_t *)&txc , 1 );
122
+ }
123
+ return 1 ;
124
+ }
125
+ else {
126
+ return 0 ;
127
+ }
128
128
}
129
129
130
130
size_t UART::write (uint8_t * c, size_t len) {
131
- if (init_ok) {
132
- for (int i = 0 ; i<len; i++){
131
+ if (init_ok) {
132
+ for (int i = 0 ; i<len; i++){
133
133
write (c[i]);
134
- }
135
- return len;
136
- }
137
- else {
138
- return 0 ;
139
- }
134
+ }
135
+ return len;
136
+ }
137
+ else {
138
+ return 0 ;
139
+ }
140
140
}
141
141
142
142
/* -------------------------------------------------------------------------- */
0 commit comments