8000 esp8266: PULL_UP is not supported on Pin(16), so raise an exception. · kevincon/circuitpython@8a15e0b · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a15e0b

Browse files
committed
esp8266: PULL_UP is not supported on Pin(16), so raise an exception.
1 parent b203c17 commit 8a15e0b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

esp8266/modpybpin.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@ STATIC mp_obj_t pyb_pin_obj_init_helper(pyb_pin_obj_t *self, mp_uint_t n_args, c
244244

245245
// configure the GPIO as requested
246246
if (self->phys_port == 16) {
247-
// TODO: Set pull up/pull down
247+
// only pull-down seems to be supported by the hardware, and
248+
// we only expose pull-up behaviour in software
249+
if (pull != GPIO_PULL_NONE) {
250+
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Pin(16) doesn't support pull"));
251+
}
248252
} else {
249253
PIN_FUNC_SELECT(self->periph, self->func);
250254
#if 0

0 commit comments

Comments
 (0)
0