USB BARCODE READER
Diff: main.cpp
- Revision:
- 3:a2c477c9da16
- Parent:
- 2:107b7b44bd35
- Child:
- 5:e163f0e428ac
--- 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");
}