samples: basic: button: use dts-generated defines
This commit updates the button sample to use the dts-generated define to configure the button pull-up when the custom define is not present. Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
This commit is contained in:
parent
dc60f86d89
commit
53cd7c2496
1 changed files with 5 additions and 2 deletions
|
@ -40,11 +40,14 @@
|
|||
#endif
|
||||
|
||||
/* change this to enable pull-up/pull-down */
|
||||
#ifndef SW0_GPIO_FLAGS
|
||||
#ifdef SW0_GPIO_PIN_PUD
|
||||
#define PULL_UP SW0_GPIO_PIN_PUD
|
||||
#define SW0_GPIO_FLAGS SW0_GPIO_PIN_PUD
|
||||
#else
|
||||
#define PULL_UP 0
|
||||
#define SW0_GPIO_FLAGS 0
|
||||
#endif
|
||||
#endif
|
||||
#define PULL_UP SW0_GPIO_FLAGS
|
||||
|
||||
/* Sleep time */
|
||||
#define SLEEP_TIME 500
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue