Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/periph/uart: add periph_uart_tx_ondemand feature #20108

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
drivers_dose: enable TX UART on-demand
  • Loading branch information
benpicco committed Dec 14, 2023
commit 9cde80ef36edd871bede907c8c8c26171f95cca2
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 @@
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 @@ -357,7 +358,7 @@
state(dev, DOSE_SIGNAL_ZTIMER);
break;
default:
;

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

View workflow job for this annotation

GitHub Actions / static-tests

semicolon is isolated from other tokens
}
}

Expand Down Expand Up @@ -503,6 +504,9 @@

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_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
Loading