Add USBSERIAL=YES to avoid the need for editing projectconfig.h

also make "make APP=<foo>" build <foo>.bin so you don't overwrite your
firmware.bin :)
This commit is contained in:
Stefan `Sec` Zehl 2012-01-02 23:54:46 +01:00
parent f242c667ab
commit 36fa18875f
3 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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 =

View File

@ -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