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
/* 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