mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 06:23:53 +01:00
drivers_dose: enable TX UART on-demand
This commit is contained in:
parent
60f8468191
commit
9cde80ef36
@ -317,9 +317,10 @@ static void state(dose_t *ctx, dose_signal_t signal)
|
||||
signal = state_transit_send(ctx, signal);
|
||||
ctx->state = DOSE_STATE_SEND;
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG("dose state(): unexpected state transition (STATE=0x%02x SIGNAL=0x%02x)\n", ctx->state, signal);
|
||||
/* fall-through */
|
||||
case DOSE_STATE_RECV + DOSE_SIGNAL_SEND:
|
||||
signal = DOSE_SIGNAL_NONE;
|
||||
}
|
||||
} while (signal != DOSE_SIGNAL_NONE);
|
||||
@ -503,6 +504,9 @@ static int send_data_octet(dose_t *ctx, uint8_t c)
|
||||
|
||||
static inline void _send_start(dose_t *ctx)
|
||||
{
|
||||
#ifdef MODULE_PERIPH_UART_TX_ONDEMAND
|
||||
uart_enable_tx(ctx->uart);
|
||||
#endif
|
||||
#ifdef MODULE_PERIPH_UART_COLLISION
|
||||
uart_collision_detect_enable(ctx->uart);
|
||||
#else
|
||||
@ -512,6 +516,9 @@ static inline void _send_start(dose_t *ctx)
|
||||
|
||||
static inline void _send_done(dose_t *ctx, bool collision)
|
||||
{
|
||||
#ifdef MODULE_PERIPH_UART_TX_ONDEMAND
|
||||
uart_disable_tx(ctx->uart);
|
||||
#endif
|
||||
#ifdef MODULE_PERIPH_UART_COLLISION
|
||||
uart_collision_detect_disable(ctx->uart);
|
||||
if (collision) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user