summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorroot <root@lamia.panaceas.james.local>2015-09-04 11:19:00 +0100
committerroot <root@lamia.panaceas.james.local>2015-09-04 11:19:00 +0100
commitcb0b3bc0b7aa2c45196a791a607bd37defc07a02 (patch)
treeba11fc6acbf6713bbc9bdd8a63c2f8ce15cd33cf /main.c
parentaa24fbf26e3ff7c201bd6032030f47b49c6be5f5 (diff)
downloadbootloader-master.tar.gz
bootloader-master.tar.bz2
bootloader-master.zip
add timeout modeHEADmaster
Diffstat (limited to 'main.c')
-rw-r--r--main.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/main.c b/main.c
index c5ee04b..9d26afa 100644
--- a/main.c
+++ b/main.c
@@ -50,9 +50,9 @@
#include <sdk/drivers_nrf/pstorage/config/pstorage_platform.h>
#include <sdk/softdevice/s130/headers/nrf_mbr.h>
-#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)))
{