From 331481cd0c6ba804860f7cdbd5110a87ff0160fe Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 24 May 2020 16:36:04 +0200 Subject: Refactor CMake files to allow building 2 binaries : one standalone and one compatible with mcuboot bootloader (the offset in memory is different). Add documentation about mcuboot image generation and OTA. Re-enable watchdog --- src/SystemTask/SystemTask.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/SystemTask') diff --git a/src/SystemTask/SystemTask.cpp b/src/SystemTask/SystemTask.cpp index 021bac3d..84392c7d 100644 --- a/src/SystemTask/SystemTask.cpp +++ b/src/SystemTask/SystemTask.cpp @@ -60,19 +60,19 @@ void nrf52_nvmc_write_word(uint32_t address, uint32_t value) { } void SystemTask::Work() { -// watchdog.Setup(7); -// watchdog.Start(); + watchdog.Setup(7); + watchdog.Start(); NRF_LOG_INFO("Last reset reason : %s", Pinetime::Drivers::Watchdog::ResetReasonToString(watchdog.ResetReason())); APP_GPIOTE_INIT(2); spi.Init(); spiNorFlash.Init(); - // TODO write magic only if it's not already 1 - nrf52_nvmc_write_word(0x7BFE8, 1); - uint32_t* magicptr = reinterpret_cast(0x7BFE8); uint32_t magic = *magicptr; + if(magic != 1) + nrf52_nvmc_write_word(0x7BFE8, 1); + NRF_LOG_INFO("MAGIC : %d", magic); nimbleController.Init(); -- cgit v1.2.3-70-g09d2