USB BARCODE READER
Revision 3:a2c477c9da16, committed 2017-04-27
- Comitter:
- jamike
- Date:
- Thu Apr 27 06:33:20 2017 +0000
- Parent:
- 2:107b7b44bd35
- Child:
- 4:2ca820a42fd5
- Commit message:
- update example for hub support
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Apr 26 20:09:08 2017 +0000
+++ b/main.cpp Thu Apr 27 06:33:20 2017 +0000
@@ -62,17 +62,16 @@
printf("wait for usb memory stick insertion\n");
while(1) {
-again:
// try to connect a MSD device
while(!msd.connect()) {
Thread::wait(500);
}
- if (fs.mount(&msd) != 0) goto again;
+ if (fs.mount(&msd) != 0) continue;
else
printf("file system mounted\n");
if (!msd.connect()) {
- goto again;
+ continue;
}
// in a loop, append a file
@@ -98,7 +97,7 @@
while (msd.connected()) {
Thread::wait(500);
}
- while (fs.unmount()==-1) {
+ while (fs.unmount() < 0) {
Thread::wait(500);
printf("unmount\n");
}