Skip to content

Commit f783e81

Browse files
added full refactorings, but it fails to build for now
1 parent 12b6e76 commit f783e81

8 files changed

+30
-17
lines changed
-5.43 MB
Binary file not shown.

examples/AdvancedInternalStorage/AdvancedInternalStorage.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <Arduino.h>
21
#include <Arduino_UnifiedStorage.h>
32
#include <vector>
43

src/Arduino_UnifiedStorage.h

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,39 @@
22
#ifndef UnifiedStorage_H
33
#define UnifiedStorage_H
44

5+
#define HAS_SD defined(ARDUINO_PORTENTA_C33) || defined(ARDUINO_PORTENTA_H7_M7)
6+
#define HAS_USB defined(ARDUINO_PORTENTA_C33) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
7+
#define HAS_QSPI defined(ARDUINO_PORTENTA_C33) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA) || defined(ARDUINO_NICLA_VISION)
8+
9+
#define USES_RENESAS_CORE defined(ARDUINO_PORTENTA_C33)
10+
#define USES_MBED_CORE defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA) || defined(ARDUINO_NICLA_VISION)
11+
512

613
#include "Arduino.h"
714
#include "Arduino_POSIXStorage.h"
15+
#include <vector>
16+
#include "Types.h"
17+
#include "Utils.h"
818
#include "Folder.h"
919
#include "UFile.h"
10-
#include "Utils.h"
1120

1221

1322

1423

24+
#if defined(HAS_USB)
25+
#include "USBStorage.h"
26+
#endif
27+
28+
#if defined(HAS_SD)
29+
#include "SDStorage.h"
30+
#endif
31+
32+
#if defined(HAS_QSPI)
33+
#include "InternalStorage.h"
34+
#endif
35+
36+
37+
1538
/**
1639
* Abstract class representing the common features of the supported storage methods
1740
*/
@@ -52,14 +75,7 @@ class Arduino_UnifiedStorage {
5275
};
5376

5477

55-
#if defined(ARDUINO_PORTENTA_C33) || defined(ARDUINO_PORTENTA_H7_M7)
56-
#include "USBStorage.h"
57-
#include "SDStorage.h"
58-
#include "InternalStorage.h"
59-
#elif defined(ARDUINO_OPTA)
60-
#include "USBStorage.h"
61-
#include "InternalStorage.h"
62-
#endif
78+
6379

6480

6581
#endif

src/InternalStorage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "Arduino_UnifiedStorage.h"
55
#include "Partitioning.h"
66
#include "Types.h"
7+
78
/**
89
* Represents internal storage using the Arduino Unified Storage library.
910
*/

src/Partitioning.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
#include "Arduino.h"
3-
#include "Arduino_POSIXStorage.h"
3+
#include "Arduino_UnifiedStorage.h"
44
#include "Types.h"
55
#include <vector>
66

src/SDStorage.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include "Arduino_UnifiedStorage.h"
77

8-
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_C33) || !defined(ARDUINO_OPTA)
98

109
/**
1110
* Represents an SD card storage using the Arduino Unified Storage library.
@@ -59,5 +58,3 @@ class SDStorage: public Arduino_UnifiedStorage {
5958
};
6059

6160
#endif
62-
63-
#endif

src/Types.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#if defined(ARDUINO_PORTENTA_C33)
1+
2+
#if defined(USES_RENESAS_CORE)
23
#include "BlockDevice.h"
34
#include "MBRBlockDevice.h"
45
#include "LittleFileSystem.h"
@@ -11,7 +12,7 @@
1112
typedef LittleFileSystem LittleFileSystemType;
1213
typedef FileSystem FileSystemType;
1314

14-
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_OPTA)
15+
#elif defined(USES_MBED_CORE)
1516
#include "QSPIFBlockDevice.h"
1617
#include "MBRBlockDevice.h"
1718
#include "FATFileSystem.h"

src/Utils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "Arduino.h"
88
#include "Arduino_POSIXStorage.h"
99
#include <iostream>
10-
#include <vector>
1110

1211

1312

0 commit comments

Comments
 (0)