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:
Emanuele Di Santo 2018-08-21 17:01:55 +02:00 committed by Kumar Gala
commit 53cd7c2496

View file

@ -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