Skip to content

Commit c6c3c22

Browse files
Merge pull request #19 from arduino-libraries/remove_logger
Remove logger
2 parents bfcb677 + ae9a74b commit c6c3c22

File tree

6 files changed

+2
-225
lines changed

6 files changed

+2
-225
lines changed

.github/workflows/compile-examples.yml

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ jobs:
4646
- fqbn: arduino:mbed_portenta:envie_m7
4747
platforms: |
4848
- name: arduino:mbed_portenta
49-
additional-sketch-paths: |
50-
- examples/PortentaH7Logger
5149
- fqbn: arduino:renesas_portenta:portenta_c33
5250
platforms: |
5351
- name: arduino:renesas_portenta

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ The Arduino_UnifiedStorage library provides a unified interface to access differ
88
## Examples
99
* [**examples/SimpleStorageWriteRead**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/SimpleStorageWriteRead/SimpleStorageWriteRead.ino) - Write/read simple data from SD, USB and internal storage
1010
* [**examples/AdvancedUSBInternalOperations**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/AdvancedUSBInternalOperations/AdvancedUSBInternalOperations.ino) - Navigate file structure and demonstrate file operations between USB and internal storage
11-
* [**examples/PortentaH7Logger**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/PortentaH7Logger/PortentaH7Logger.ino) - Log analog input to the Portenta H7 with timestamp, then save to internal storage and backup to USB (if detected)
1211
* [**examples/BackupInternalPartitions**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/BackupInternalPartitions/BackupInternalPartitions.ino) - Back up all partitions on the internal storage to a USB Mass Storage device.
1312

1413
## Instructions
@@ -47,3 +46,5 @@ This library has been tested with the following STM32 and Renesas based Arduino
4746
* Portenta C33 + Vision Shield: SD and QSPI
4847
* Opta: Internal QSPI Flash and USB
4948

49+
50+
Note: Due to an unforeseen compatibility issue on the Portenta Breakout Board, inserting a USB drive on the USB-A port of the breakout board may occasionally cause a reboot on Portenta C33 boards. You can work around this issue by connecting your USB Mass Storage device through a USB hub. This limitation only affects Portenta C33 boards.

examples/AdvancedUSBInternalOperations/AdvancedUSBInternalOperations.ino

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ void setup() {
6868
Serial.println(errno);
6969
}
7070

71-
7271
if(internalStorage.begin(FS_FAT)){
7372
Serial.println("Internal storage mounted.");
7473
} else {

examples/PortentaH7Logger/PortentaH7Logger.ino

-181
This file was deleted.

src/USBStorage.cpp

-29
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@
77
// The maximum number of attempts to mount the USB drive
88
constexpr auto MAX_MOUNT_ATTEMPTS = 10;
99

10-
volatile bool USBStorage::usbAvailable = false;
1110

1211
USBStorage::USBStorage(){
13-
#if defined(ARDUINO_PORTENTA_C33)
14-
register_hotplug_callback(DEV_USB, [](){
15-
USBStorage::usbAvailable = !USBStorage::usbAvailable;
16-
});
17-
#endif
1812
}
1913

2014
bool USBStorage::begin(FileSystems fs){
@@ -56,34 +50,11 @@ Folder USBStorage::getRootFolder(){
5650
return Folder("/usb");
5751
}
5852

59-
bool USBStorage::isAvailable(){
60-
return usbAvailable;
61-
}
6253

6354
bool USBStorage::isConnected(){
6455
return this -> connected;
6556
}
6657

67-
void USBStorage::checkConnection(){
68-
#if defined(ARDUINO_PORTENTA_H7_M7)
69-
USBHost * host;
70-
USBDeviceConnected * dev;
71-
unsigned long currentMillis = millis();
72-
boolean found = false;
73-
74-
if (currentMillis - previousMillis >= interval) {
75-
this->previousMillis = currentMillis;
76-
host = USBHost::getHostInst();
77-
78-
if ((dev = host->getDevice(0)) != NULL){
79-
usbAvailable = true;
80-
found = true;
81-
} else{
82-
usbAvailable = false;
83-
}
84-
}
85-
#endif
86-
}
8758

8859
bool USBStorage::format(FileSystems fs){
8960
if(fs == FS_FAT){

src/USBStorage.h

-11
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,7 @@ class USBStorage : public Arduino_UnifiedStorage {
5757
*/
5858
bool isConnected();
5959

60-
/**
61-
* Checks if the USB storage is available.
62-
*
63-
* @return true if available, false otherwise.
64-
*/
65-
bool isAvailable();
6660

67-
/**
68-
* Checks the USB storage connection status.
69-
*/
70-
void checkConnection();
7161

7262

7363

@@ -76,7 +66,6 @@ class USBStorage : public Arduino_UnifiedStorage {
7666
bool connected = false;
7767
unsigned long previousMillis;
7868
unsigned int interval = 500;
79-
static volatile bool usbAvailable;
8069
};
8170

8271
#endif

0 commit comments

Comments
 (0)