Skip to content

Commit a6da6f2

Browse files
committed
minor clean up
1 parent 0385061 commit a6da6f2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

examples/MassStorage/msc_external_flash/msc_external_flash.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ FatFile file;
6464
Adafruit_USBD_MSC usb_msc;
6565

6666
// Set to true when PC write to flash
67-
bool changed;
67+
bool fs_changed;
6868

6969
// the setup function runs once when you press reset or power the board
7070
void setup()
@@ -94,17 +94,17 @@ void setup()
9494
//while ( !Serial ) delay(10); // wait for native usb
9595

9696
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");
9999

100-
changed = true; // to print contents initially
100+
fs_changed = true; // to print contents initially
101101
}
102102

103103
void loop()
104104
{
105-
if ( changed )
105+
if ( fs_changed )
106106
{
107-
changed = false;
107+
fs_changed = false;
108108

109109
if ( !root.open("/") )
110110
{
@@ -170,7 +170,7 @@ void msc_flush_cb (void)
170170
// clear file system's cache to force refresh
171171
fatfs.cacheClear();
172172

173-
changed = true;
173+
fs_changed = true;
174174

175175
digitalWrite(LED_BUILTIN, LOW);
176176
}

examples/MassStorage/msc_sdfat/msc_sdfat.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SdFile file;
2929
Adafruit_USBD_MSC usb_msc;
3030

3131
// Set to true when PC write to flash
32-
bool changed;
32+
bool fs_changed;
3333

3434
// the setup function runs once when you press reset or power the board
3535
void setup()
@@ -76,12 +76,12 @@ void setup()
7676
// MSC is ready for read/write
7777
usb_msc.setUnitReady(true);
7878

79-
changed = true; // to print contents initially
79+
fs_changed = true; // to print contents initially
8080
}
8181

8282
void loop()
8383
{
84-
if ( changed )
84+
if ( fs_changed )
8585
{
8686
root.open("/");
8787
Serial.println("SD contents:");
@@ -107,7 +107,7 @@ void loop()
107107

108108
Serial.println();
109109

110-
changed = false;
110+
fs_changed = false;
111111
delay(1000); // refresh every 0.5 second
112112
}
113113
}
@@ -139,7 +139,7 @@ void msc_flush_cb (void)
139139
// clear file system's cache to force refresh
140140
sd.cacheClear();
141141

142-
changed = true;
142+
fs_changed = true;
143143

144144
digitalWrite(LED_BUILTIN, LOW);
145145
}

0 commit comments

Comments
 (0)