Contiki 2.6

usbmsctst.c

00001 #include <string.h>
00002 #include <stdio.h>
00003 #include <ctype.h>
00004 #include <sys/process.h>
00005 #include <sys/autostart.h>
00006 #include <sys/etimer.h>
00007 #include <usb-api.h>
00008 #include <msc/usb-msc-bulk.h>
00009 
00010 PROCESS(usb_masstest_process, "USB massstorage test process");
00011 
00012 #if 0
00013 extern unsigned int idle_count;
00014 #endif
00015 
00016 PROCESS_THREAD(usb_masstest_process, ev , data)
00017 {
00018   static unsigned int last_count;
00019   PROCESS_BEGIN();
00020   static struct etimer timer;
00021   usb_msc_bulk_setup();
00022   etimer_set(&timer, CLOCK_SECOND);
00023 #if 0
00024   last_count = idle_count;
00025 #endif
00026   while(1) {
00027     PROCESS_WAIT_EVENT();
00028     if (ev == PROCESS_EVENT_TIMER) {
00029 #if 0
00030       printf("Idle count: %d\n", idle_count - last_count);
00031       last_count = idle_count;
00032 #endif
00033       etimer_reset(&timer);
00034     }
00035   }
00036   PROCESS_END();
00037 }
00038 
00039 
00040 AUTOSTART_PROCESSES(&usb_masstest_process);