File tree Expand file tree Collapse file tree 3 files changed +37
-30
lines changed Expand file tree Collapse file tree 3 files changed +37
-30
lines changed Original file line number Diff line number Diff line change 11name =Settings
2- version =1.0.15
2+ version =1.0.16
33author =AlexGyver <
[email protected] >
44maintainer =AlexGyver <
[email protected] >
55sentence =Simple UI webface builder for esp8266/esp32
Original file line number Diff line number Diff line change 1+ #include " ota.h"
2+
3+ namespace sets {
4+
5+ bool beginOta (bool ota_flash, bool async) {
6+ size_t ota_size = 0 ;
7+ int ota_type = 0 ;
8+
9+ if (ota_flash) {
10+ ota_type = U_FLASH;
11+ #ifdef ESP8266
12+ ota_size = (size_t )((ESP.getFreeSketchSpace () - 0x1000 ) & 0xFFFFF000 );
13+ #else
14+ ota_size = UPDATE_SIZE_UNKNOWN;
15+ #endif
16+ } else {
17+ #ifdef ESP8266
18+ ota_type = U_FS;
19+ close_all_fs ();
20+ #ifndef GH_NO_FS
21+ ota_size = (size_t )&_FS_end - (size_t )&_FS_start;
22+ #endif
23+ #else
24+ ota_type = U_SPIFFS;
25+ ota_size = UPDATE_SIZE_UNKNOWN;
26+ #endif
27+ }
28+
29+ #ifdef ESP8266
30+ if (async) Update.runAsync (true );
31+ #endif
32+ return Update.begin (ota_size, ota_type);
33+ }
34+
35+ }
Original file line number Diff line number Diff line change 1212
1313namespace sets {
1414
15- bool beginOta (bool ota_flash = true , bool async = false ) {
16- size_t ota_size = 0 ;
17- int ota_type = 0 ;
18-
19- if (ota_flash) {
20- ota_type = U_FLASH;
21- #ifdef ESP8266
22- ota_size = (size_t )((ESP.getFreeSketchSpace () - 0x1000 ) & 0xFFFFF000 );
23- #else
24- ota_size = UPDATE_SIZE_UNKNOWN;
25- #endif
26- } else {
27- #ifdef ESP8266
28- ota_type = U_FS;
29- close_all_fs ();
30- #ifndef GH_NO_FS
31- ota_size = (size_t )&_FS_end - (size_t )&_FS_start;
32- #endif
33- #else
34- ota_type = U_SPIFFS;
35- ota_size = UPDATE_SIZE_UNKNOWN;
36- #endif
37- }
38-
39- #ifdef ESP8266
40- if (async) Update.runAsync (true );
41- #endif
42- return Update.begin (ota_size, ota_type);
43- }
15+ bool beginOta (bool ota_flash = true , bool async = false );
4416
4517} // namespace sets
You can’t perform that action at this time.
0 commit comments