Skip to content

Commit

Permalink
drivers_dose: enable TX UART on-demand
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Dec 14, 2023
1 parent 60f8468 commit 9cde80e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/dose/dose.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 321 in drivers/dose/dose.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
/* fall-through */
case DOSE_STATE_RECV + DOSE_SIGNAL_SEND:
signal = DOSE_SIGNAL_NONE;
}
} while (signal != DOSE_SIGNAL_NONE);
Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 9cde80e

Please sign in to comment.