Skip to content

Commit adbe5cc

Browse files
committed
Use static class member instead of global var
1 parent 9081293 commit adbe5cc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/USBStorage.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#define MAX_TRIES 10
88

9+
bool USBStorage::usb_available = false;
10+
911
USBStorage::USBStorage(){
1012
#if defined(ARDUINO_PORTENTA_C33)
1113
register_hotplug_callback(DEV_USB, [](){

src/USBStorage.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#ifndef USBStorage_H
44
#define USBStorage_H
55

6-
7-
static bool usb_available = false;
8-
96
/**
107
* Represents a USB storage using the Arduino Unified Storage library.
118
*/
@@ -84,6 +81,7 @@ class USBStorage : public Arduino_UnifiedStorage {
8481
bool connected = false;
8582
unsigned long previousMillis;
8683
int interval = 500;
84+
static bool usb_available;
8785
};
8886

8987
#endif

0 commit comments

Comments
 (0)