Skip to content

Commit 5d2ab67

Browse files
removed checkConnection()
1 parent 3592f5b commit 5d2ab67

File tree

5 files changed

+2
-217
lines changed

5 files changed

+2
-217
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ This library is compatible with STM32 and Renesas based Arduino boards. The avai
4545
* Portenta H7 + Vision Shield: SD and QSPI
4646
* Portenta C33 + Portenta Breakout: USB, SD, and QSPI
4747
* Portenta C33 + Vision Shield: SD and QSPI
48+
49+
Note: Due to a known hardware issue on the Portenta Breakout Board, inserting a USB drive on the USB-A port of the breakout board will cause a reboot on Portenta C33 boards. You can work around this issue by connecting your USB Mass Storage device trough a USB hub. This issue only affects Portenta C33 boards, not Portenta H7 or Portenta Machine Control.

examples/AdvancedUSBInternalOperations/AdvancedUSBInternalOperations.ino

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 181 deletions
This file was deleted.

src/USBStorage.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
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(){
1312
#if defined(ARDUINO_PORTENTA_C33)
@@ -56,34 +55,11 @@ Folder USBStorage::getRootFolder(){
5655
return Folder("/usb");
5756
}
5857

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

6359
bool USBStorage::isConnected(){
6460
return this -> connected;
6561
}
6662

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-
}
8763

8864
bool USBStorage::format(FileSystems fs){
8965
if(fs == FS_FAT){

src/USBStorage.h

Lines changed: 0 additions & 11 deletions
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)