wwatson
Well-known member
Ran into a situation where a USB drive would fail to initialize properly. This showed up in two files. driveInfo.ino in the USBHost_t36 library and in an example sketch of mine copyFileUSB.ino. The drive init portion in setup() was incorrect:
This waited for the drive to appear which it did. But sometimes the filesystem portion was not ready and any disk operation would fail. So changed it to:
That fixed the problem. Will issue a PR for driveInfo.ino.
Code:
Serial.print("\nInitializing USB MSC drive...");
// Wait for the drive to start.
while (!myDrive) {
myusb.Task();
}
Code:
Serial.print("\nWaiting for partition to...");
while (!myFiles) {
myusb.Task();
}
That fixed the problem. Will issue a PR for driveInfo.ino.