Skip to content

STM32: fix issue with serial_is_tx_ongoing function #8403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions targets/TARGET_STM/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,10 +660,10 @@ int8_t get_uart_index(UARTName uart_name)
return -1;
}

/* Function to protect deep sleep while a seral Tx is ongoing on not complete
* yet. Returns 1 if there is at least 1 serial instance with ongoing ransfer
* 0 otherwise.
*/
/* Function used to protect deep sleep while a serial transmission is on-going.
.* Returns 1 if there is at least 1 serial instance with an on-going transfer
* and 0 otherwise.
*/
int serial_is_tx_ongoing(void) {
int TxOngoing = 0;

Expand Down Expand Up @@ -757,8 +757,13 @@ int serial_is_tx_ongoing(void) {
}
#endif

/* If Tx is ongoing, then transfer is */
return TxOngoing;
}

#else

int serial_is_tx_ongoing(void) {
return 0;
}

#endif /* DEVICE_SERIAL */