V6版本中,动态校变化范围,5%改成10%

This commit is contained in:
wyf 2024-11-19 15:37:47 +08:00
parent 963a6b3595
commit 808a29c261
6 changed files with 1676 additions and 3 deletions

View File

@ -100,7 +100,7 @@ void user_main()
if(cnt>24) //每2分钟动态校准一次
{
cnt =0;
if(abs(last_voltage-dev_reg.voltage)*(uint32_t)100/abs(last_voltage)<=5)
if(abs(last_voltage-dev_reg.voltage)*(uint32_t)100/abs(last_voltage)<=10)
{
dev_reg.reference = 110.0*dev_reg.adc_max/last_voltage;
dev_reg.voltage = 110.0*dev_reg.adc_max/abs(dev_reg.reference);

View File

@ -23,6 +23,8 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.76239748" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.292905779" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32G070KBTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32G0xx_HAL_Driver/Inc | ../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32G0xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32G070xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32G070KBTX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.302939781" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="64" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.899209994" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex" value="true" valueType="boolean"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.convertbinary.1361145163" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.convertbinary" value="true" valueType="boolean"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.2094397201" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/BootLoader}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.397029338" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1492570727" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -53,6 +53,12 @@ default.size.stdout \
OBJDUMP_LIST += \
BootLoader.list \
OBJCOPY_HEX += \
BootLoader.hex \
OBJCOPY_BIN += \
BootLoader.bin \
# All Target
all: main-build
@ -76,12 +82,22 @@ BootLoader.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
@echo 'Finished building: $@'
@echo ' '
BootLoader.hex: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
arm-none-eabi-objcopy -O ihex $(EXECUTABLES) "BootLoader.hex"
@echo 'Finished building: $@'
@echo ' '
BootLoader.bin: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
arm-none-eabi-objcopy -O binary $(EXECUTABLES) "BootLoader.bin"
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) BootLoader.elf BootLoader.list BootLoader.map default.size.stdout
-$(RM) BootLoader.bin BootLoader.elf BootLoader.hex BootLoader.list BootLoader.map default.size.stdout
-@echo ' '
secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST)
secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST) $(OBJCOPY_HEX) $(OBJCOPY_BIN)
fail-specified-linker-script-missing:
@echo 'Error: Cannot find the specified linker script. Check the linker settings in the build configuration.'

View File

@ -10,6 +10,7 @@ C_SRCS :=
S_UPPER_SRCS :=
O_SRCS :=
CYCLO_FILES :=
OBJCOPY_HEX :=
SIZE_OUTPUT :=
OBJDUMP_LIST :=
SU_FILES :=
@ -19,6 +20,7 @@ MAP_FILES :=
S_DEPS :=
S_UPPER_DEPS :=
C_DEPS :=
OBJCOPY_BIN :=
# Every subdirectory with source files must be described here
SUBDIRS := \