diff --git a/.gitignore b/.gitignore index 0da1373..b1bb22d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Debug *.user *.user.* *.lss +*.d diff --git a/Makefile b/Makefile index 7331fc1..9750d44 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,11 @@ DEFINES = -DSTM32F407xx -DSTM32F4XX -DARM_MATH_CM4 mapfile = dafuqishappening ##Custom Files### +ifneq ($(VERBOSE),true) +QUIET=@ +else +QUIET= +endif CFILES += fatfs/option/syscall.c fatfs/option/ccsbcs.c fatfs/diskio.c fatfs/ff.c fatfs/shimatta_sdio_driver/shimatta_sdio.c @@ -35,8 +40,8 @@ CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles -Wall -O0 -g3 #################################################################################### -OBJ = $(CFILES:%.c=%.c.o) -ASOBJ = $(ASFILES:%.S=%.S.o) +OBJ = $(CFILES:%.c=%.o) +ASOBJ = $(ASFILES:%.S=%.o) default: $(target).elf @@ -44,35 +49,40 @@ default: $(target).elf %.bin: %.elf - $(OBJCOPY) -O binary $^ $@ + $(QUIET)$(OBJCOPY) -O binary $^ $@ %.hex: %.elf - $(OBJCOPY) -O ihex $^ $@ + $(QUIET)$(OBJCOPY) -O ihex $^ $@ #Linking $(target).elf: $(OBJ) $(ASOBJ) - $(CC) $(LFLAGS) $(LIBRARYPATH) -o $@ $^ $(LIBRARIES) - $(SIZE) $@ + @echo !!! Calling linker $@ + $(QUIET)$(CC) $(LFLAGS) $(LIBRARYPATH) -o $@ $^ $(LIBRARIES) + $(QUIET)$(SIZE) $@ + #Compiling -%.c.o: %.c - $(CC) $(CFLAGS) $(INCLUDEPATH) $(DEFINES) -o $@ $< +$(OBJ): + @echo !!! Calling Compiler $@ + $(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:%.o=%.c) -%.S.o: %.S - $(CC) $(CFLAGS) $(INCLUDEPATH) $(DEFINES) -o $@ $< +$(ASOBJ): + @echo !!! Calling Assembler $@ + $(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:%.o=%.S) .PHONY: qtproject clean mrproper objcopy disassemble disassemble: $(target).elf - $(OBJDUMP) -D -s $< > $(target).lss + $(QUIET)$(OBJDUMP) -D -s $< > $(target).lss objcopy: $(target).bin $(target).hex mrproper: - rm -f $(target).pro + $(QUIET)rm -f $(target).pro clean: - rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss + @echo cleaning up + $(QUIET)rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss $(CFILES:%.c=%.d) $(ASFILES:%.S=%.d) qtproject: echo -e "TEMPLATE = app\nCONFIG -= console app_bundle qt" > $(target).pro echo -e "SOURCES += $(CFILES) $(ASFILES)" >> $(target).pro @@ -83,4 +93,5 @@ qtproject: echo -ne "\nDEFINES += " >> $(target).pro echo "$(DEFINES)" | sed "s/-D//g" >> $(target).pro +-include $(CFILES:%.c=%.d) $(ASFILES:%.S=%.d) diff --git a/include/startup/system_stm32f4xx.h b/include/startup/system_stm32f4xx.h index 7b29850..ef767b4 100644 --- a/include/startup/system_stm32f4xx.h +++ b/include/startup/system_stm32f4xx.h @@ -97,3 +97,4 @@ extern void SystemCoreClockUpdate(void); * @} */ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ + diff --git a/include/uart/uart.h b/include/uart/uart.h index 1a57902..d59a5e8 100644 --- a/include/uart/uart.h +++ b/include/uart/uart.h @@ -11,7 +11,5 @@ void initUART(); void sendChar(char c); void sendString(char* s, int count); -#ifdef _P20N_ -void yuri(); -#endif + #endif /* UART_UART_H_ */ diff --git a/main.c b/main.c index 1dd1a7f..a13053e 100644 --- a/main.c +++ b/main.c @@ -61,8 +61,6 @@ while(1); } - - void HardFault_Handler(uint32_t *stack) { // unsigned int stacked_r0; // unsigned int stacked_r1;