# For USB HID support the LPC134x reserves 384 bytes from the sram,\r
# if you don't want to use the USB features, just use 0 here.\r
SRAM_USB = 384\r
+#SRAM_USB = 0\r
\r
##########################################################################\r
# Debug settings\r
# IDE Flags (Keeps various IDEs happy)\r
##########################################################################\r
\r
-OPTDEFINES = -D __NEWLIB__\r
-\r
+#OPTDEFINES = -D __NEWLIB__ -DR0KET\r
+OPTDEFINES = -D __NEWLIB__ -DHOB_REV2\r
##########################################################################\r
# Project-specific files \r
##########################################################################\r
\r
SRCS = \\r
+ badge/fahrplan.c \\r
+ badge/init.c \\r
badge/main.c \\r
badge/jumpnrun/collision.c \\r
badge/jumpnrun/enemies.c \\r
+ badge/jumpnrun/game_state.c \\r
badge/jumpnrun/items.c \\r
badge/jumpnrun/jumpnrun.c \\r
badge/jumpnrun/level_load.c \\r
+ badge/jumpnrun/player.c \\r
+ badge/jumpnrun/render.c \\r
+ badge/jumpnrun/shots.c \\r
+ badge/jumpnrun/starter.c \\r
+ badge/jumpnrun/stats.c \\r
badge/jumpnrun/tiles.c \\r
+ badge/ui/browser.c \\r
badge/ui/display.c \\r
badge/ui/event.c \\r
- badge/ui/sprite.c\r
+ badge/ui/font.c \\r
+ badge/ui/menu.c \\r
+ badge/ui/sprite.c \\r
+ badge/ui/vanity.c\r
\r
SRCS += \\r
- dataflash/at45db041d.c \\r
dataflash/iobase.c \\r
- dataflash/diskio.c\r
+ dataflash/diskio.c \\r
+ dataflash/at45db041d.c\r
+\r
+SRCS += \\r
+ funk/nrf24l01p.c\r
\r
SRCS += \\r
project/commands.c\r
core/cmd/cmd.c \\r
core/cpu/cpu.c \\r
core/gpio/gpio.c \\r
- core/i2c/i2c.c \\r
core/iap/iap.c \\r
core/libc/stdio.c \\r
core/libc/string.c \\r
core/systick/systick.c \\r
core/timer16/timer16.c \\r
core/timer32/timer32.c \\r
- core/uart/uart_buf.c \\r
- core/uart/uart.c \\r
core/usbcdc/cdc_buf.c \\r
core/usbcdc/cdcuser.c \\r
core/usbcdc/usbcore.c \\r
core/usbhid-rom/usbmsc.c \\r
core/wdt/wdt.c\r
\r
+# core/i2c/i2c.c\r
+# core/uart/uart_buf.c\r
+# core/uart/uart.c\r
+\r
##########################################################################\r
# GNU GCC compiler prefix and location\r
##########################################################################\r
OBJCOPY = $(CROSS_COMPILE)objcopy\r
OBJDUMP = $(CROSS_COMPILE)objdump\r
OUTFILE = firmware\r
+\r
+CC_FOR_BUILD = gcc\r
LPCRC = ./lpcrc\r
\r
##########################################################################\r
dep: $(DEPS)\r
\r
$(DEPS) : %.dep : %.c\r
- $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(<:%.c=%.o) -MF $@\r
+ $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@\r
\r
sinclude $(DEPS)\r
\r
$(OUTFILE).elf: $(OBJS) $(LD_TEMP)\r
$(LD) $(LDFLAGS) -T $(LD_TEMP) -o $(OUTFILE).elf $(OBJS) $(LDLIBS)\r
\r
-$(OUTFILE).bin: $(OUTFILE).elf\r
+$(OUTFILE).bin: $(OUTFILE).elf $(LPCRC)\r
$(OBJCOPY) $(OCFLAGS) -O binary $(OUTFILE).elf $(OUTFILE).bin\r
$(LPCRC) $(OUTFILE).bin\r
\r
rm -f $(OBJS) $(LD_TEMP) $(OUTFILE).elf $(OUTFILE).bin $(OUTFILE).hex\r
\r
distclean: clean\r
- rm -f $(DEPS)\r
+ rm -f $(DEPS) $(LPCRC)\r
\r
.PHONY: all dep size clean distclean\r
+\r
+CFLAGS_FOR_BUILD = -Wall -Wextra -std=c99 -O0 -g\r
+\r
+LPCRC_SRCS = tools/lpcrc/lpcrc.c\r
+LPCRC_OBJS = $(LPCRC_SRCS:%.c=%.o)\r
+LPCRC_DEPS = $(LPCRC_SRCS:%.c=%.dep)\r
+\r
+$(LPCRC_DEPS) : %.dep : %.c\r
+ $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@\r
+\r
+$(LPCRC_OBJS): %.o : %.c\r
+ $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ -c $<\r
+\r
+$(LPCRC): $(LPCRC_OBJS)\r
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $+ $(LDLIBS_FOR_BUILD)\r