From 0a54f8875127abd334eff4f9173719da812f2e7d Mon Sep 17 00:00:00 2001 From: Drew Fustini Date: Mon, 10 Feb 2020 00:12:37 +0100 Subject: [PATCH 1/2] add pin defs for buttons on the OHS2020 badge --- ports/nrf/boards/ohs2020_badge/pins.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/nrf/boards/ohs2020_badge/pins.c b/ports/nrf/boards/ohs2020_badge/pins.c index e984e3070f..c92d77a92a 100644 --- a/ports/nrf/boards/ohs2020_badge/pins.c +++ b/ports/nrf/boards/ohs2020_badge/pins.c @@ -19,6 +19,11 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_P1_03) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 3bf4b42e2e99a7a1afac20aa4e0daf97d1d4e734 Mon Sep 17 00:00:00 2001 From: Drew Fustini Date: Mon, 10 Feb 2020 00:49:13 +0100 Subject: [PATCH 2/2] change OH20 badge pin defs to use SWn for buttons Rather than use A, B, C and D Use the buttons according to silkscreen references: SW1 SW2 SW3 SW4 --- ports/nrf/boards/ohs2020_badge/pins.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/ohs2020_badge/pins.c b/ports/nrf/boards/ohs2020_badge/pins.c index c92d77a92a..2cf783cc1e 100644 --- a/ports/nrf/boards/ohs2020_badge/pins.c +++ b/ports/nrf/boards/ohs2020_badge/pins.c @@ -20,10 +20,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_P0_29) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_P0_03) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_P0_17) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_SW1), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_SW2), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_SW3), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_SW4), MP_ROM_PTR(&pin_P1_03) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);