diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -10,7 +10,9 @@ LIBDIR:=libraries HAL_LIB:=$(LIBDIR)/STM32F0xx_HAL_Driver USB_LIB:=$(LIBDIR)/STM32_USB_Device_Library -STARTUP:=$(STMLIB)/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc +STARTUP:=$(LIBDIR)/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc + +SYSTEMDIR:=$(LIBDIR)/CMSIS/Device/ST/STM32F0xx/Source/Templates # Houses system_STM32f0xx.c LINKER_SCRIPT:=$(CURDIR)/stm32-flash.ld @@ -31,19 +33,18 @@ INCLUDE+=-I$(HAL_LIB)/Inc # vpath is used so object files are written to the current directory instead # of the same directory as their source files -vpath %.c $(HAL_LIB)/src \ - $(LIBDIR)/$(USB_LIB) \ - $(LIBDIR)/$(USB_LIB)/Class/CDC \ - $(LIBDIR)/$(USB_LIB)/Core +vpath %.c $(HAL_LIB)/Src \ + $(USB_LIB) \ + $(USB_LIB)/Class/CDC \ + $(USB_LIB)/Core \ + $(SYSTEMDIR) + vpath %.s $(STARTUP) -ASRC=startup_stm32f042x6.s +ASRC=$(STARTUP)/startup_stm32f042x6.s # Project Source Files SRC=main.c -SRC+=stm32f0xx_it.c -SRC+=stm32f0xx_hal_msp.c -SRC+=system_stm32f0xx.c SRC+=ssd1306.c SRC+=eeprom_min.c SRC+=gpio.c @@ -51,38 +52,36 @@ SRC+=spi.c SRC+=clock.c SRC+=stringhelpers.c -# Discovery Source Files -#SRC+=stm32f4_discovery_lis302dl.c -#SRC+=stm32f4_discovery.c -#SRC+=stm32f4_discovery_audio_codec.c +SRC+=stm32f0xx_it.c +SRC+=stm32f0xx_hal_msp.c + +SRC+=usb_device.c +SRC+=usbd_cdc_if.c +SRC+=usbd_conf.c +SRC+=usbd_desc.c # Standard Peripheral Source Files -SRC+=stm32f0xx_syscfg.c -SRC+=misc.c -SRC+=stm32f0xx_adc.c -SRC+=stm32f0xx_dac.c -SRC+=stm32f0xx_dma.c -SRC+=stm32f0xx_exti.c -SRC+=stm32f0xx_flash.c -SRC+=stm32f0xx_gpio.c -SRC+=stm32f0xx_i2c.c -SRC+=stm32f0xx_rcc.c -SRC+=stm32f0xx_spi.c -SRC+=stm32f0xx_tim.c +SRC+=system_stm32f0xx.c + +SRC+=stm32f0xx_hal.c +SRC+=stm32f0xx_hal_spi.c +SRC+=stm32f0xx_hal_pcd.c +SRC+=stm32f0xx_hal_pcd_ex.c +SRC+=stm32f0xx_hal_cortex.c +SRC+=stm32f0xx_hal_dma.c +SRC+=stm32f0xx_hal_flash.c +SRC+=stm32f0xx_hal_flash_ex.c +SRC+=stm32f0xx_hal_gpio.c +SRC+=stm32f0xx_hal_pwr.c +SRC+=stm32f0xx_hal_pwr_ex.c +SRC+=stm32f0xx_hal_rcc.c +SRC+=stm32f0xx_hal_rcc_ex.c # USB Source Files -SRC+=usb_core.c -SRC+=usb_init.c -SRC+=usb_int.c -SRC+=usb_mem.c -SRC+=usb_regs.c -SRC+=usb_sil.c -SRC+=hw_config.c -SRC+=usb_desc.c -SRC+=usb_endp.c -SRC+=usb_istr.c -SRC+=usb_prop.c -SRC+=usb_pwr.c +SRC+=usbd_cdc.c +SRC+=usbd_core.c +SRC+=usbd_ctlreq.c +SRC+=usbd_ioreq.c CDEFS=-DUSE_STDPERIPH_DRIVER CDEFS+=-DSTM32F0XX