diff options
Diffstat (limited to 'os/hal/platforms/STM8')
-rw-r--r-- | os/hal/platforms/STM8/serial_lld.c | 13 | ||||
-rw-r--r-- | os/hal/platforms/STM8/serial_lld.h | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/os/hal/platforms/STM8/serial_lld.c b/os/hal/platforms/STM8/serial_lld.c index ec792a922..a0b85619c 100644 --- a/os/hal/platforms/STM8/serial_lld.c +++ b/os/hal/platforms/STM8/serial_lld.c @@ -278,21 +278,24 @@ void sd_lld_init(void) { * @brief Low level serial driver configuration and (re)start.
*
* @param[in] sdp pointer to a @p SerialDriver object
+ * @param[in] config the architecture-dependent serial driver configuration.
+ * If this parameter is set to @p NULL then a default
+ * configuration is used.
*/
-void sd_lld_start(SerialDriver *sdp) {
+void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
- if (sdp->config == NULL)
- sdp->config = &default_config;
+ if (config == NULL)
+ config = &default_config;
#if USE_STM8_UART1
if (&SD1 == sdp) {
- uart1_init(sdp->config);
+ uart1_init(config);
return;
}
#endif
#if USE_STM8_UART3
if (&SD3 == sdp) {
- uart3_init(sdp->config);
+ uart3_init(config);
return;
}
#endif
diff --git a/os/hal/platforms/STM8/serial_lld.h b/os/hal/platforms/STM8/serial_lld.h index 6f6deae6e..58b0df012 100644 --- a/os/hal/platforms/STM8/serial_lld.h +++ b/os/hal/platforms/STM8/serial_lld.h @@ -105,8 +105,6 @@ typedef struct { _base_asynchronous_channel_data \
/* Driver state.*/ \
sdstate_t state; \
- /* Current configuration data.*/ \
- const SerialConfig *config; \
/* Input queue.*/ \
InputQueue iqueue; \
/* Output queue.*/ \
@@ -146,7 +144,7 @@ extern SerialDriver SD3; extern "C" {
#endif
void sd_lld_init(void);
- void sd_lld_start(SerialDriver *sdp);
+ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config);
void sd_lld_stop(SerialDriver *sdp);
#ifdef __cplusplus
}
|