diff options
Diffstat (limited to 'os/hal/platforms/AVR')
-rw-r--r-- | os/hal/platforms/AVR/serial_lld.c | 8 | ||||
-rw-r--r-- | os/hal/platforms/AVR/serial_lld.h | 55 |
2 files changed, 22 insertions, 41 deletions
diff --git a/os/hal/platforms/AVR/serial_lld.c b/os/hal/platforms/AVR/serial_lld.c index 53aec65d6..008b1176d 100644 --- a/os/hal/platforms/AVR/serial_lld.c +++ b/os/hal/platforms/AVR/serial_lld.c @@ -235,18 +235,18 @@ void sd_lld_init(void) { */
void sd_lld_start(SerialDriver *sdp) {
- if (sdp->sd.config == NULL)
- sdp->sd.config = &default_config;
+ if (sdp->config == NULL)
+ sdp->config = &default_config;
#if USE_AVR_USART0
if (&SD1 == sdp) {
- usart0_init(sdp->sd.config);
+ usart0_init(sdp->config);
return;
}
#endif
#if USE_AVR_USART1
if (&SD2 == sdp) {
- usart1_init(sdp->sd.config);
+ usart1_init(sdp->config);
return;
}
#endif
diff --git a/os/hal/platforms/AVR/serial_lld.h b/os/hal/platforms/AVR/serial_lld.h index 1d06b6d79..4abadf018 100644 --- a/os/hal/platforms/AVR/serial_lld.h +++ b/os/hal/platforms/AVR/serial_lld.h @@ -87,44 +87,25 @@ typedef struct { /**
* @brief @p SerialDriver specific data.
*/
-struct _serial_driver_data {
- /**
- * @brief Driver state.
- */
- sdstate_t state;
- /**
- * @brief Current configuration data.
- */
- const SerialConfig *config;
- /**
- * @brief Input queue, incoming data can be read from this input queue by
- * using the queues APIs.
- */
- InputQueue iqueue;
- /**
- * @brief Output queue, outgoing data can be written to this output queue by
- * using the queues APIs.
- */
- OutputQueue oqueue;
- /**
- * @brief Status Change @p EventSource. This event is generated when one or
- * more condition flags change.
- */
- EventSource sevent;
- /**
- * @brief I/O driver status flags.
- */
- sdflags_t flags;
- /**
- * @brief Input circular buffer.
- */
- uint8_t ib[SERIAL_BUFFERS_SIZE];
- /**
- * @brief Output circular buffer.
- */
- uint8_t ob[SERIAL_BUFFERS_SIZE];
+#define _serial_driver_data \
+ _base_asynchronous_channel_data; \
+ /* Driver state.*/ \
+ sdstate_t state; \
+ /* Current configuration data.*/ \
+ const SerialConfig *config; \
+ /* Input queue.*/ \
+ InputQueue iqueue; \
+ /* Output queue.*/ \
+ OutputQueue oqueue; \
+ /* Status Change @p EventSource.*/ \
+ EventSource sevent; \
+ /* I/O driver status flags.*/ \
+ sdflags_t flags; \
+ /* Input circular buffer.*/ \
+ uint8_t ib[SERIAL_BUFFERS_SIZE]; \
+ /* Output circular buffer.*/ \
+ uint8_t ob[SERIAL_BUFFERS_SIZE]; \
/* End of the mandatory fields.*/
-};
/*===========================================================================*/
/* Driver macros. */
|