File tree 7 files changed +68
-7
lines changed
7 files changed +68
-7
lines changed Original file line number Diff line number Diff line change 22
22
* INCLUDE
23
23
******************************************************************************/
24
24
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
+
25
34
#include < BlockDevice.h>
26
35
#include < MBRBlockDevice.h>
27
- #include < SDMMCBlockDevice.h>
28
-
29
36
#include < FATFileSystem.h>
30
37
#include < LittleFileSystem.h>
31
38
32
- #include < QSPIFBlockDevice.h>
33
-
34
39
/* *****************************************************************************
35
40
* DEFINE
36
41
******************************************************************************/
@@ -117,7 +122,12 @@ class Arduino_Portenta_OTA
117
122
* INCLUDE
118
123
******************************************************************************/
119
124
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
122
132
123
133
#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 19
19
INCLUDE
20
20
******************************************************************************/
21
21
22
+ #include " Arduino_Portenta_OTA_Config.h"
23
+ #if defined(ARDUINO_PORTENTA_OTA_QSPI_SUPPORT)
24
+
22
25
#include " Arduino_Portenta_OTA_QSPI.h"
23
26
24
27
#include < assert.h>
@@ -97,3 +100,5 @@ bool Arduino_Portenta_OTA_QSPI::open()
97
100
98
101
return false ;
99
102
}
103
+
104
+ #endif /* ARDUINO_PORTENTA_OTA_QSPI_SUPPORT */
Original file line number Diff line number Diff line change 22
22
* INCLUDE
23
23
******************************************************************************/
24
24
25
+ #include " Arduino_Portenta_OTA_Config.h"
26
+ #if defined(ARDUINO_PORTENTA_OTA_QSPI_SUPPORT)
27
+
25
28
#include " Arduino_Portenta_OTA.h"
26
29
27
30
/* *****************************************************************************
@@ -50,4 +53,5 @@ class Arduino_Portenta_OTA_QSPI : public Arduino_Portenta_OTA
50
53
mbed::FATFileSystem * _fs_qspi;
51
54
};
52
55
56
+ #endif /* ARDUINO_PORTENTA_OTA_QSPI_SUPPORT */
53
57
#endif /* ARDUINO_PORTENTA_OTA_QSPI_H_ */
Original file line number Diff line number Diff line change 19
19
INCLUDE
20
20
******************************************************************************/
21
21
22
+ #include " Arduino_Portenta_OTA_Config.h"
23
+ #if defined(ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT)
24
+
22
25
#include " Arduino_Portenta_OTA_SD.h"
23
26
24
27
#include " BSP.h"
@@ -97,3 +100,5 @@ bool Arduino_Portenta_OTA_SD::open()
97
100
98
101
return false ;
99
102
}
103
+
104
+ #endif /* ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT */
Original file line number Diff line number Diff line change 22
22
* INCLUDE
23
23
******************************************************************************/
24
24
25
+ #include " Arduino_Portenta_OTA_Config.h"
26
+ #if defined(ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT)
27
+
25
28
#include " Arduino_Portenta_OTA.h"
26
29
27
30
/* *****************************************************************************
@@ -50,4 +53,5 @@ class Arduino_Portenta_OTA_SD : public Arduino_Portenta_OTA
50
53
51
54
};
52
55
56
+ #endif /* ARDUINO_PORTENTA_OTA_SDMMC_SUPPORT */
53
57
#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()
179
179
180
180
feedWatchdog ();
181
181
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)
183
183
{
184
184
fclose (update_file);
185
185
remove (UPDATE_FILE_NAME_LZSS);
You can’t perform that action at this time.
0 commit comments