From cb0b3bc0b7aa2c45196a791a607bd37defc07a02 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Sep 2015 11:19:00 +0100 Subject: add timeout mode --- main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index c5ee04b..9d26afa 100644 --- a/main.c +++ b/main.c @@ -50,9 +50,9 @@ #include #include -#if BUTTONS_NUMBER < 1 -#error "Not enough buttons on board" -#endif +//#if BUTTONS_NUMBER < 1 +//#error "Not enough buttons on board" +//#endif #if LEDS_NUMBER < 1 #error "Not enough LEDs on board" @@ -60,7 +60,7 @@ #define IS_SRVC_CHANGED_CHARACT_PRESENT 1 /**< Include the service_changed characteristic. For DFU this should normally be the case. */ -#define BOOTLOADER_BUTTON BSP_BUTTON_1 /**< Button used to enter SW update mode. */ +//#define BOOTLOADER_BUTTON BSP_BUTTON_1 /**< Button used to enter SW update mode. */ #define UPDATE_IN_PROGRESS_LED BSP_LED_2 /**< Led used to indicate that DFU is active. */ #define APP_TIMER_PRESCALER 0 /**< Value of the RTC1 PRESCALER register. */ @@ -111,10 +111,11 @@ static void timers_init(void) */ static void buttons_init(void) { +#if defined(BOOTLOADER_BUTTON) nrf_gpio_cfg_sense_input(BOOTLOADER_BUTTON, BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW); - +#endif } @@ -229,7 +230,12 @@ int main(void) } dfu_start = app_reset; + +#if defined(BOOTLOADER_BUTTON) dfu_start |= ((nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0) ? true: false); +#else + dfu_start |= true; +#endif if (dfu_start || (!bootloader_app_is_valid(DFU_BANK_0_REGION_START))) { -- cgit v1.2.3