Put rf95 to sleep when starting update
parent
60a7f98309
commit
45f827611c
|
@ -3,11 +3,12 @@
|
|||
#include <WebServer.h>
|
||||
#include <ESPmDNS.h>
|
||||
#include <Update.h>
|
||||
#include <BG_RF95.h>
|
||||
|
||||
#ifndef TASK_WEBSERVER
|
||||
#define TASK_WEBSERVER
|
||||
|
||||
|
||||
extern BG_RF95 rf95;
|
||||
#ifdef KISS_PROTOCOL
|
||||
extern WiFiServer tncServer;
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,7 @@ lib_deps =
|
|||
Adafruit Unified Sensor
|
||||
https://github.com/SQ9MDD/AXP202X_Library.git
|
||||
SparkFun u-blox Arduino Library
|
||||
build_flags =
|
||||
build_flags =
|
||||
-Wl,--gc-sections,--relax
|
||||
-D 'KISS_PROTOCOL'
|
||||
-D 'CALLSIGN="N0CALL-0"'
|
||||
|
|
|
@ -246,6 +246,7 @@ void handle_saveDeviceCfg(){
|
|||
}, []() {
|
||||
HTTPUpload& upload = server.upload();
|
||||
if (upload.status == UPLOAD_FILE_START) {
|
||||
rf95.sleep(); // disable rf95 before update
|
||||
Serial.printf("Update: %s\n", upload.filename.c_str());
|
||||
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
|
||||
syslog_log(LOG_ERR, String("Update begin error: ") + Update.errorString());
|
||||
|
|
Loading…
Reference in New Issue