Fixed common_hal_busio_uart_deinited incorrect pin assignment check.

The pin must be tested instead of pin->number in the same way as in STM
I2C busio layer.
This commit is contained in:
EmergReanimator 2022-01-26 17:46:42 +01:00
parent 80611954f4
commit 66cf66f118
2 changed files with 2 additions and 2 deletions

View File

@ -250,7 +250,7 @@ void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) {
}
bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) {
return self->sck->pin == NULL;
return self->sck == NULL;
}
void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {

View File

@ -259,7 +259,7 @@ void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) {
}
bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) {
return self->tx->pin == NULL && self->rx->pin == NULL;
return self->tx == NULL && self->rx == NULL;
}
void common_hal_busio_uart_deinit(busio_uart_obj_t *self) {