diff --git a/Makefile b/Makefile index 67f58921..95c049e4 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ FIRMWARE_VERSION := $(VERSION_MAJOR).$(VERSION_MINOR) # Compiler options CFLAGS_BASE := -DUSE_MAKE -fsingle-precision-constant -fomit-frame-pointer -ffast-math -CFLAGS_BASE += -I$(MAIN_INC_DIR) -g3 -O3 -Wall -ffunction-sections +CFLAGS_BASE += -I$(MAIN_INC_DIR) -g3 -O2 -Wall -ffunction-sections CFLAGS_COMMON := $(CFLAGS_BASE) diff --git a/Mcu/e230/Inc/blutil.h b/Mcu/e230/Inc/blutil.h index 9af0d03d..fba23ac9 100644 --- a/Mcu/e230/Inc/blutil.h +++ b/Mcu/e230/Inc/blutil.h @@ -58,7 +58,7 @@ static inline void bl_timer_init(void) { rcu_periph_clock_enable(RCU_TIMER16); TIMER_CAR(BL_TIMER) = 0xFFFF; - TIMER_PSC(BL_TIMER) = 35; + TIMER_PSC(BL_TIMER) = 71; timer_auto_reload_shadow_enable(BL_TIMER); timer_enable(BL_TIMER); } @@ -124,3 +124,7 @@ static inline void jump_to_application(void) "bx %1 \n" : : "r"(stack_top), "r"(JumpAddress) :); } + +void SysTick_Handler(void) +{ +} diff --git a/Mcu/e230/Src/gd32e23x_it.c b/Mcu/e230/Src/gd32e23x_it.c index deb4615c..1a3fa780 100644 --- a/Mcu/e230/Src/gd32e23x_it.c +++ b/Mcu/e230/Src/gd32e23x_it.c @@ -1,3 +1,5 @@ +#pragma GCC optimize("Os") + extern void transfercomplete(); extern void PeriodElapsedCallback(); extern void interruptRoutine(); @@ -21,7 +23,9 @@ int interrupt_time = 0; #include "common.h" #include "main.h" #include "systick.h" +#ifndef BOOTLOADER #include "targets.h" +#endif /*! \brief this function handles NMI exception @@ -60,6 +64,7 @@ void SVC_Handler(void) { } */ void PendSV_Handler(void) { } +#ifndef BOOTLOADER /*! \brief this function handles SysTick exception \param[in] none @@ -151,3 +156,4 @@ void EXTI4_15_IRQHandler(void) processDshot(); } +#endif // BOOTLOADER diff --git a/e230makefile.mk b/e230makefile.mk index 6a267eee..ab997476 100644 --- a/e230makefile.mk +++ b/e230makefile.mk @@ -5,7 +5,7 @@ TARGETS_$(MCU) := $(call get_targets,$(MCU)) HAL_FOLDER_$(MCU) := $(HAL_FOLDER)/$(call lc,$(MCU)) -MCU_$(MCU) := -mfloat-abi=soft -mthumb -march=armv8-m.main +MCU_$(MCU) := -mfloat-abi=soft -mthumb -mcpu=cortex-m23 LDSCRIPT_$(MCU) := $(wildcard $(HAL_FOLDER_$(MCU))/*.ld) SRC_BASE_DIR_$(MCU) := \ @@ -32,4 +32,4 @@ SRC_$(MCU) := $(foreach dir,$(SRC_DIR_$(MCU)),$(wildcard $(dir)/*.[cs])) SRC_$(MCU)_BL := $(foreach dir,$(SRC_BASE_DIR_$(MCU)),$(wildcard $(dir)/*.[cs])) \ $(HAL_FOLDER_$(MCU))/Src/eeprom.c \ $(HAL_FOLDER_$(MCU))/Src/system_gd32e23x.c \ - $(wildcard $(HAL_FOLDER_$(MCU))/*_it.c) + $(wildcard $(HAL_FOLDER_$(MCU))/Src/*_it.c)