File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939#define AMS_UPDATE_ERR_SUCCESS_CONFIRMED 123
4040
4141#define UPDATE_BUF_SIZE 4096
42+ #define UPDATE_MAX_BLOCK_RETRY 25
43+ #define UPDATE_MAX_REBOOT_RETRY 12
4244
4345class AmsFirmwareUpdater {
4446public:
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ void AmsFirmwareUpdater::setUpgradeInformation(UpgradeInformation& upinfo) {
7474 #endif
7575 debugger->printf_P (PSTR (" Resuming uprade to %s\n " ), updateStatus.toVersion );
7676
77- if (updateStatus.reboot_count ++ < 8 ) {
77+ if (updateStatus.reboot_count ++ < UPDATE_MAX_REBOOT_RETRY ) {
7878 updateStatus.errorCode = AMS_UPDATE_ERR_OK ;
7979 } else {
8080 updateStatus.errorCode = AMS_UPDATE_ERR_REBOOT ;
@@ -129,7 +129,7 @@ void AmsFirmwareUpdater::loop() {
129129 HTTPClient http;
130130 start = millis ();
131131 if (!fetchFirmwareChunk (http)) {
132- if (updateStatus.retry_count ++ == 3 ) {
132+ if (updateStatus.retry_count ++ > UPDATE_MAX_BLOCK_RETRY ) {
133133 updateStatus.errorCode = AMS_UPDATE_ERR_FETCH ;
134134 updateStatusChanged = true ;
135135 }
You can’t perform that action at this time.
0 commit comments