PROJECT = spinplate
BUILDDIR = build
UINCDIR += src

USE_OPT += -O1 -g -gdwarf-2 -g3 \
	-fno-omit-frame-pointer -fno-common -std=gnu99

# Base system & bootup
PROJECT_CSRC += src/main.c src/board.c src/debug.c

# USB shell
PROJECT_CSRC += src/shell_commands.c src/usb_usart.c

# Motor control
PROJECT_CSRC += src/motor.c

# Fixed point math libraries
PROJECT_CSRC += libfixmath/fix16.c libfixmath/fix16_sqrt.c libfixmath/fix16_trig.c
UDEFS += -DFIXMATH_NO_CACHE
UINCDIR += libfixmath

UADEFS =
ULIBDIR =

include Makefile.chibios
	
deploy: all
	st-flash write /dev/stlinkv1_3 $(BUILDDIR)/$(PROJECT).bin 0x08000000
