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)
321321
322322void serial_putc (serial_t * obj , int c )
323323{
324- while (serial_writable (obj ));
324+ while (! serial_writable (obj ));
325325 obj -> uart -> THR = c ;
326326}
327327
@@ -334,12 +334,12 @@ int serial_writable(serial_t *obj)
334334{
335335 int isWritable = 1 ;
336336 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
338338 } else {
339339 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 );
341341 else
342- isWritable = (obj -> uart -> FSR & TXFIFO_FULL_MASK );
342+ isWritable = ! (obj -> uart -> FSR & TXFIFO_FULL_MASK );
343343 return isWritable ;
344344 }
345345}
You can’t perform that action at this time.
0 commit comments