File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
targets/TARGET_RDA/TARGET_UNO_91H Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ int serial_getc(serial_t *obj)
321
321
322
322
void serial_putc (serial_t * obj , int c )
323
323
{
324
- while (serial_writable (obj ));
324
+ while (! serial_writable (obj ));
325
325
obj -> uart -> THR = c ;
326
326
}
327
327
@@ -334,12 +334,12 @@ int serial_writable(serial_t *obj)
334
334
{
335
335
int isWritable = 1 ;
336
336
if (obj -> index == 0 ) {
337
- return (obj -> uart -> FSR & TXFIFO_FULL_MASK ); // uart0 not have flow control
337
+ return ! (obj -> uart -> FSR & TXFIFO_FULL_MASK ); // uart0 not have flow control
338
338
} else {
339
339
if (((obj -> uart -> MCR & AFCE_MASK ) == 0x00UL ) && (NC != uart_data [obj -> index ].sw_cts .pin )) //If flow control: writable if CTS low + UART done
340
- isWritable = (gpio_read (& uart_data [obj -> index ].sw_cts ) == 0 ) && (obj -> uart -> FSR & TXFIFO_FULL_MASK );
340
+ isWritable = (gpio_read (& uart_data [obj -> index ].sw_cts ) == 0 ) && ! (obj -> uart -> FSR & TXFIFO_FULL_MASK );
341
341
else
342
- isWritable = (obj -> uart -> FSR & TXFIFO_FULL_MASK );
342
+ isWritable = ! (obj -> uart -> FSR & TXFIFO_FULL_MASK );
343
343
return isWritable ;
344
344
}
345
345
}
You can’t perform that action at this time.
0 commit comments