Skip to content

Commit 2d579cc

Browse files
committed
Use NULL for deinited DigitalInOut
This fixes a Display issue where no backlight pin is given but it's still deinitialized.
1 parent a9f257b commit 2d579cc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ports/esp32s2/common-hal/digitalio/DigitalInOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct(
4646
}
4747

4848
bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) {
49-
return self->pin == mp_const_none;
49+
return self->pin == NULL;
5050
}
5151

5252
void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) {
@@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self
5555
}
5656

5757
reset_pin_number(self->pin->number);
58-
self->pin = mp_const_none;
58+
self->pin = NULL;
5959
}
6060

6161
void common_hal_digitalio_digitalinout_switch_to_input(

ports/litex/common-hal/digitalio/DigitalInOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct(
4646
}
4747

4848
bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) {
49-
return self->pin == mp_const_none;
49+
return self->pin == NULL;
5050
}
5151

5252
void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) {
@@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self
5555
}
5656

5757
// reset_pin_number(0, self->pin->number);
58-
self->pin = mp_const_none;
58+
self->pin = NULL;
5959
}
6060

6161
void common_hal_digitalio_digitalinout_switch_to_input(

0 commit comments

Comments
 (0)