Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5384211

Browse files
committed
fixed formatting
1 parent a83f4d5 commit 5384211

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

‎cores/arduino/Serial.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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
/* -------------------------------------------------------------------------- */
113113
size_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

130130
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++){
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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /