Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832_lcd EthernetInterface USBHost mbed-rtos mbed wave_player
usb.cpp
00001 /* FILE: usb.cpp by Chu Van Thiem 00002 */ 00003 #include "usb.h" 00004 00005 usb::usb(const char * rootdir) : USBHostMSD(rootdir) 00006 { 00007 // Clear list of files 00008 filenames.clear(); 00009 } 00010 00011 void usb::listdir(const char *dir) { 00012 DIR *d; 00013 struct dirent *p; 00014 00015 d = opendir(dir); 00016 if (d != NULL) { 00017 filenames.clear(); 00018 while ((p = readdir(d)) != NULL) { 00019 //printf(" - %s\n", p->d_name); 00020 filenames.push_back(string(p->d_name)); 00021 } 00022 } else { 00023 printf("Could not open directory!\n"); 00024 } 00025 closedir(d); 00026 }
Generated on Tue Aug 2 2022 16:59:57 by
1.7.2