Skip to content

Commit 66cf66f

Browse files
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.
1 parent 8061195 commit 66cf66f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ports/stm/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) {
250250
}
251251

252252
bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) {
253-
return self->sck->pin == NULL;
253+
return self->sck == NULL;
254254
}
255255

256256
void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {

ports/stm/common-hal/busio/UART.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) {
259259
}
260260

261261
bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) {
262-
return self->tx->pin == NULL && self->rx->pin == NULL;
262+
return self->tx == NULL && self->rx == NULL;
263263
}
264264

265265
void common_hal_busio_uart_deinit(busio_uart_obj_t *self) {

0 commit comments

Comments
 (0)