USB BARCODE READER
Revision 1:a12f904713ed, committed 2017-02-17
- Comitter:
- jamike
- Date:
- Fri Feb 17 12:04:00 2017 +0000
- Parent:
- 0:0282e73ca55b
- Child:
- 2:107b7b44bd35
- Commit message:
- Fix MSD (improve NYET handling)
Changed in this revision
| USBHOST.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/USBHOST.lib Wed Feb 15 13:07:06 2017 +0000 +++ b/USBHOST.lib Fri Feb 17 12:04:00 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/ST/code/USBHOST/#ab240722d7ef +https://developer.mbed.org/teams/ST/code/USBHOST/#1c76b46ad779
--- a/main.cpp Wed Feb 15 13:07:06 2017 +0000
+++ b/main.cpp Fri Feb 17 12:04:00 2017 +0000
@@ -3,13 +3,13 @@
DigitalOut led(LED1);
void msd_task(void const *) {
printf("init msd\n");
- USBHostMSD msd("usb");
+ USBHostMSD *msd;
int i = 0;
printf("wait for usb memory stick insertion\n");
while(1) {
-
+ msd = new USBHostMSD("usb");
// try to connect a MSD device
- while(!msd.connect()) {
+ while(!msd->connect()) {
Thread::wait(500);
}
@@ -29,9 +29,10 @@
Thread::wait(500);
printf("again\n");
// if device disconnected, try to connect again
- while (msd.connected()) {
+ while (msd->connected()) {
Thread::wait(500);
}
+ delete msd;
}
}