Добавить upload и стабильную прошивку 1.2
This commit is contained in:
@@ -128,7 +128,7 @@ static String workerMessage(){char local[128];portENTER_CRITICAL(&gWorkerMux);st
|
||||
// Production HTTPS: this CA trusts Let's Encrypt certificates, including Caddy's default.
|
||||
// If Caddy uses a different issuer, replace this PEM and rebuild the firmware.
|
||||
static const char SERVER_URL[]="https://breathmonitor.shineup.me";
|
||||
static const char FIRMWARE_VERSION[]="1.1";
|
||||
static const char FIRMWARE_VERSION[]="1.2";
|
||||
static const char ROOT_CA[] PROGMEM = R"CERT(
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
|
||||
@@ -478,11 +478,16 @@ static void onlineSettings(lv_event_t *) {
|
||||
gScreen=Screen::Settings;clearUi();legend();topBar("SETTINGS");
|
||||
if(gPaused){gPausedBanner=label(gRoot,"PAUSED",&lv_font_montserrat_20,0xFFD34D);
|
||||
lv_obj_align(gPausedBanner,LV_ALIGN_TOP_MID,0,32);}
|
||||
button(gRoot,"Wi-Fi",24,125,208,55,0x214D69,[](lv_event_t *){if(!gWifiEnabled)wifiEnable(true);wifiScreen(nullptr);});
|
||||
button(gRoot,"TIME",248,125,208,55,0x214D69,[](lv_event_t *){timeScreen(nullptr);});
|
||||
button(gRoot,"ACCOUNT",24,205,208,55,0x214D69,[](lv_event_t *){accountScreen(nullptr);});
|
||||
button(gRoot,"FIRMWARE",248,205,208,55,0x214D69,[](lv_event_t *){firmwareScreen(nullptr);});
|
||||
button(gRoot,"BACK",140,375,200,52,0x214D69,[](lv_event_t *){settings(nullptr);});
|
||||
lv_obj_t *url=label(gRoot,"https://breathmonitor.shineup.me",&lv_font_montserrat_16,0x9EB4C2);lv_obj_set_pos(url,24,91);lv_obj_set_width(url,432);lv_label_set_long_mode(url,LV_LABEL_LONG_DOT);
|
||||
button(gRoot,"UPLOAD",24,125,208,50,0x2A9D8F,[](lv_event_t *){
|
||||
if(gDeviceToken.isEmpty()&&(gAccountLogin.isEmpty()||gAccountPassword.isEmpty())){gWifiNotice="Set account in ACCOUNT";return;}
|
||||
networkStart(NetOperation::Upload);
|
||||
});
|
||||
button(gRoot,"Wi-Fi",248,125,208,50,0x214D69,[](lv_event_t *){if(!gWifiEnabled)wifiEnable(true);wifiScreen(nullptr);});
|
||||
button(gRoot,"TIME",24,195,208,50,0x214D69,[](lv_event_t *){timeScreen(nullptr);});
|
||||
button(gRoot,"ACCOUNT",248,195,208,50,0x214D69,[](lv_event_t *){accountScreen(nullptr);});
|
||||
button(gRoot,"FIRMWARE",24,265,208,50,0x214D69,[](lv_event_t *){firmwareScreen(nullptr);});
|
||||
button(gRoot,"BACK",248,265,208,50,0x214D69,[](lv_event_t *){settings(nullptr);});
|
||||
}
|
||||
// PMU power key can blank the AMOLED independently of our timeout flag.
|
||||
// Explicitly wake the panel for any accepted KEY1 action.
|
||||
@@ -997,9 +1002,9 @@ static void firmwareConfirmScreen(lv_event_t *){
|
||||
button(gRoot,"UPDATE",256,300,200,55,0x2A9D8F,[](lv_event_t *){networkStart(NetOperation::Firmware);firmwareScreen(nullptr);});
|
||||
}
|
||||
static void firmwareScreen(lv_event_t *){
|
||||
gScreen=Screen::Firmware;clearUi();legend();topBar("FIRMWARE");char line[96];snprintf(line,sizeof(line),"Installed: %s\nStable: 1.1\nTest: 1.2",FIRMWARE_VERSION);lv_obj_t *t=label(gRoot,line,&lv_font_montserrat_20,0xFFFFFF);lv_obj_set_pos(t,28,100);
|
||||
gScreen=Screen::Firmware;clearUi();legend();topBar("FIRMWARE");char line[96];snprintf(line,sizeof(line),"Installed: %s\nStable: 1.2\nTest: 1.2",FIRMWARE_VERSION);lv_obj_t *t=label(gRoot,line,&lv_font_montserrat_20,0xFFFFFF);lv_obj_set_pos(t,28,100);
|
||||
if(gNetOperation==NetOperation::Firmware||gWorkerActive){lv_obj_t *s=label(gRoot,workerMessage().c_str(),&lv_font_montserrat_16,0xFFD34D);lv_obj_set_pos(s,28,220);}
|
||||
button(gRoot,"UPDATE STABLE",24,285,208,55,0x2A9D8F,[](lv_event_t *){gFirmwareTarget="1.1";firmwareConfirmScreen(nullptr);});
|
||||
button(gRoot,"UPDATE STABLE",24,285,208,55,0x2A9D8F,[](lv_event_t *){gFirmwareTarget="1.2";firmwareConfirmScreen(nullptr);});
|
||||
button(gRoot,"UPDATE TEST",248,285,208,55,0xA56A36,[](lv_event_t *){gFirmwareTarget="1.2";firmwareConfirmScreen(nullptr);});
|
||||
button(gRoot,"BACK",140,375,200,52,0x214D69,[](lv_event_t *){onlineSettings(nullptr);});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user