File tree 6 files changed +17
-187
lines changed 6 files changed +17
-187
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -41,15 +41,14 @@ bool Folder::remove() {
41
41
if (this ->exists ()){
42
42
std::vector<UFile> files = this ->getFiles ();
43
43
for (UFile file : files) {
44
- Serial. println (file. getPathString ());
44
+
45
45
file.remove ();
46
46
47
47
}
48
48
49
49
// Remove all subfolders in the directory
50
50
std::vector<Folder> folders = this ->getFolders ();
51
51
for (Folder directory : folders) {
52
- Serial.println (directory.getPathString ());
53
52
directory.remove ();
54
53
}
55
54
Original file line number Diff line number Diff line change 1
1
#include " Arduino_UnifiedStorage.h"
2
2
3
3
InternalStorage::InternalStorage (){
4
+
5
+ }
6
+
7
+ InternalStorage::InternalStorage (int partition, const char * name ){
8
+ this -> setQSPIPartition (partition);
9
+ this -> setQSPIPartitionName (name);
10
+ }
11
+
12
+
13
+ int InternalStorage::begin (){
4
14
#if defined(ARDUINO_PORTENTA_C33)
5
15
this -> blockDevice = BlockDevice::get_default_instance ();
6
16
this -> userData = new MBRBlockDevice (this ->blockDevice , this ->partitionNumber );
7
17
this -> userDataFileSystem = new FATFileSystem (this ->partitionName );
18
+ int err = this -> userDataFileSystem -> mount (userData);
19
+ if (err == 0 ) return 1 ;
8
20
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
9
21
this -> blockDevice = QSPIFBlockDevice::get_default_instance ();
10
22
this -> userData = new mbed::MBRBlockDevice (this ->blockDevice , this ->partitionNumber );
11
23
this -> userDataFileSystem = new mbed::FATFileSystem (this ->partitionName );
12
- #endif
13
- }
14
-
15
- int InternalStorage::begin (){
16
- #if defined(ARDUINO_PORTENTA_C33)
17
- int err = this -> userDataFileSystem -> mount (userData);
18
- if (err == 0 ) return 1 ;
19
- #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
20
24
int err = this -> userDataFileSystem -> mount (this -> userData);
21
25
if (err == 0 ) return 1 ;
22
26
#endif
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class InternalStorage : public Arduino_UnifiedStorage {
11
11
public:
12
12
InternalStorage ();
13
13
// Override begin() method for SD card initialization
14
+ InternalStorage (int partition, const char * name);
15
+
14
16
int begin () override ;
15
17
16
18
int unmount () override ;
Original file line number Diff line number Diff line change 9
9
USBStorage::USBStorage (){
10
10
#if defined(ARDUINO_PORTENTA_C33)
11
11
register_hotplug_callback (DEV_USB, [](){
12
- Serial.println (" caalllback" );
13
12
available = !available;
14
13
15
14
});
Original file line number Diff line number Diff line change 3
3
#ifndef USBStorage_H
4
4
#define USBStorage_H
5
5
6
- static bool available = false ;
7
6
8
7
9
8
static bool available = false ;
10
9
11
-
12
10
class USBStorage : public Arduino_UnifiedStorage {
13
11
public:
14
12
USBStorage ();
@@ -30,7 +28,8 @@ class USBStorage : public Arduino_UnifiedStorage {
30
28
31
29
32
30
private:
33
-
31
+
32
+
34
33
bool connected = false ;
35
34
36
35
unsigned long previousMillis;
You can’t perform that action at this time.
0 commit comments