Skip to content

Add function common_hal_busio_uart_never_reset for rp2 #7581

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

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Changes from all commits
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
15 changes: 15 additions & 0 deletions ports/raspberrypi/common-hal/busio/UART.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,18 @@ bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) {
}
return uart_is_writable(self->uart);
}

STATIC void pin_never_reset(uint8_t pin) {
if (pin != NO_PIN) {
never_reset_pin_number(pin);
}
}

void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) {
never_reset_uart(self->uart_id);
pin_never_reset(self->tx_pin);
pin_never_reset(self->rx_pin);
pin_never_reset(self->cts_pin);
pin_never_reset(self->rs485_dir_pin);
pin_never_reset(self->rts_pin);
}