cc253x: Add USB support to the compilation scripts

See Pull Request #18
This commit is contained in:
Philippe Rétornaz 2012-08-07 15:19:40 +02:00 committed by George Oikonomou
parent d93fee612d
commit ba96408f37
3 changed files with 18 additions and 59 deletions

View file

@ -109,6 +109,10 @@ CONTIKI_SOURCEFILES += watchdog.c rtimer-arch.c
CONTIKI_SOURCEFILES += p2-intr.c
CONTIKI_ASMFILES +=
include $(CONTIKI_CPU)/usb/Makefile.usb
CONTIKI_SOURCEFILES += $(USB_SOURCEFILES)
CONTIKI_ASMOBJECTFILES = $(addprefix $(OBJECTDIR)/,$(CONTIKI_ASMFILES:.S=.rel))
CONTIKI_CASMOBJECTFILES = $(addprefix $(OBJECTDIR)/, \

View file

@ -1,60 +1,3 @@
### Put generated sources in a separate directory
BUILTSRCDIR = src_$(TARGET)
ifeq (${wildcard $(BUILTSRCDIR)},)
DUMMY := ${shell mkdir $(BUILTSRCDIR)}
endif
USB_SOURCEFILES = usb-arch.c usb-core.c cdc-acm.c cdc-acm-descriptors.c
CONTIKI_CPU_DIRS += usb usb/common usb/common/cdc-acm
STRUCTGEN = structgen
PROJECTDIRS += $(BUILTSRCDIR)
USB_STRING_DESCRIPTORS ?= $(CONTIKI_CPU_ARM)/common/usb/cdc-acm/string-descriptors.xml
XMLDIRS=
USB = usb-arch.c usb-core.c
ifdef USB_CDC_ACM_CLASS
CONTIKI_CPU_DIRS += ../common/usb/cdc-acm
USB += cdc-acm.c cdc-acm-descriptors.c cdc-acm-string-descriptors.c
XMLDIRS += $(CONTIKI_CPU_ARM)/common/usb/cdc-acm/
endif
ifdef USB_CDC_ETH_CLASS
CONTIKI_CPU_DIRS += ../common/usb/cdc-eth
USB += cdc-eth.c cdc-eth-descriptors.c cdc-eth-string-descriptors.c dhcps.c
XMLDIRS += $(CONTIKI_CPU_ARM)/common/usb/cdc-eth/
endif
ifdef USB_MASS_STORAGE_CLASS
CONTIKI_CPU_DIRS += ../common/usb/msc
USB += usb-msc-bulk.c usb-rbc.c msc-descriptors-consts.c msc-descriptors.c
XMLDIRS += $(CONTIKI_CPU_ARM)/common/usb/msc
endif
ifdef USB_MSC_QIC157
CONTIKI_CPU_DIRS += ../common/usb/msc
USB += usb-msc-bulk.c usb-qic157.c msc-qic157-descriptors.c msc-qic157-string-descriptors.c
XMLDIRS += $(CONTIKI_CPU_ARM)/common/usb/msc
endif
ifdef USB_MSC_STREAMING
CONTIKI_CPU_DIRS += ../common/usb/msc
USB += usb-msc-bulk.c usb-streaming.c msc-scsi-streaming-descriptors-consts.c msc-scsi-streaming-descriptors.c
XMLDIRS += $(CONTIKI_CPU_ARM)/common/usb/msc
endif
ifdef USB_MTP_CLASS
CONTIKI_CPU_DIRS += ../common/usb/mtp
USB += usb-mtp.c mtp-descriptors-consts.c mtp-descriptors.c
STRUCTGENDIRS += $(CONTIKI_CPU_ARM)/common/usb/mtp
endif
vpath %.xml $(XMLDIRS)
vpath %.gen.c $(STRUCTGENDIRS)
%.c: %.xml
$(XSLTPROC) $(CONTIKI_CPU_ARM)/common/usb/string-descriptors.xslt $^ >$(BUILTSRCDIR)/$@
%-consts.c: %.gen.c
$(CPP) -I$(CFLAGS) $< | $(STRUCTGEN) --output $(BUILTSRCDIR)/$*-consts.c

View file

@ -65,6 +65,18 @@
* 2: P1_1 (Green - active: low)
*/
#if MODEL_CC2531
#define USB_CONF_ENABLE 1
#ifndef USB_CONF_CLASS
#define DMA_CONF_ON 1
#define DMA_USB_CHANNEL 0
#define CTRL_EP_SIZE 8
#define USB_EP1_SIZE 32
#define USB_EP2_SIZE 64
#define USB_EP3_SIZE 64
#define USB_CONF_CLASS 1 /* CDC-ACM */
#endif
#undef LEDS_CONF_ALL
#define LEDS_CONF_ALL 3
#define LEDS_RED 1