Skip to content

Commit 6cf0c86

Browse files
authored
Merge pull request #3558 from NXPmicro/UART_Asynch_Fix
K64F UART Asynch API: Fix synchronization issue
2 parents ccab2c5 + 8c71fbc commit 6cf0c86

File tree

1 file changed

+4
-2
lines changed
  • targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F

1 file changed

+4
-2
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/serial_api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,10 @@ int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx
518518
}
519519
}
520520

521+
obj->serial.txstate = kUART_TxBusy;
522+
521523
/* Start the transfer */
522524
serial_send_asynch(obj);
523-
obj->serial.txstate = kUART_TxBusy;
524525

525526
return 0;
526527
}
@@ -583,9 +584,10 @@ void serial_rx_asynch(serial_t *obj, void *rx, size_t rx_length, uint8_t rx_widt
583584
}
584585
}
585586

587+
obj->serial.rxstate = kUART_RxBusy;
588+
586589
/* Start the transfer */
587590
serial_receive_asynch(obj);
588-
obj->serial.rxstate = kUART_RxBusy;
589591
}
590592

591593
uint8_t serial_tx_active(serial_t *obj)

0 commit comments

Comments
 (0)