Fixed regressions caused by SIO changes.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15717 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2022-08-10 08:03:42 +00:00
parent 54b22281ef
commit 322ee855c5
3 changed files with 66 additions and 41 deletions

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -137,7 +137,7 @@ msg_t sio_lld_start(SIODriver *siop) {
} }
#endif #endif
else { else {
osalDbgAssert(false, "invalid USART instance"); osalDbgAssert(false, "invalid SIO instance");
} }
/* Driver object low level initializations.*/ /* Driver object low level initializations.*/
@ -175,7 +175,7 @@ void sio_lld_stop(SIODriver *siop) {
} }
#endif #endif
else { else {
osalDbgAssert(false, "invalid USART instance"); osalDbgAssert(false, "invalid SIO instance");
} }
} }
} }
@ -205,19 +205,45 @@ void sio_lld_stop_operation(SIODriver *siop) {
} }
/** /**
* @brief Return the pending SIO events flags. * @brief Enable flags change notification.
*
* @param[in] siop pointer to the @p SIODriver object
*/
void sio_lld_update_enable_flags(SIODriver *siop) {
(void)siop;
}
/**
* @brief Get and clears SIO error event flags.
* *
* @param[in] siop pointer to the @p SIODriver object * @param[in] siop pointer to the @p SIODriver object
* @return The pending event flags. * @return The pending event flags.
* *
* @notapi * @notapi
*/ */
sio_events_mask_t sio_lld_get_and_clear_events(SIODriver *siop) { sioevents_t sio_lld_get_and_clear_errors(SIODriver *siop) {
sio_events_mask_t evtmask = 0U; sioevents_t errors = (sioevents_t)0;
(void)siop; (void)siop;
return evtmask; return errors;
}
/**
* @brief Get and clears SIO event flags.
*
* @param[in] siop pointer to the @p SIODriver object
* @return The pending event flags.
*
* @notapi
*/
sioevents_t sio_lld_get_and_clear_events(SIODriver *siop) {
sioevents_t events = (sioevents_t)0;
(void)siop;
return events;
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -123,6 +123,32 @@ typedef uint32_t sio_events_mask_t;
*/ */
#define sio_lld_is_rx_empty(siop) true #define sio_lld_is_rx_empty(siop) true
/**
* @brief Determines the activity state of the receiver.
*(bool)(((siop)->uart->UARTFR & UART_UARTFR_RXFE) != 0U)
* @param[in] siop pointer to the @p SIODriver object
* @return The RX activity state.
* @retval false if RX is in active state.
* @retval true if RX is in idle state.
*
* @notapi
*/
#define sio_lld_is_rx_idle(siop) true
/**
* @brief Determines if RX has pending error events to be read and cleared.
* @note Only error and protocol errors are handled, data events are not
* considered.
*
* @param[in] siop pointer to the @p SIODriver object
* @return The RX error events.
* @retval false if RX has no pending events
* @retval true if RX has pending events
*
* @notapi
*/
#define sio_lld_has_rx_errors(siop) false
/** /**
* @brief Determines the state of the TX FIFO. * @brief Determines the state of the TX FIFO.
* *
@ -167,7 +193,9 @@ extern "C" {
void sio_lld_stop(SIODriver *siop); void sio_lld_stop(SIODriver *siop);
void sio_lld_start_operation(SIODriver *siop); void sio_lld_start_operation(SIODriver *siop);
void sio_lld_stop_operation(SIODriver *siop); void sio_lld_stop_operation(SIODriver *siop);
sio_events_mask_t sio_lld_get_and_clear_events(SIODriver *siop); void sio_lld_update_enable_flags(SIODriver *siop);
sioevents_t sio_lld_get_and_clear_errors(SIODriver *siop);
sioevents_t sio_lld_get_and_clear_events(SIODriver *siop);
size_t sio_lld_read(SIODriver *siop, uint8_t *buffer, size_t n); size_t sio_lld_read(SIODriver *siop, uint8_t *buffer, size_t n);
size_t sio_lld_write(SIODriver *siop, const uint8_t *buffer, size_t n); size_t sio_lld_write(SIODriver *siop, const uint8_t *buffer, size_t n);
msg_t sio_lld_get(SIODriver *siop); msg_t sio_lld_get(SIODriver *siop);

View File

@ -45,45 +45,16 @@
/* Module local variables. */ /* Module local variables. */
/*===========================================================================*/ /*===========================================================================*/
static void vuart_rx_cb(SIODriver *siop); static void vuart_cb(SIODriver *siop);
static void vuart_rx_idle_cb(SIODriver *siop);
static void vuart_tx_cb(SIODriver *siop);
static void vuart_tx_end_cb(SIODriver *siop);
static void vuart_rx_evt_cb(SIODriver *siop);
static const SIOOperation vuart_operation = { static const SIOOperation vuart_operation = {
.rx_cb = vuart_rx_cb, .cb = vuart_cb
.rx_idle_cb = vuart_rx_idle_cb,
.tx_cb = vuart_tx_cb,
.tx_end_cb = vuart_tx_end_cb,
.rx_evt_cb = vuart_rx_evt_cb
}; };
/*===========================================================================*/ /*===========================================================================*/
/* Module local functions. */ /* Module local functions. */
/*===========================================================================*/ /*===========================================================================*/
static void vuart_rx_cb(SIODriver *siop) { static void vuart_cb(SIODriver *siop) {
(void)siop;
}
static void vuart_rx_idle_cb(SIODriver *siop) {
(void)siop;
}
static void vuart_tx_cb(SIODriver *siop) {
(void)siop;
}
static void vuart_tx_end_cb(SIODriver *siop) {
(void)siop;
}
static void vuart_rx_evt_cb(SIODriver *siop) {
(void)siop; (void)siop;
} }