Enable reading back value of cyw43 pin

Now, `led.value = not led.value` works as a way to toggle the LED state.

Closes: #6959
This commit is contained in:
Jeff Epler 2022-09-29 11:05:31 -05:00
parent a3bcfd6911
commit 510bd11f58
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
1 changed files with 5 additions and 0 deletions

View File

@ -140,6 +140,11 @@ void common_hal_digitalio_digitalinout_set_value(
bool common_hal_digitalio_digitalinout_get_value( bool common_hal_digitalio_digitalinout_get_value(
digitalio_digitalinout_obj_t *self) { digitalio_digitalinout_obj_t *self) {
#if CIRCUITPY_CYW43
if (IS_CYW(self)) {
return cyw43_arch_gpio_get(self->pin->number);
}
#endif
return gpio_get(self->pin->number); return gpio_get(self->pin->number);
} }