File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ FatFile file;
64
64
Adafruit_USBD_MSC usb_msc;
65
65
66
66
// Set to true when PC write to flash
67
- bool changed ;
67
+ bool fs_changed ;
68
68
69
69
// the setup function runs once when you press reset or power the board
70
70
void setup ()
@@ -94,17 +94,17 @@ void setup()
94
94
// while ( !Serial ) delay(10); // wait for native usb
95
95
96
96
Serial.println (" Adafruit TinyUSB Mass Storage External Flash example" );
97
- Serial.print (" JEDEC ID: " ); Serial.println (flash.getJEDECID (), HEX);
98
- Serial.print (" Flash size: " ); Serial.println (flash.size ());
97
+ Serial.print (" JEDEC ID: 0x " ); Serial.println (flash.getJEDECID (), HEX);
98
+ Serial.print (" Flash size: " ); Serial.print (flash.size () / 1024 ); Serial. println ( " KB " );
99
99
100
- changed = true ; // to print contents initially
100
+ fs_changed = true ; // to print contents initially
101
101
}
102
102
103
103
void loop ()
104
104
{
105
- if ( changed )
105
+ if ( fs_changed )
106
106
{
107
- changed = false ;
107
+ fs_changed = false ;
108
108
109
109
if ( !root.open (" /" ) )
110
110
{
@@ -170,7 +170,7 @@ void msc_flush_cb (void)
170
170
// clear file system's cache to force refresh
171
171
fatfs.cacheClear ();
172
172
173
- changed = true ;
173
+ fs_changed = true ;
174
174
175
175
digitalWrite (LED_BUILTIN, LOW);
176
176
}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ SdFile file;
29
29
Adafruit_USBD_MSC usb_msc;
30
30
31
31
// Set to true when PC write to flash
32
- bool changed ;
32
+ bool fs_changed ;
33
33
34
34
// the setup function runs once when you press reset or power the board
35
35
void setup ()
@@ -76,12 +76,12 @@ void setup()
76
76
// MSC is ready for read/write
77
77
usb_msc.setUnitReady (true );
78
78
79
- changed = true ; // to print contents initially
79
+ fs_changed = true ; // to print contents initially
80
80
}
81
81
82
82
void loop ()
83
83
{
84
- if ( changed )
84
+ if ( fs_changed )
85
85
{
86
86
root.open (" /" );
87
87
Serial.println (" SD contents:" );
@@ -107,7 +107,7 @@ void loop()
107
107
108
108
Serial.println ();
109
109
110
- changed = false ;
110
+ fs_changed = false ;
111
111
delay (1000 ); // refresh every 0.5 second
112
112
}
113
113
}
@@ -139,7 +139,7 @@ void msc_flush_cb (void)
139
139
// clear file system's cache to force refresh
140
140
sd.cacheClear ();
141
141
142
- changed = true ;
142
+ fs_changed = true ;
143
143
144
144
digitalWrite (LED_BUILTIN, LOW);
145
145
}
You can’t perform that action at this time.
0 commit comments