@@ -61,13 +61,13 @@ void UART::WrapperCallback(uart_callback_args_t *p_args) {
6161 case UART_EVENT_TX_COMPLETE:
6262 case UART_EVENT_TX_DATA_EMPTY:
6363 {
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+ }
7171 break ;
7272 }
7373 case UART_EVENT_RX_CHAR:
@@ -112,31 +112,31 @@ bool UART::setUpUartIrqs(uart_cfg_t &cfg) {
112112/* -------------------------------------------------------------------------- */
113113size_t UART::write (uint8_t c) {
114114/* -------------------------------------------------------------------------- */
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+ }
128128}
129129
130130size_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++){
133133 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+ }
140140}
141141
142142/* -------------------------------------------------------------------------- */
0 commit comments