Skip to content

Commit

Permalink
samples: protocols_serialization: fix button removal
Browse files Browse the repository at this point in the history
Remove buttons forbidden due to overlapping with UART
correctly, including swX aliases.

Signed-off-by: Damian Krolik <[email protected]>
  • Loading branch information
Damian-Nordic authored and rlubos committed Nov 19, 2024
1 parent 3e12072 commit 19945a6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
};

/* delete all buttons except button0 to free GPIO pins assigned to uart21 below */
buttons {
/delete-node/ button1;
/delete-node/ button2;
/delete-node/ button3;
aliases {
/delete-property/ sw1;
/delete-property/ sw2;
/delete-property/ sw3;
};
};

/delete-node/ &button1;
/delete-node/ &button2;
/delete-node/ &button3;

&pinctrl {
uart21_default: uart21_default {
group1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
};

/* delete all buttons except button0 to free GPIO pins assigned to uart21 below */
buttons {
/delete-node/ button1;
/delete-node/ button2;
/delete-node/ button3;
aliases {
/delete-property/ sw1;
/delete-property/ sw2;
/delete-property/ sw3;
};
};

/delete-node/ &button1;
/delete-node/ &button2;
/delete-node/ &button3;

&pinctrl {
uart21_default: uart21_default {
group1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ LOG_MODULE_DECLARE(nrf_ps_server, CONFIG_NRF_PS_SERVER_LOG_LEVEL);

static void button_handler(uint32_t button_state, uint32_t has_changed)
{
LOG_ERR("Fatal error button pressed - triggering k_oops");

if (button_state & DK_BTN1_MSK) {
LOG_ERR("Fatal error button pressed - triggering k_oops");
k_oops();
}
}
Expand Down

0 comments on commit 19945a6

Please sign in to comment.