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
|
#endif
|
||||||
|
|
||||||
/* change this to enable pull-up/pull-down */
|
/* change this to enable pull-up/pull-down */
|
||||||
|
#ifndef SW0_GPIO_FLAGS
|
||||||
#ifdef SW0_GPIO_PIN_PUD
|
#ifdef SW0_GPIO_PIN_PUD
|
||||||
#define PULL_UP SW0_GPIO_PIN_PUD
|
#define SW0_GPIO_FLAGS SW0_GPIO_PIN_PUD
|
||||||
#else
|
#else
|
||||||
#define PULL_UP 0
|
#define SW0_GPIO_FLAGS 0
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
#define PULL_UP SW0_GPIO_FLAGS
|
||||||
|
|
||||||
/* Sleep time */
|
/* Sleep time */
|
||||||
#define SLEEP_TIME 500
|
#define SLEEP_TIME 500
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue