From 36fa18875f5e900933855e6e625506542f5cc79e Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Mon, 2 Jan 2012 23:54:46 +0100 Subject: [PATCH] Add USBSERIAL=YES to avoid the need for editing projectconfig.h also make "make APP=" build .bin so you don't overwrite your firmware.bin :) --- firmware/Makefile | 4 ++++ firmware/Makefile.inc | 3 +++ firmware/core/projectconfig.h | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/firmware/Makefile b/firmware/Makefile index bba9bfb..4363a75 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -33,6 +33,10 @@ INCLUDE_PATHS = -I$(ROOT_PATH) -I$(ROOT_PATH)/core include $(ROOT_PATH)/Makefile.inc +ifdef APP +OUTFILE=$(APP) +endif + LDFLAGS+= -Wl,--gc-sections OBJS += lpc1xxx/$(TARGET)_handlers.o lpc1xxx/LPC1xxx_startup.o diff --git a/firmware/Makefile.inc b/firmware/Makefile.inc index a0d7fa9..3cf227d 100644 --- a/firmware/Makefile.inc +++ b/firmware/Makefile.inc @@ -45,6 +45,9 @@ CPU_TYPE = cortex-$(CORTEX_TYPE) CFLAGS = -std=c99 -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -DRAMCODE=$(RAMCODE) -fno-builtin -Wno-unused-function LDFLAGS = -nostartfiles +ifeq "$(USBSERIAL)" "YES" +CFLAGS += -DUSBSERIAL +endif CONFIG_MAKE_PRINTDIRECTORY = --no-print-directory CONFIG_GCC_SHOWCOLUMN = diff --git a/firmware/core/projectconfig.h b/firmware/core/projectconfig.h index 41d5420..fae993c 100644 --- a/firmware/core/projectconfig.h +++ b/firmware/core/projectconfig.h @@ -1,3 +1,6 @@ +#ifndef __PROJECTCONFIG_H_ +#define __PROJECTCONFIG_H_ + #include "lpc134x.h" #include "sysdefs.h" @@ -88,3 +91,12 @@ #define CFG_UART_BAUDRATE (115200) #define CFG_UART_BUFSIZE (512) #endif + +#ifdef USBSERIAL +#undef CFG_USBCDC +#undef CFG_USBMSC +#define CFG_USBCDC (1) +#define CFG_USBMSC (0) +#endif + +#endif