diff options
| author | Jim Mussared | 2019-08-23 23:31:40 +1000 |
|---|---|---|
| committer | Damien George | 2019-09-05 22:52:24 +1000 |
| commit | 353ed7705f36e1f88b02c170cb2c578d80e2c622 (patch) | |
| tree | a11530a13ef3af8e2ecd695f545d20659a9801bd /ports/nrf/modules | |
| parent | 9e90e2528b94f8e964d350cba7e7d2e050c06be5 (diff) | |
nrf/boards/make-pins.py: Fix gen of board pins to use correct index.
It was previously not taking into account that the list of pins was sparse,
so using the wrong index. The boards/X/pins.csv was generating the wrong
data for machine.Pin.board.
As part of this fix rename the variables to make it more clear what the
list contains (only board pins).
Diffstat (limited to 'ports/nrf/modules')
| -rw-r--r-- | ports/nrf/modules/machine/pin.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ports/nrf/modules/machine/pin.c b/ports/nrf/modules/machine/pin.c index 4e5b3434f..f3a0bf07a 100644 --- a/ports/nrf/modules/machine/pin.c +++ b/ports/nrf/modules/machine/pin.c @@ -37,8 +37,8 @@ #include "nrf_gpio.h" #include "nrfx_gpiote.h" -extern const pin_obj_t machine_pin_obj[]; -extern const uint8_t machine_pin_num_of_pins; +extern const pin_obj_t machine_board_pin_obj[]; +extern const uint8_t machine_pin_num_of_board_pins; /// \moduleref machine /// \class Pin - control I/O pins @@ -128,9 +128,9 @@ const pin_obj_t *pin_find(mp_obj_t user_obj) { // If pin is SMALL_INT if (mp_obj_is_small_int(user_obj)) { uint8_t value = MP_OBJ_SMALL_INT_VALUE(user_obj); - for (uint8_t i = 0; i < machine_pin_num_of_pins; i++) { - if (machine_pin_obj[i].pin == value) { - return &machine_pin_obj[i]; + for (uint8_t i = 0; i < machine_pin_num_of_board_pins; i++) { + if (machine_board_pin_obj[i].pin == value) { + return &machine_board_pin_obj[i]; } } } |
