Updated UART HLD.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14826 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
e884447d14
commit
9c05ff1f6a
|
@ -392,7 +392,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void uartInit(void);
|
void uartInit(void);
|
||||||
void uartObjectInit(UARTDriver *uartp);
|
void uartObjectInit(UARTDriver *uartp);
|
||||||
void uartStart(UARTDriver *uartp, const UARTConfig *config);
|
msg_t uartStart(UARTDriver *uartp, const UARTConfig *config);
|
||||||
void uartStop(UARTDriver *uartp);
|
void uartStop(UARTDriver *uartp);
|
||||||
void uartStartSend(UARTDriver *uartp, size_t n, const void *txbuf);
|
void uartStartSend(UARTDriver *uartp, size_t n, const void *txbuf);
|
||||||
void uartStartSendI(UARTDriver *uartp, size_t n, const void *txbuf);
|
void uartStartSendI(UARTDriver *uartp, size_t n, const void *txbuf);
|
||||||
|
|
|
@ -94,7 +94,8 @@ void uartObjectInit(UARTDriver *uartp) {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
void uartStart(UARTDriver *uartp, const UARTConfig *config) {
|
msg_t uartStart(UARTDriver *uartp, const UARTConfig *config) {
|
||||||
|
msg_t msg;
|
||||||
|
|
||||||
osalDbgCheck((uartp != NULL) && (config != NULL));
|
osalDbgCheck((uartp != NULL) && (config != NULL));
|
||||||
|
|
||||||
|
@ -103,9 +104,18 @@ void uartStart(UARTDriver *uartp, const UARTConfig *config) {
|
||||||
"invalid state");
|
"invalid state");
|
||||||
|
|
||||||
uartp->config = config;
|
uartp->config = config;
|
||||||
|
|
||||||
|
#if defined(UART_LLD_ENHANCED_API)
|
||||||
|
msg = uart_lld_start(uartp);
|
||||||
|
#else
|
||||||
uart_lld_start(uartp);
|
uart_lld_start(uartp);
|
||||||
|
msg = HAL_START_SUCCESS;
|
||||||
|
#endif
|
||||||
|
|
||||||
uartp->state = UART_READY;
|
uartp->state = UART_READY;
|
||||||
osalSysUnlock();
|
osalSysUnlock();
|
||||||
|
|
||||||
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue