drivers/ninaw10/machine_pin_nina: Add exception text wrappers.

Required in MICROPY_PREVIEW_VERSION_2.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This commit is contained in:
Andrew Leech
2025-03-26 09:43:50 +11:00
committed by Damien George
parent ba4179bb66
commit 7c7a9bdb34

View File

@@ -114,13 +114,13 @@ void machine_pin_ext_config(machine_pin_obj_t *self, int mode, int value) {
mode = NINA_GPIO_OUTPUT;
self->is_output = true;
} else {
mp_raise_ValueError("only Pin.OUT and Pin.IN are supported for this pin");
mp_raise_ValueError(MP_ERROR_TEXT("only Pin.OUT and Pin.IN are supported for this pin"));
}
if (self->id >= 0 && self->id < MICROPY_HW_PIN_EXT_COUNT) {
uint8_t buf[] = {pin_map[self->id], mode};
if (mode == NINA_GPIO_OUTPUT) {
if (NINA_GPIO_IS_INPUT_ONLY(self->id)) {
mp_raise_ValueError("only Pin.IN is supported for this pin");
mp_raise_ValueError(MP_ERROR_TEXT("only Pin.IN is supported for this pin"));
}
machine_pin_ext_set(self, value);
}