Merge fix/issue-5-hs-s43a-s3r-cleanup: HS-S43A touch migration + S3R cleanup (closes #5)
This commit is contained in:
parent
109088cf52
commit
0bf2dcd00f
1 changed files with 0 additions and 27 deletions
27
src/main.cpp
27
src/main.cpp
|
|
@ -227,13 +227,6 @@ class OtaCharacteristicCallbacks : public NimBLECharacteristicCallbacks {
|
||||||
const uint8_t *data = (const uint8_t *)value.data();
|
const uint8_t *data = (const uint8_t *)value.data();
|
||||||
size_t len = value.length();
|
size_t len = value.length();
|
||||||
|
|
||||||
if (otaWaitingForReboot && len == 1 && data[0] == 0xFF) {
|
|
||||||
otaWaitingForReboot = false;
|
|
||||||
otaConfirmed = true;
|
|
||||||
Serial.println("OTA: reboot confirmation received");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (len == 5 && data[0] == OTA_CMD_START) {
|
if (len == 5 && data[0] == OTA_CMD_START) {
|
||||||
if (otaInProgress) {
|
if (otaInProgress) {
|
||||||
esp_ota_end(otaHandle);
|
esp_ota_end(otaHandle);
|
||||||
|
|
@ -489,26 +482,6 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
if (otaWaitingForReboot) {
|
|
||||||
if (millis() - otaRebootWaitStart > 10000) {
|
|
||||||
Serial.println("OTA: no confirmation after 10s, rebooting anyway");
|
|
||||||
otaWaitingForReboot = false;
|
|
||||||
otaConfirmed = true;
|
|
||||||
}
|
|
||||||
delay(10);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (otaConfirmed) {
|
|
||||||
otaConfirmed = false;
|
|
||||||
esp_err_t err = esp_ota_set_boot_partition(otaPartition);
|
|
||||||
if (err != ESP_OK) {
|
|
||||||
Serial.printf("OTA: set boot partition failed (%d)\n", err);
|
|
||||||
}
|
|
||||||
delay(100);
|
|
||||||
esp_restart();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!otaInProgress && Serial.available()) {
|
if (!otaInProgress && Serial.available()) {
|
||||||
static String serialBuf;
|
static String serialBuf;
|
||||||
char c = Serial.read();
|
char c = Serial.read();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue