mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-08-31 11:29:33 +00:00
cc253x: Add USB support to the compilation scripts
See Pull Request #18
This commit is contained in:
parent
d93fee612d
commit
ba96408f37
@ -109,6 +109,10 @@ CONTIKI_SOURCEFILES += watchdog.c rtimer-arch.c
|
|||||||
CONTIKI_SOURCEFILES += p2-intr.c
|
CONTIKI_SOURCEFILES += p2-intr.c
|
||||||
CONTIKI_ASMFILES +=
|
CONTIKI_ASMFILES +=
|
||||||
|
|
||||||
|
include $(CONTIKI_CPU)/usb/Makefile.usb
|
||||||
|
|
||||||
|
CONTIKI_SOURCEFILES += $(USB_SOURCEFILES)
|
||||||
|
|
||||||
CONTIKI_ASMOBJECTFILES = $(addprefix $(OBJECTDIR)/,$(CONTIKI_ASMFILES:.S=.rel))
|
CONTIKI_ASMOBJECTFILES = $(addprefix $(OBJECTDIR)/,$(CONTIKI_ASMFILES:.S=.rel))
|
||||||
|
|
||||||
CONTIKI_CASMOBJECTFILES = $(addprefix $(OBJECTDIR)/, \
|
CONTIKI_CASMOBJECTFILES = $(addprefix $(OBJECTDIR)/, \
|
||||||
|
@ -1,60 +1,3 @@
|
|||||||
### Put generated sources in a separate directory
|
USB_SOURCEFILES = usb-arch.c usb-core.c cdc-acm.c cdc-acm-descriptors.c
|
||||||
BUILTSRCDIR = src_$(TARGET)
|
CONTIKI_CPU_DIRS += usb usb/common usb/common/cdc-acm
|
||||||
ifeq (${wildcard $(BUILTSRCDIR)},)
|
|
||||||
DUMMY := ${shell mkdir $(BUILTSRCDIR)}
|
|
||||||
endif
|
|
||||||
|
|
||||||
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
|
|
@ -65,6 +65,18 @@
|
|||||||
* 2: P1_1 (Green - active: low)
|
* 2: P1_1 (Green - active: low)
|
||||||
*/
|
*/
|
||||||
#if MODEL_CC2531
|
#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
|
#undef LEDS_CONF_ALL
|
||||||
#define LEDS_CONF_ALL 3
|
#define LEDS_CONF_ALL 3
|
||||||
#define LEDS_RED 1
|
#define LEDS_RED 1
|
||||||
|
Loading…
Reference in New Issue
Block a user