Use NULL for deinited DigitalInOut

This fixes a Display issue where no backlight pin is given but it's
still deinitialized.
This commit is contained in:
Scott Shawcroft 2020-06-26 12:33:50 -07:00
parent a9f257bcd6
commit 2d579cc995
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E
2 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct(
} }
bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) {
return self->pin == mp_const_none; return self->pin == NULL;
} }
void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { 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
} }
reset_pin_number(self->pin->number); reset_pin_number(self->pin->number);
self->pin = mp_const_none; self->pin = NULL;
} }
void common_hal_digitalio_digitalinout_switch_to_input( void common_hal_digitalio_digitalinout_switch_to_input(

View File

@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct(
} }
bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) {
return self->pin == mp_const_none; return self->pin == NULL;
} }
void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { 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
} }
// reset_pin_number(0, self->pin->number); // reset_pin_number(0, self->pin->number);
self->pin = mp_const_none; self->pin = NULL;
} }
void common_hal_digitalio_digitalinout_switch_to_input( void common_hal_digitalio_digitalinout_switch_to_input(