Test application for USB mass storage
This commit is contained in:
parent
f2e4500f88
commit
88669e1675
2 changed files with 61 additions and 0 deletions
21
platform/stepper-robot/usb-msc/Makefile
Normal file
21
platform/stepper-robot/usb-msc/Makefile
Normal file
|
@ -0,0 +1,21 @@
|
|||
TARGET=stepper-robot
|
||||
|
||||
all: usbmsctst
|
||||
|
||||
|
||||
CONTIKI=../../..
|
||||
|
||||
CONTIKI_TARGET_MAIN=usb-main.c
|
||||
|
||||
PROJECT_SOURCEFILES =
|
||||
|
||||
USB_MASS_STORAGE_CLASS=1
|
||||
|
||||
|
||||
clean: stepper_robot_clean
|
||||
|
||||
.PHONY: stepper_robot_clean
|
||||
|
||||
stepper_robot_clean:
|
||||
|
||||
include $(CONTIKI)/Makefile.include
|
40
platform/stepper-robot/usb-msc/usbmsctst.c
Normal file
40
platform/stepper-robot/usb-msc/usbmsctst.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/process.h>
|
||||
#include <sys/autostart.h>
|
||||
#include <sys/etimer.h>
|
||||
#include <usb-api.h>
|
||||
#include <msc/usb-msc-bulk.h>
|
||||
|
||||
PROCESS(usb_masstest_process, "USB massstorage test process");
|
||||
|
||||
#if 0
|
||||
extern unsigned int idle_count;
|
||||
#endif
|
||||
|
||||
PROCESS_THREAD(usb_masstest_process, ev , data)
|
||||
{
|
||||
static unsigned int last_count;
|
||||
PROCESS_BEGIN();
|
||||
static struct etimer timer;
|
||||
usb_msc_bulk_setup();
|
||||
etimer_set(&timer, CLOCK_SECOND);
|
||||
#if 0
|
||||
last_count = idle_count;
|
||||
#endif
|
||||
while(1) {
|
||||
PROCESS_WAIT_EVENT();
|
||||
if (ev == PROCESS_EVENT_TIMER) {
|
||||
#if 0
|
||||
printf("Idle count: %d\n", idle_count - last_count);
|
||||
last_count = idle_count;
|
||||
#endif
|
||||
etimer_reset(&timer);
|
||||
}
|
||||
}
|
||||
PROCESS_END();
|
||||
}
|
||||
|
||||
|
||||
AUTOSTART_PROCESSES(&usb_masstest_process);
|
Loading…
Reference in a new issue