add reboot message

This commit is contained in:
Kevin Hester
2021-03-27 10:19:59 +08:00
parent 7e9e33d462
commit 8ffd5a1d4f
8 changed files with 30 additions and 15 deletions

View File

@@ -16,7 +16,6 @@
int16_t updateResultHandle = -1;
static CRC32 crc;
static uint32_t rebootAtMsec = 0; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
static uint32_t updateExpectedSize, updateActualSize;
static uint8_t update_result;
@@ -139,14 +138,6 @@ int update_region_callback(uint16_t conn_handle, uint16_t attr_handle, struct bl
return chr_readwrite8(&update_region, sizeof(update_region), ctxt);
}
void bluetoothRebootCheck()
{
if (rebootAtMsec && millis() > rebootAtMsec) {
DEBUG_MSG("Rebooting for update\n");
ESP.restart();
}
}
/*
See bluetooth-api.md

View File

@@ -4,8 +4,6 @@
void reinitUpdateService();
void bluetoothRebootCheck();
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -7,9 +7,9 @@
#include "sleep.h"
#include "target_specific.h"
#include "utils.h"
#include <driver/rtc_io.h>
#include <nvs.h>
#include <nvs_flash.h>
#include <driver/rtc_io.h>
void getMacAddr(uint8_t *dmac)
{
@@ -84,7 +84,6 @@ void esp32Loop()
{
esp_task_wdt_reset(); // service our app level watchdog
loopBLE();
bluetoothRebootCheck();
// for debug printing
// radio.radioIf.canSleep();