Skip to content

Commit be4bcb6

Browse files
Upload progress fix
1 parent 7e83cfc commit be4bcb6

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

EmbUI/EmbUI.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ void EmbUI::begin(){
341341
Update.printError(Serial);
342342
}
343343
}
344-
embui.uploadProgress(index + len, request->contentLength());
344+
uploadProgress(index + len, request->contentLength());
345345
});
346346

347347
//First request will return 0 results unless you start scan from somewhere else (loop/setup)
@@ -445,7 +445,7 @@ void EmbUI::set_callback(CallBack set, CallBack action, callback_function_t call
445445
/*
446446
* OTA update progress
447447
*/
448-
uint8_t EmbUI::uploadProgress(size_t len, size_t total){
448+
uint8_t uploadProgress(size_t len, size_t total){
449449
static int prev = 0;
450450
float part = total / 25.0; // logger chunks
451451
int curr = len / part;

EmbUI/EmbUI.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class Interface;
114114
void __attribute__((weak)) section_main_frame(Interface *interf, JsonObject *data);
115115
void __attribute__((weak)) pubCallback(Interface *interf);
116116
String __attribute__((weak)) httpCallback(const String &param, const String &value, bool isset);
117-
void __attribute__((weak)) uploadProgress(size_t len, size_t total);
117+
uint8_t __attribute__((weak)) uploadProgress(size_t len, size_t total);
118118
void __attribute__((weak)) create_parameters();
119119

120120
//----------------------
@@ -309,11 +309,6 @@ class EmbUI
309309
callback_function_t _cb_STADisconnected = nullptr;
310310
callback_function_t _cb_STAGotIP = nullptr;
311311

312-
/*
313-
* OTA update progress, return upload %
314-
*/
315-
uint8_t uploadProgress(size_t len, size_t total);
316-
317312
#ifdef USE_SSDP
318313
void ssdp_begin() {
319314
String hn = param(FPSTR(P_hostname));

examples/ex_generic/src/interface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ void set_language(Interface *interf, JsonObject *data);
2626

2727
//void remote_action(RA action, ...);
2828

29-
//void uploadProgress(size_t len, size_t total);
29+
//uint8_t uploadProgress(size_t len, size_t total);

0 commit comments

Comments
 (0)