K64F UART Asynch API: Fix synchronization issue

The UART state should be set to busy before starting the transfer

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
pull/3558/head
Mahadevan Mahesh 2017-01-10 10:45:28 -06:00
parent 9e24117b68
commit 8c71fbc07f
1 changed files with 4 additions and 2 deletions
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F

View File

@ -518,9 +518,10 @@ int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx
}
}
obj->serial.txstate = kUART_TxBusy;
/* Start the transfer */
serial_send_asynch(obj);
obj->serial.txstate = kUART_TxBusy;
return 0;
}
@ -583,9 +584,10 @@ void serial_rx_asynch(serial_t *obj, void *rx, size_t rx_length, uint8_t rx_widt
}
}
obj->serial.rxstate = kUART_RxBusy;
/* Start the transfer */
serial_receive_asynch(obj);
obj->serial.rxstate = kUART_RxBusy;
}
uint8_t serial_tx_active(serial_t *obj)