diff options
author | Damien George <damien.p.george@gmail.com> | 2016-08-10 12:45:40 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-08-10 12:45:40 +1000 |
commit | 8a15e0b1c74f0251ad549b1c8ec8f41538b4a2ac (patch) | |
tree | ec1258809bb23948619d8c80e186f3b9c0a835b8 | |
parent | b203c1774e4eb6bb6bc04b99d0a5f06f0aa04e40 (diff) | |
download | micropython-8a15e0b1c74f0251ad549b1c8ec8f41538b4a2ac.tar.gz micropython-8a15e0b1c74f0251ad549b1c8ec8f41538b4a2ac.zip |
esp8266: PULL_UP is not supported on Pin(16), so raise an exception.
-rw-r--r-- | esp8266/modpybpin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/esp8266/modpybpin.c b/esp8266/modpybpin.c index 79406867af..8916da64f6 100644 --- a/esp8266/modpybpin.c +++ b/esp8266/modpybpin.c @@ -244,7 +244,11 @@ STATIC mp_obj_t pyb_pin_obj_init_helper(pyb_pin_obj_t *self, mp_uint_t n_args, c // configure the GPIO as requested if (self->phys_port == 16) { - // TODO: Set pull up/pull down + // only pull-down seems to be supported by the hardware, and + // we only expose pull-up behaviour in software + if (pull != GPIO_PULL_NONE) { + nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Pin(16) doesn't support pull")); + } } else { PIN_FUNC_SELECT(self->periph, self->func); #if 0 |