Skip to content

Commit 9c0ea7d

Browse files
committed
update example
1 parent 2affe1b commit 9c0ea7d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/MassStorage/msc_external_flash/msc_external_flash.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void loop()
104104
Serial.println();
105105

106106
changed = false;
107-
delay(1000); // refresh every 1 second
107+
delay(1000); // refresh every 0.5 second
108108
}
109109
}
110110

@@ -132,7 +132,11 @@ int32_t msc_write_cb (uint32_t lba, uint8_t* buffer, uint32_t bufsize)
132132
// used to flush any pending cache.
133133
void msc_flush_cb (void)
134134
{
135+
// sync with flash
135136
flash.syncBlocks();
136137

138+
// clear file system's cache to force refresh
139+
fatfs.cacheClear();
140+
137141
changed = true;
138142
}

0 commit comments

Comments
 (0)