File tree Expand file tree Collapse file tree 4 files changed +463
-440
lines changed Expand file tree Collapse file tree 4 files changed +463
-440
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,29 @@ int main() {
220220 goto boot;
221221 }
222222
223+ /* Thirdly verify via magic number if this application is intented for
224+ * MKR WIFI 1010 or NANO 33 IOT.
225+ */
226+ #if defined(ARDUINO_SAMD_MKRWIFI1010)
227+ if (ota_header.header .magic_number != 0x23418054 ) /* 2341:8054 = VID/PID MKR WIFI 1010 */
228+ {
229+ update_file.close ();
230+ update_file.erase ();
231+ goto boot;
232+ }
233+ #elif defined(ARDUINO_SAMD_NANO_33_IOT)
234+ if (ota_header.header .magic_number != 0x23418057 ) /* 2341:8057 = VID/PID NANO 33 IOT */
235+ {
236+ update_file.close ();
237+ update_file.erase ();
238+ goto boot;
239+ }
240+ #else
241+ update_file.close ();
242+ update_file.erase ();
243+ goto boot;
244+ #endif
245+
223246 /* Rewind to start of LZSS compressed binary. */
224247 update_file.seek (sizeof (ota_header.buf ));
225248
You can’t perform that action at this time.
0 commit comments