@@ -137,6 +137,8 @@ int Arduino_Portenta_OTA::decompress()
137
137
uint32_t crc32, bytes_read;
138
138
uint8_t crc_buf[128 ];
139
139
140
+ feedWatchdog ();
141
+
140
142
/* Read the OTA header ... */
141
143
fread (ota_header.buf , 1 , sizeof (ota_header.buf ), update_file);
142
144
@@ -147,6 +149,8 @@ int Arduino_Portenta_OTA::decompress()
147
149
return static_cast <int >(Error::OtaHeaderLength);
148
150
}
149
151
152
+ feedWatchdog ();
153
+
150
154
/* ... and the CRC second ... rewind to start of CRC verified header ... */
151
155
fseek (update_file, sizeof (ota_header.header .len ) + sizeof (ota_header.header .crc32 ), SEEK_SET);
152
156
/* ... initialize CRC ... */
@@ -161,6 +165,9 @@ int Arduino_Portenta_OTA::decompress()
161
165
}
162
166
fread (crc_buf, 1 , ota_header.header .len - bytes_read, update_file);
163
167
crc32 = crc_update (crc32, crc_buf, ota_header.header .len - bytes_read);
168
+
169
+ feedWatchdog ();
170
+
164
171
/* ... then finalise ... */
165
172
crc32 ^= 0xFFFFFFFF ;
166
173
/* ... and compare. */
@@ -170,6 +177,8 @@ int Arduino_Portenta_OTA::decompress()
170
177
return static_cast <int >(Error::OtaHeaderCrc);
171
178
}
172
179
180
+ feedWatchdog ();
181
+
173
182
if (ota_header.header .magic_number != 0x2341025b ) /* 0x2341:025b = VID/PID Portenta H7 */
174
183
{
175
184
fclose (update_file);
@@ -184,7 +193,7 @@ int Arduino_Portenta_OTA::decompress()
184
193
185
194
FILE* decompressed = fopen (UPDATE_FILE_NAME, " w" );
186
195
187
- lzss_init (update_file, decompressed, LZSS_FILE_SIZE);
196
+ lzss_init (update_file, decompressed, LZSS_FILE_SIZE, _feed_watchdog_func );
188
197
189
198
/* During the process of decoding UPDATE.BIN.LZSS
190
199
* is decompressed and stored as UPDATE.BIN.
0 commit comments