File tree Expand file tree Collapse file tree 7 files changed +68
-7
lines changed Expand file tree Collapse file tree 7 files changed +68
-7
lines changed Original file line number Diff line number Diff line change 2222 * INCLUDE
2323 ******************************************************************************/
2424
25+ #include " Arduino_Portenta_OTA_Config.h"
26+ #if defined(ARDUINO_PORTENTA_OTA_QSPI_SUPPORT)
27+ #include < QSPIFBlockDevice.h>
28+ #endif
29+
30+ #if defined(ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT)
31+ #include < SDMMCBlockDevice.h>
32+ #endif
33+
2534#include < BlockDevice.h>
2635#include < MBRBlockDevice.h>
27- #include < SDMMCBlockDevice.h>
28-
2936#include < FATFileSystem.h>
3037#include < LittleFileSystem.h>
3138
32- #include < QSPIFBlockDevice.h>
33-
3439/* *****************************************************************************
3540 * DEFINE
3641 ******************************************************************************/
@@ -117,7 +122,12 @@ class Arduino_Portenta_OTA
117122 * INCLUDE
118123 ******************************************************************************/
119124
120- #include " Arduino_Portenta_OTA_SD.h"
121- #include " Arduino_Portenta_OTA_QSPI.h"
125+ #if defined(ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT)
126+ #include " Arduino_Portenta_OTA_SD.h"
127+ #endif
128+
129+ #if defined(ARDUINO_PORTENTA_OTA_QSPI_SUPPORT)
130+ #include " Arduino_Portenta_OTA_QSPI.h"
131+ #endif
122132
123133#endif /* ARDUINO_PORTENTA_OTA_H_ */
Original file line number Diff line number Diff line change 1+ /*
2+ This file is part of Arduino_Portenta_OTA.
3+
4+ Copyright 2022 ARDUINO SA (http://www.arduino.cc/)
5+
6+ This software is released under the GNU General Public License version 3,
7+ which covers the main part of arduino-cli.
8+ The terms of this license can be found at:
9+ https://www.gnu.org/licenses/gpl-3.0.en.html
10+
11+ You can be released from the requirements of the above licenses by purchasing
12+ a commercial license. Buying such a license is mandatory if you want to modify or
13+ otherwise use the software for commercial activities involving the Arduino
14+ software without disclosing the source code of your own applications. To purchase
15+ a commercial license, send an email to [email protected] . 16+ */
17+
18+ #ifndef ARDUINO_PORTENTA_OTA_CONFIG_H_
19+ #define ARDUINO_PORTENTA_OTA_CONFIG_H_
20+
21+ /******************************************************************************
22+ * INCLUDE
23+ ******************************************************************************/
24+
25+ #include <Arduino.h>
26+
27+ #if defined(ARDUINO_PORTENTA_H7_M7 )
28+ #define ARDUINO_PORTENTA_OTA_MAGIC 0x2341025b
29+ #define ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT
30+ #define ARDUINO_PORTENTA_OTA_QSPI_SUPPORT
31+ #endif
32+
33+ #endif /* ARDUINO_PORTENTA_OTA_CONFIG_H_ */
Original file line number Diff line number Diff line change 1919 INCLUDE
2020 ******************************************************************************/
2121
22+ #include " Arduino_Portenta_OTA_Config.h"
23+ #if defined(ARDUINO_PORTENTA_OTA_QSPI_SUPPORT)
24+
2225#include " Arduino_Portenta_OTA_QSPI.h"
2326
2427#include < assert.h>
@@ -97,3 +100,5 @@ bool Arduino_Portenta_OTA_QSPI::open()
97100
98101 return false ;
99102}
103+
104+ #endif /* ARDUINO_PORTENTA_OTA_QSPI_SUPPORT */
Original file line number Diff line number Diff line change 2222 * INCLUDE
2323 ******************************************************************************/
2424
25+ #include " Arduino_Portenta_OTA_Config.h"
26+ #if defined(ARDUINO_PORTENTA_OTA_QSPI_SUPPORT)
27+
2528#include " Arduino_Portenta_OTA.h"
2629
2730/* *****************************************************************************
@@ -50,4 +53,5 @@ class Arduino_Portenta_OTA_QSPI : public Arduino_Portenta_OTA
5053 mbed::FATFileSystem * _fs_qspi;
5154};
5255
56+ #endif /* ARDUINO_PORTENTA_OTA_QSPI_SUPPORT */
5357#endif /* ARDUINO_PORTENTA_OTA_QSPI_H_ */
Original file line number Diff line number Diff line change 1919 INCLUDE
2020 ******************************************************************************/
2121
22+ #include " Arduino_Portenta_OTA_Config.h"
23+ #if defined(ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT)
24+
2225#include " Arduino_Portenta_OTA_SD.h"
2326
2427#include " BSP.h"
@@ -97,3 +100,5 @@ bool Arduino_Portenta_OTA_SD::open()
97100
98101 return false ;
99102}
103+
104+ #endif /* ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT */
Original file line number Diff line number Diff line change 2222 * INCLUDE
2323 ******************************************************************************/
2424
25+ #include " Arduino_Portenta_OTA_Config.h"
26+ #if defined(ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT)
27+
2528#include " Arduino_Portenta_OTA.h"
2629
2730/* *****************************************************************************
@@ -50,4 +53,5 @@ class Arduino_Portenta_OTA_SD : public Arduino_Portenta_OTA
5053
5154};
5255
56+ #endif /* ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT */
5357#endif /* ARDUINO_PORTENTA_OTA_SD_H_ */
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ int Arduino_Portenta_OTA::decompress()
179179
180180 feedWatchdog ();
181181
182- if (ota_header.header .magic_number != 0x2341025b ) /* 0x2341:025b = VID/PID Portenta H7 */
182+ if (ota_header.header .magic_number != ARDUINO_PORTENTA_OTA_MAGIC)
183183 {
184184 fclose (update_file);
185185 remove (UPDATE_FILE_NAME_LZSS);
You can’t perform that action at this time.
0 commit comments