Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions samples/bluetooth/mesh/src/microbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ static void configure_button(void)
gpio = device_get_binding(DT_ALIAS_SW0_GPIOS_CONTROLLER);

gpio_pin_configure(gpio, DT_ALIAS_SW0_GPIOS_PIN,
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
GPIO_INT_ACTIVE_LOW));
GPIO_INPUT | DT_ALIAS_SW0_GPIOS_FLAGS);
gpio_pin_interrupt_configure(gpio, DT_ALIAS_SW0_GPIOS_PIN,
GPIO_INT_EDGE_TO_ACTIVE);

gpio_init_callback(&button_cb, button_pressed, BIT(DT_ALIAS_SW0_GPIOS_PIN));

Expand All @@ -52,7 +53,8 @@ void board_output_number(bt_mesh_output_action_t action, u32_t number)

oob_number = number;

gpio_pin_enable_callback(gpio, DT_ALIAS_SW0_GPIOS_PIN);
gpio_pin_interrupt_configure(gpio, DT_ALIAS_SW0_GPIOS_PIN,
GPIO_INT_EDGE_TO_ACTIVE);

mb_display_image(disp, MB_DISPLAY_MODE_DEFAULT, K_FOREVER, &arrow, 1);
}
Expand All @@ -67,7 +69,8 @@ void board_prov_complete(void)
{ 0, 1, 1, 1, 0 });


gpio_pin_disable_callback(gpio, DT_ALIAS_SW0_GPIOS_PIN);
gpio_pin_interrupt_configure(gpio, DT_ALIAS_SW0_GPIOS_PIN,
GPIO_INT_DISABLE);

mb_display_image(disp, MB_DISPLAY_MODE_DEFAULT, K_SECONDS(10),
&arrow, 1);
Expand Down
14 changes: 7 additions & 7 deletions samples/bluetooth/mesh_demo/src/microbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,18 @@ static void configure_button(void)
gpio = device_get_binding(DT_ALIAS_SW0_GPIOS_CONTROLLER);

gpio_pin_configure(gpio, DT_ALIAS_SW0_GPIOS_PIN,
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
GPIO_INT_ACTIVE_LOW));
GPIO_INPUT | DT_ALIAS_SW0_GPIOS_FLAGS);
gpio_pin_interrupt_configure(gpio, DT_ALIAS_SW0_GPIOS_PIN,
GPIO_INT_EDGE_TO_ACTIVE);

gpio_pin_configure(gpio, DT_ALIAS_SW1_GPIOS_PIN,
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
GPIO_INT_ACTIVE_LOW));
GPIO_INPUT | DT_ALIAS_SW1_GPIOS_FLAGS);
gpio_pin_interrupt_configure(gpio, DT_ALIAS_SW1_GPIOS_PIN,
GPIO_INT_EDGE_TO_ACTIVE);

gpio_init_callback(&button_cb, button_pressed,
BIT(DT_ALIAS_SW0_GPIOS_PIN) | BIT(DT_ALIAS_SW1_GPIOS_PIN));
gpio_add_callback(gpio, &button_cb);

gpio_pin_enable_callback(gpio, DT_ALIAS_SW0_GPIOS_PIN);
gpio_pin_enable_callback(gpio, DT_ALIAS_SW1_GPIOS_PIN);
}

void board_init(u16_t *addr)
Expand Down