From 4443235b6aa162b74c8186e51cd653cf9d912dbf Mon Sep 17 00:00:00 2001 From: shentou Date: Sun, 7 Dec 2025 14:35:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=8A=9F=E7=8E=87=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .clangd | 2 + .gitattributes | 1 + .gitignore | 4 +- .mxproject | 54 ++++++------ CMakeLists.txt | 7 +- Core/Inc/FreeRTOSConfig.h | 2 +- User/component/PowerControl.c | 88 +++++++++++++++++++ User/component/PowerControl.h | 30 +++++++ User/device/supercap.c | 158 ++++++++++++++++++++++++++++++++++ User/device/supercap.h | 102 ++++++++++++++++++++++ User/module/chassis.c | 21 ++++- User/module/chassis.h | 9 +- User/module/config.c | 22 ++++- User/module/config.h | 3 + User/task/blink.c | 2 +- User/task/cmd.c | 2 +- User/task/config.yaml | 7 ++ User/task/ctrl_chassis.c | 11 ++- User/task/init.c | 3 +- User/task/rc.c | 4 +- User/task/supercap.c | 50 +++++++++++ User/task/user_task.c | 11 ++- User/task/user_task.h | 12 ++- hero.ioc | 2 +- 24 files changed, 555 insertions(+), 52 deletions(-) create mode 100644 .gitattributes create mode 100644 User/component/PowerControl.c create mode 100644 User/component/PowerControl.h create mode 100644 User/device/supercap.c create mode 100644 User/device/supercap.h create mode 100644 User/task/supercap.c diff --git a/.clangd b/.clangd index 50c62c4..cfc956a 100644 --- a/.clangd +++ b/.clangd @@ -2,6 +2,7 @@ CompileFlags: Add: - '-ferror-limit=0' - '-Wno-implicit-int' + - "-I/usr/lib/arm-none-eabi/include" CompilationDatabase: build/Debug Diagnostics: Suppress: @@ -9,3 +10,4 @@ Diagnostics: - unknown_typename - unknown_typename_suggest - typename_requires_specqual + diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore index 185b49a..dfb2075 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build mx.scratch -!.settings \ No newline at end of file +!.settings +.cache +compile_commands.json diff --git a/.mxproject b/.mxproject index 5572968..677d854 100644 --- a/.mxproject +++ b/.mxproject @@ -1,5 +1,5 @@ [PreviousLibFiles] -LibFiles=Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\freertos_mpool.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\freertos_os2.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\freertos_mpool.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\freertos_os2.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f407xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Drivers\CMSIS\Include\cachel1_armv7.h;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_armclang_ltm.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv81mml.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm35p.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm55.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_cm85.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\core_starmc1.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\pac_armv81.h;Drivers\CMSIS\Include\pmu_armv8.h;Drivers\CMSIS\Include\tz_context.h; +LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/message_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/stack_macros.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/include/atomic.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/freertos_mpool.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/freertos_os2.h;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Middlewares/Third_Party/FreeRTOS/Source/croutine.c;Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;Middlewares/Third_Party/FreeRTOS/Source/list.c;Middlewares/Third_Party/FreeRTOS/Source/queue.c;Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/message_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/stack_macros.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/include/atomic.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/freertos_mpool.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/freertos_os2.h;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm85.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm55.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_starmc1.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_armv81mml.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_armclang_ltm.h;Drivers/CMSIS/Include/core_cm35p.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/cachel1_armv7.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/pmu_armv8.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/pac_armv81.h; [PreviousUsedKeilFiles] SourceFiles=..\Core\Src\main.c;..\Core\Src\gpio.c;..\Core\Src\freertos.c;..\Core\Src\can.c;..\Core\Src\dma.c;..\Core\Src\i2c.c;..\Core\Src\spi.c;..\Core\Src\tim.c;..\Core\Src\usart.c;..\Core\Src\stm32f4xx_it.c;..\Core\Src\stm32f4xx_hal_msp.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;..\Middlewares\Third_Party\FreeRTOS\Source\croutine.c;..\Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;..\Middlewares\Third_Party\FreeRTOS\Source\list.c;..\Middlewares\Third_Party\FreeRTOS\Source\queue.c;..\Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;..\Middlewares\Third_Party\FreeRTOS\Source\tasks.c;..\Middlewares\Third_Party\FreeRTOS\Source\timers.c;..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.c;..\Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM4F\port.c;..\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;..\Core\Src\system_stm32f4xx.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;..\Middlewares\Third_Party\FreeRTOS\Source\croutine.c;..\Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;..\Middlewares\Third_Party\FreeRTOS\Source\list.c;..\Middlewares\Third_Party\FreeRTOS\Source\queue.c;..\Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;..\Middlewares\Third_Party\FreeRTOS\Source\tasks.c;..\Middlewares\Third_Party\FreeRTOS\Source\timers.c;..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.c;..\Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM4F\port.c;..\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;..\Core\Src\system_stm32f4xx.c;;;..\Middlewares\Third_Party\FreeRTOS\Source\croutine.c;..\Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;..\Middlewares\Third_Party\FreeRTOS\Source\list.c;..\Middlewares\Third_Party\FreeRTOS\Source\queue.c;..\Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;..\Middlewares\Third_Party\FreeRTOS\Source\tasks.c;..\Middlewares\Third_Party\FreeRTOS\Source\timers.c;..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.c;..\Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM4F\port.c; @@ -7,40 +7,40 @@ HeaderPath=..\Drivers\STM32F4xx_HAL_Driver\Inc;..\Drivers\STM32F4xx_HAL_Driver\I CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER; [PreviousUsedCMakes] -SourceFiles=Core\Src\main.c;Core\Src\gpio.c;Core\Src\freertos.c;Core\Src\can.c;Core\Src\dma.c;Core\Src\i2c.c;Core\Src\spi.c;Core\Src\tim.c;Core\Src\usart.c;Core\Src\stm32f4xx_it.c;Core\Src\stm32f4xx_hal_msp.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\Src\system_stm32f4xx.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\Src\system_stm32f4xx.c;;;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c; -HeaderPath=Drivers\STM32F4xx_HAL_Driver\Inc;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;Middlewares\Third_Party\FreeRTOS\Source\include;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F;Drivers\CMSIS\Device\ST\STM32F4xx\Include;Drivers\CMSIS\Include;Core\Inc; +SourceFiles=Core/Src/main.c;Core/Src/gpio.c;Core/Src/freertos.c;Core/Src/can.c;Core/Src/dma.c;Core/Src/i2c.c;Core/Src/spi.c;Core/Src/tim.c;Core/Src/usart.c;Core/Src/stm32f4xx_it.c;Core/Src/stm32f4xx_hal_msp.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Middlewares/Third_Party/FreeRTOS/Source/croutine.c;Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;Middlewares/Third_Party/FreeRTOS/Source/list.c;Middlewares/Third_Party/FreeRTOS/Source/queue.c;Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Middlewares/Third_Party/FreeRTOS/Source/croutine.c;Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;Middlewares/Third_Party/FreeRTOS/Source/list.c;Middlewares/Third_Party/FreeRTOS/Source/queue.c;Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;;;Middlewares/Third_Party/FreeRTOS/Source/croutine.c;Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;Middlewares/Third_Party/FreeRTOS/Source/list.c;Middlewares/Third_Party/FreeRTOS/Source/queue.c;Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c; +HeaderPath=Drivers/STM32F4xx_HAL_Driver/Inc;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;Middlewares/Third_Party/FreeRTOS/Source/include;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F;Drivers/CMSIS/Device/ST/STM32F4xx/Include;Drivers/CMSIS/Include;Core/Inc; CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER; [PreviousGenFiles] AdvancedFolderStructure=true HeaderFileListSize=11 -HeaderFiles#0=..\Core\Inc\gpio.h -HeaderFiles#1=..\Core\Inc\FreeRTOSConfig.h -HeaderFiles#2=..\Core\Inc\can.h -HeaderFiles#3=..\Core\Inc\dma.h -HeaderFiles#4=..\Core\Inc\i2c.h -HeaderFiles#5=..\Core\Inc\spi.h -HeaderFiles#6=..\Core\Inc\tim.h -HeaderFiles#7=..\Core\Inc\usart.h -HeaderFiles#8=..\Core\Inc\stm32f4xx_it.h -HeaderFiles#9=..\Core\Inc\stm32f4xx_hal_conf.h -HeaderFiles#10=..\Core\Inc\main.h +HeaderFiles#0=../Core/Inc/gpio.h +HeaderFiles#1=../Core/Inc/FreeRTOSConfig.h +HeaderFiles#2=../Core/Inc/can.h +HeaderFiles#3=../Core/Inc/dma.h +HeaderFiles#4=../Core/Inc/i2c.h +HeaderFiles#5=../Core/Inc/spi.h +HeaderFiles#6=../Core/Inc/tim.h +HeaderFiles#7=../Core/Inc/usart.h +HeaderFiles#8=../Core/Inc/stm32f4xx_it.h +HeaderFiles#9=../Core/Inc/stm32f4xx_hal_conf.h +HeaderFiles#10=../Core/Inc/main.h HeaderFolderListSize=1 -HeaderPath#0=..\Core\Inc +HeaderPath#0=../Core/Inc HeaderFiles=; SourceFileListSize=11 -SourceFiles#0=..\Core\Src\gpio.c -SourceFiles#1=..\Core\Src\freertos.c -SourceFiles#2=..\Core\Src\can.c -SourceFiles#3=..\Core\Src\dma.c -SourceFiles#4=..\Core\Src\i2c.c -SourceFiles#5=..\Core\Src\spi.c -SourceFiles#6=..\Core\Src\tim.c -SourceFiles#7=..\Core\Src\usart.c -SourceFiles#8=..\Core\Src\stm32f4xx_it.c -SourceFiles#9=..\Core\Src\stm32f4xx_hal_msp.c -SourceFiles#10=..\Core\Src\main.c +SourceFiles#0=../Core/Src/gpio.c +SourceFiles#1=../Core/Src/freertos.c +SourceFiles#2=../Core/Src/can.c +SourceFiles#3=../Core/Src/dma.c +SourceFiles#4=../Core/Src/i2c.c +SourceFiles#5=../Core/Src/spi.c +SourceFiles#6=../Core/Src/tim.c +SourceFiles#7=../Core/Src/usart.c +SourceFiles#8=../Core/Src/stm32f4xx_it.c +SourceFiles#9=../Core/Src/stm32f4xx_hal_msp.c +SourceFiles#10=../Core/Src/main.c SourceFolderListSize=1 -SourcePath#0=..\Core\Src +SourcePath#0=../Core/Src SourceFiles=; diff --git a/CMakeLists.txt b/CMakeLists.txt index 3996107..47eb17c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_C_EXTENSIONS ON) # Define the build type if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Debug") + set(CMAKE_BUILD_TYPE "Debug") endif() # Set the project name @@ -63,15 +63,17 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE User/component/user_math.c User/component/crc16.c +/home/shentou/workspace/SuperCap/god-yuan-hero/User/component/PowerControl.c # User/device sources User/device/dr16.c - User/device/at9s_pro.c + User/device/AT9S_Pro.c User/device/bmi088.c User/device/motor.c User/device/motor_dm.c User/device/motor_rm.c User/device/vofa.c +/home/shentou/workspace/SuperCap/god-yuan-hero/User/device/supercap.c # User/module sources User/module/chassis.c User/module/config.c @@ -88,6 +90,7 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE User/task/init.c User/task/rc.c User/task/user_task.c +/home/shentou/workspace/SuperCap/god-yuan-hero/User/task/supercap.c ) # Add include paths diff --git a/Core/Inc/FreeRTOSConfig.h b/Core/Inc/FreeRTOSConfig.h index 8950ae3..2bb6640 100644 --- a/Core/Inc/FreeRTOSConfig.h +++ b/Core/Inc/FreeRTOSConfig.h @@ -69,7 +69,7 @@ #define configTICK_RATE_HZ ((TickType_t)1000) #define configMAX_PRIORITIES ( 56 ) #define configMINIMAL_STACK_SIZE ((uint16_t)128) -#define configTOTAL_HEAP_SIZE ((size_t)0x6000) +#define configTOTAL_HEAP_SIZE ((size_t)0x10000) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 diff --git a/User/component/PowerControl.c b/User/component/PowerControl.c new file mode 100644 index 0000000..d8d07bb --- /dev/null +++ b/User/component/PowerControl.c @@ -0,0 +1,88 @@ +#include "PowerControl.h" +#include "stdint.h" +#include "math.h" + + +void power_calu(power_model_t* param,float* in_array,float* rpm_array) +{ + float InitialGivePower[param->motor_num]; + float totalpower=0; + float in[4]; + float ve[4]; + for (uint8_t i = 0; i < param->motor_num; i++) // first get all the initial motor power and total motor power + { + in[i] = in_array[i]; + ve[i] = rpm_array[i]; + InitialGivePower[i] = in[i] * param->toque_coefficient * ve[i] + + param->k2 * ve[i] * ve[i]+ param->k1 * in[i]*in[i] + param->constant; + + param->power[i] = InitialGivePower[i]; + if (InitialGivePower[i] < 0) // negative power not included (transitory) + continue; + totalpower += InitialGivePower[i]; + } + param->total_power = totalpower; +} +float power_scale_calu(power_model_t** param_array,uint8_t num,float max_power) +{ + float total_power=0; + for(uint8_t i=0;itotal_power; + } + if(total_power>max_power) + {return max_power/total_power;} + else + {return 2;} +} + +void power_out_calu(power_model_t* param,float scale,float* in_array,float* rpm_array,float* out_array) +{ + float in[4]; + float ve[4]; + if(scale<1) + { + + float ScaledGivePower[4]; + for (uint8_t i = 0; i < param->motor_num; i++) + { + in[i] = in_array[i]; + ve[i] = rpm_array[i]; + ScaledGivePower[i] = param->power[i] * scale; // get scaled power + if (ScaledGivePower[i] < 0) + { + continue; + } + float b = param->toque_coefficient * ve[i]; + float c = param->k2 * ve[i]*ve[i] - ScaledGivePower[i] + param->constant; + float inside = b * b - 4 * param->k1 * c; + if (inside < 0) + { + continue; + } + else if (in[i] > 0) // Selection of the calculation formula according to the direction of the original moment + { + float temp = (-b + sqrt(inside)) / (2 * param->k1); + if (temp > 16000) + { + out_array[i] = 16000; + } + else + out_array[i] = temp; + } + else + { + float temp = (-b - sqrt(inside)) / (2 * param->k1); + if (temp < -16000) + { + out_array[i] = -16000; + } + else + out_array[i] = temp; + } + } + } +} + + + diff --git a/User/component/PowerControl.h b/User/component/PowerControl.h new file mode 100644 index 0000000..1c01262 --- /dev/null +++ b/User/component/PowerControl.h @@ -0,0 +1,30 @@ +#ifndef CHASSIS_POWER_CONTROL_WITH_SUPERCAP_H +#define CHASSIS_POWER_CONTROL_WITH_SUPERCAP_H + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "main.h" + +typedef struct power_model_t +{ + uint8_t motor_num; + float total_power; + float* power; + float toque_coefficient; + float k1; + float k2 ; + float constant; +}power_model_t; + +void power_calu(power_model_t* param,float* in_array,float* rpm_array); +float power_scale_calu(power_model_t** param_array,uint8_t num,float max_power); +void power_out_calu(power_model_t* param,float scale,float* in_array,float* rpm_array,float* out_array); +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/User/device/supercap.c b/User/device/supercap.c new file mode 100644 index 0000000..c09ff22 --- /dev/null +++ b/User/device/supercap.c @@ -0,0 +1,158 @@ +#include "device/supercap.h" + +/* 全局变量 */ +CAN_SuperCapRXDataTypeDef CAN_SuperCapRXData = {0}; + +uint8_t PowerOffset =0; + +uint32_t LastCapTick = 0; //上一次收到超电信号的时间戳 +uint32_t NowCapTick = 0; //现在收到超电信号的时间戳 + +uint32_t chassis_energy_in_gamming =0; + +/* 静态变量 - 用于CAN接收管理 */ +static bool supercap_inited = false; +static osMessageQueueId_t supercap_rx_queue = NULL; + +/** + * @brief 获取超级电容在线状态,1在线,0离线 + */ +uint8_t get_supercap_online_state(void){ + + NowCapTick = HAL_GetTick(); //更新时间戳 + + uint32_t DeltaCapTick = 0; + DeltaCapTick = NowCapTick - LastCapTick; //计算时间差 + +// if(get_game_progress() == 4){ +// //比赛开始的时候,开始统计消耗的能量 + + chassis_energy_in_gamming += CAN_SuperCapRXData.BatPower * DeltaCapTick *0.001f; + // 因为STM32的系统定时器是1ms的周期,所以*0.001,单位化为秒(S),能量单位才是焦耳(J) +// } + + if(DeltaCapTick > 1000){ + //如果时间差大于1s,说明超电信号丢失,返回超电离线的标志 + return 0; + }else { + //如果时间差小于1s,说明超电信号正常,返回超电在线的标志 + return 1; + } +} + +/** + * @brief 获取根据超级电容功率统计的底盘消耗能量,单位:焦耳(J) + */ +uint32_t get_chassis_energy_from_supercap(void){ + + return chassis_energy_in_gamming; + +} + +/******************超级电容数据从CAN传到结构体******************/ +int8_t SuperCap_Init(void) +{ + if (supercap_inited) { + return DEVICE_OK; // 已经初始化过 + } + + if (BSP_CAN_RegisterId( SUPERCAP_CAN , SUPERCAP_RX_ID, 3) != BSP_OK) { + return DEVICE_ERR; + } + + supercap_inited = true; + return DEVICE_OK; +} + +int8_t SuperCap_Update(void) +{ + if (!supercap_inited) { + return DEVICE_ERR; + } + + BSP_CAN_Message_t rx_msg; + + // 从CAN队列获取数据 + if (BSP_CAN_GetMessage( SUPERCAP_CAN , SUPERCAP_RX_ID, &rx_msg, BSP_CAN_TIMEOUT_IMMEDIATE) == BSP_OK) { + // 处理接收到的数据 + transfer_SuperCap_measure(rx_msg.data); + return DEVICE_OK; + } + + return DEVICE_ERR; // 没有新数据 +} + +void transfer_SuperCap_measure(uint8_t *data) +{ + LastCapTick = HAL_GetTick(); + CAN_SuperCapRXData.SuperCapReady = (SuperCap_Status_t)data[0]; + CAN_SuperCapRXData.SuperCapState = (SuperCap_Status_t)data[1]; + CAN_SuperCapRXData.SuperCapEnergy = data[2]; + CAN_SuperCapRXData.ChassisPower = data[3] << 1; //左移一位是为了扩大范围,超电发出来的的时候右移了一位 + CAN_SuperCapRXData.BatVoltage = data[4]; + CAN_SuperCapRXData.BatPower = data[5]; +} + +/** + * @brief 获取超级电容的运行状态,具体查看枚举SuperCapStateEnum + * @retval none + */ +SuperCapStateEnum get_supercap_state(void){ + return (SuperCapStateEnum)CAN_SuperCapRXData.SuperCapState; +} + +/** + * @brief 获取超级电容读到的电池电压,单位伏(V) + * @retval none + */ +float get_battery_voltage_from_supercap(void){ + return (float)CAN_SuperCapRXData.BatVoltage * 0.1f; +} + +/** + * @brief 获取超级电容可用能量,范围:0-100% + * @retval none + */ +uint8_t get_supercap_energy(void){ + return CAN_SuperCapRXData.SuperCapEnergy; +} + +/** + * @brief 设置超级电容功率补偿 + * @retval none + */ +void set_supercap_power_offset(uint8_t offset){ + PowerOffset = offset; +} + +/** + * @brief 发送超级电容数据 + * @param[in] Enable: 超级电容使能 + * @param[in] Charge: 超级电容充电,在PLUS版本中无效 + * @param[in] PowerLimit: 裁判系统功率限制 + * @param[in] Chargepower: 超级电容充电功率,在PLUS版本中无效 + * @retval none + */ +int8_t CAN_TX_SuperCapData(CAN_SuperCapTXDataTypeDef * TX_Temp) +{ + if (TX_Temp == NULL) return DEVICE_ERR_NULL; + + BSP_CAN_StdDataFrame_t tx_frame; + + tx_frame.id = SUPERCAP_TX_ID; + tx_frame.dlc = 0x08; + + tx_frame.data[0] = TX_Temp-> Enable; + tx_frame.data[1] = TX_Temp-> Charge;//PLUS disabled + tx_frame.data[2] = TX_Temp-> Powerlimit - PowerOffset; + tx_frame.data[3] = TX_Temp-> ChargePower;//PLUS disabled + + tx_frame.data[4] = 0; + tx_frame.data[5] = 0; + tx_frame.data[6] = 0; + tx_frame.data[7] = 0; + + return BSP_CAN_TransmitStdDataFrame( SUPERCAP_CAN , &tx_frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; +} + + diff --git a/User/device/supercap.h b/User/device/supercap.h new file mode 100644 index 0000000..94c1417 --- /dev/null +++ b/User/device/supercap.h @@ -0,0 +1,102 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "bsp/can.h" +#include "device/device.h" +//#include "referee.h" + +#define SUPERCAP_CAN BSP_CAN_1 +//#define SUPERCAP_CAN BSP_CAN_2 + +#define SUPERCAP_TX_ID 0x001 //C板发给超级电容的ID +#define SUPERCAP_RX_ID 0x100 //超级电容发给C板的ID + + +//超级电容的状态标志位,超级电容运行或者保护的具体状态反馈 +typedef enum +{ + DISCHARGE =0 , //放电状态 + CHARGE =1, //充电状态 + WAIT =2, //待机状态 + SOFTSTART_PROTECTION =3,//处于软起动状态 + OVER_LOAD_PROTECTION = 4, //超电过载保护状态 + BAT_OVER_VOLTAGE_PROTECTION =5, //过压保护状态 + BAT_UNDER_VOLTAGE_PROTECTION =6, //电池欠压保护,电池要没电了,换电池 + CAP_UNDER_VOLTAGE_PROTECTION =7, //超级电容欠压保护,超级电容用完电了,要充一会才能用 + OVER_TEMPERATURE_PROTECTION =8, //过温保护,太热了 + BOOM = 9, //超电爆炸了 +}SuperCapStateEnum; + +//超级电容准备状态,用于判断超级电容是否可以使用 +typedef enum +{ + SUPERCAP_STATUS_OFFLINE =0 , + SUPERCAP_STATUS_RUNNING =1, +}SuperCap_Status_t; + +// 发送给超级电容的数据 +typedef struct { + FunctionalState Enable ; //超级电容使能。1使能,0失能 + SuperCapStateEnum Charge ; //V1.1超级电容充电。1充电,0放电,在PLUS版本中,此标志位无效,超电的充放电是自动的 + uint8_t Powerlimit; //裁判系统功率限制 + uint8_t ChargePower; //V1.1超级电容充电功率,在PLUS版本中,此参数,超电的充电功率随着底盘功率变化 +}CAN_SuperCapTXDataTypeDef; + +// 从超级电容接收到的数据 +typedef struct { + uint8_t SuperCapEnergy;//超级电容可用能量:0-100% + uint16_t ChassisPower; //底盘功率,0-512,由于传输的时候为了扩大量程右移了一位,所以接收的时候需要左移还原(丢精度)。 + SuperCap_Status_t SuperCapReady;//超级电容【可用标志】:1为可用,0为不可用 + SuperCapStateEnum SuperCapState;//超级电容【状态标志】:各个状态对应的状态码查看E_SuperCapState枚举。 + uint8_t BatVoltage; //通过超级电容监控电池电压*10, + uint8_t BatPower; +}CAN_SuperCapRXDataTypeDef; + +extern CAN_SuperCapRXDataTypeDef CAN_SuperCapRXData; + +void set_supercap_power_offset(uint8_t offset); + + +// 以下函数是超电控制所需要调用的函数 +void transfer_SuperCap_measure( uint8_t *data); +int8_t CAN_TX_SuperCapData(CAN_SuperCapTXDataTypeDef * TX_Temp); + + +/** + * @brief 获取超级电容在线状态,1在线,0离线 + */ +uint8_t get_supercap_online_state(void); + + +/** + * @brief 获取超级电容的运行状态,具体查看枚举SuperCapStateEnum + */ +SuperCapStateEnum get_supercap_state(void); + + +/** + * @brief 获取超级电容读到的电池电压,单位伏(V) + */ +float get_battery_voltage_from_supercap(void); + + +/** + * @brief 获取超级电容可用能量,范围:0-100% + */ +uint8_t get_supercap_energy(void); + + +/** + * @brief 获取根据超级电容功率统计的底盘消耗能量,单位:焦耳(J) + */ +uint32_t get_chassis_energy_from_supercap(void); + +int8_t SuperCap_Init(void); +int8_t SuperCap_Update(void); + +#ifdef __cplusplus +} +#endif /*SUPERCAP_H*/ diff --git a/User/module/chassis.c b/User/module/chassis.c index e53b03c..31369c0 100644 --- a/User/module/chassis.c +++ b/User/module/chassis.c @@ -10,7 +10,9 @@ #include "device/motor_rm.h" #include "device/motor.h" #include "module/chassis.h" - +#include "component/PowerControl.h" +#include "config.h" +#include "math.h" /** * @brief µ×ÅÌСÍÓÂÝģʽÏà¹Ø²ÎÊý */ @@ -251,10 +253,22 @@ int8_t Chassis_Control(Chassis_t *c, const Chassis_CMD_t *c_cmd, uint32_t now) { Clip(&c->out.motor[i], -c->param->limit.max_current, c->param->limit.max_current); } - + return CHASSIS_OK; } + + +void Chassis_Power_Control(Chassis_t *c,float max_power) +{ + float* rpm=(float[4]){c->motors[0]->feedback.rotor_speed,c->motors[1]->feedback.rotor_speed,c->motors[2]->feedback.rotor_speed,c->motors[3]->feedback.rotor_speed}; + power_model_t* param = (c->mode == CHASSIS_MODE_ROTOR) ? &cha2 : &cha; + power_calu(param,(float[4]){c->out.motor[0],c->out.motor[1],c->out.motor[2],c->out.motor[3]},rpm); + float scale = power_scale_calu(¶m,1,max_power); + power_out_calu(param,scale,(float[4]){c->out.motor[0],c->out.motor[1],c->out.motor[2],c->out.motor[3]},rpm,c->out.motor); +} + + /** * @brief µç»úÊä³ö * @param c µ×Å̽ṹÌåÖ¸Õë @@ -263,13 +277,14 @@ void Chassis_Output(Chassis_t *c) { if (!c) return; - //ÿ¸öµç»úÄ¿±êÊä³ö for (uint8_t i = 0; i < c->num_wheel; i++) { MOTOR_RM_t *rm = c->motors[i]; if (!rm) continue; MOTOR_RM_SetOutput(&rm->param, c->out.motor[i]); } + + //µ÷ÓÃctrl for (uint8_t i = 0; i < c->num_wheel; i++) { MOTOR_RM_t *rm = c->motors[i]; diff --git a/User/module/chassis.h b/User/module/chassis.h index 3285dd6..45b721b 100644 --- a/User/module/chassis.h +++ b/User/module/chassis.h @@ -11,10 +11,10 @@ extern "C" { /* Includes ----------------------------------------------------------------- */ #include #include "bsp/can.h" -#include "component\filter.h" -#include "component\mixer.h" -#include "component\pid.h" -#include "component\ahrs.h" +#include "component/filter.h" +#include "component/mixer.h" +#include "component/pid.h" +#include "component/ahrs.h" #include "device/motor_rm.h" /* Exported constants ------------------------------------------------------- */ #define CHASSIS_OK (0) /* ÔËÐÐÕý³£ */ @@ -208,6 +208,7 @@ void Chassis_Output(Chassis_t *c); void Chassis_ResetOutput(Chassis_t *c); +void Chassis_Power_Control(Chassis_t *c,float max_power); /** * @brief µ×Å̹¦ÂÊÏÞÖÆ * diff --git a/User/module/config.c b/User/module/config.c index 1d64626..b914c96 100644 --- a/User/module/config.c +++ b/User/module/config.c @@ -360,6 +360,26 @@ Config_RobotParam_t robot_config = { }; +power_model_t cha= +{ + .motor_num =4, + .constant= 0.7910660075305308, + .k1 = 98.97509148647588, + .k2= 0.00018014375383727376, + .toque_coefficient =0.4568913750568248, + .power = (float[4]){} + }; + +power_model_t cha2= +{ + .motor_num =4, + .constant= 2.354223704504904, + .k1 = 94.85324024176896, + .k2= 0.00012622263917529537, + .toque_coefficient =0.3680225540649464, + + .power = (float[4]){} + }; /* Private function prototypes ---------------------------------------------- */ /* Exported functions ------------------------------------------------------- */ @@ -369,4 +389,4 @@ Config_RobotParam_t robot_config = { */ Config_RobotParam_t* Config_GetRobotParam(void) { return &robot_config; -} \ No newline at end of file +} diff --git a/User/module/config.h b/User/module/config.h index c6b7d65..c81b614 100644 --- a/User/module/config.h +++ b/User/module/config.h @@ -16,6 +16,7 @@ extern "C" { #include "module/gimbal.h" #include "module/chassis.h" #include "module/cmd.h" +#include "component/PowerControl.h" typedef struct { Shoot_Params_t shoot_param; Gimbal_Params_t gimbal_param; @@ -23,6 +24,8 @@ typedef struct { CMD_Params_t cmd_param; } Config_RobotParam_t; +extern power_model_t cha; +extern power_model_t cha2; /* Exported functions prototypes -------------------------------------------- */ /** diff --git a/User/task/blink.c b/User/task/blink.c index bd294f5..72b351f 100644 --- a/User/task/blink.c +++ b/User/task/blink.c @@ -16,7 +16,7 @@ /* Private variables -------------------------------------------------------- */ /* USER STRUCT BEGIN */ -/* USER STRUCT END */ +/* USER STRUCT END */ /* Private function --------------------------------------------------------- */ /* Exported functions ------------------------------------------------------- */ diff --git a/User/task/cmd.c b/User/task/cmd.c index 7e46188..92d6f53 100644 --- a/User/task/cmd.c +++ b/User/task/cmd.c @@ -7,7 +7,7 @@ #include "task/user_task.h" /* USER INCLUDE BEGIN */ #include "device/dr16.h" -#include "device/at9s_pro.h" +#include "device/AT9S_Pro.h" #include "module/config.h" #include "module/chassis.h" #include "module/gimbal.h" diff --git a/User/task/config.yaml b/User/task/config.yaml index 740fff0..50bb2a8 100644 --- a/User/task/config.yaml +++ b/User/task/config.yaml @@ -47,3 +47,10 @@ function: Task_cmd name: cmd stack: 256 +- delay: 0 + description: '' + freq_control: true + frequency: 500.0 + function: Task_supercap + name: supercap + stack: 512 diff --git a/User/task/ctrl_chassis.c b/User/task/ctrl_chassis.c index 3f11e37..aaae4c1 100644 --- a/User/task/ctrl_chassis.c +++ b/User/task/ctrl_chassis.c @@ -4,10 +4,11 @@ */ /* Includes ----------------------------------------------------------------- */ - #include "task/user_task.h" +#include "task/user_task.h" /* USER INCLUDE BEGIN */ #include "module/chassis.h" #include "module/config.h" +#include "device/supercap.h" /* USER INCLUDE END */ /* Private typedef ---------------------------------------------------------- */ @@ -18,6 +19,7 @@ Chassis_t chassis; Chassis_CMD_t chassis_cmd; Chassis_IMU_t chassis_imu; +float max =50; /* USER STRUCT END */ /* Private function --------------------------------------------------------- */ @@ -33,6 +35,7 @@ void Task_ctrl_chassis(void *argument) { uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */ /* USER CODE INIT BEGIN */ + Config_RobotParam_t *cfg = Config_GetRobotParam(); Chassis_Init(&chassis, &cfg->chassis_param, (float)CTRL_CHASSIS_FREQ); chassis.mech_zero=0.57f; @@ -41,14 +44,18 @@ void Task_ctrl_chassis(void *argument) { while (1) { tick += delay_tick; /* 计算下一个唤醒时刻 */ /* USER CODE BEGIN */ + osMessageQueueGet(task_runtime.msgq.chassis.yaw, &chassis.feedback.encoder_gimbalYawMotor, NULL, 0); osMessageQueueGet(task_runtime.msgq.chassis.cmd, &chassis_cmd, NULL, 0);//遥控器 Chassis_UpdateFeedback(&chassis); Chassis_Control(&chassis, &chassis_cmd, osKernelGetTickCount()); + + Chassis_Power_Control(&chassis,max); + Chassis_Output(&chassis); /* USER CODE END */ osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */ } -} \ No newline at end of file +} diff --git a/User/task/init.c b/User/task/init.c index 40404c3..eeb384b 100644 --- a/User/task/init.c +++ b/User/task/init.c @@ -8,7 +8,7 @@ /* USER INCLUDE BEGIN */ #include "device/dr16.h" -#include "device/at9s_pro.h" +#include "device/AT9S_Pro.h" #include "module/gimbal.h" #include "module/shoot.h" #include "module/chassis.h" @@ -42,6 +42,7 @@ void Task_Init(void *argument) { task_runtime.thread.ctrl_gimbal = osThreadNew(Task_ctrl_gimbal, NULL, &attr_ctrl_gimbal); task_runtime.thread.ctrl_shoot = osThreadNew(Task_ctrl_shoot, NULL, &attr_ctrl_shoot); task_runtime.thread.cmd = osThreadNew(Task_cmd, NULL, &attr_cmd); + task_runtime.thread.supercap = osThreadNew(Task_supercap, NULL, &attr_supercap); // 创建消息队列 /* USER MESSAGE BEGIN */ diff --git a/User/task/rc.c b/User/task/rc.c index cdbe090..6ac9c21 100644 --- a/User/task/rc.c +++ b/User/task/rc.c @@ -3,11 +3,11 @@ */ -// #define AT9S -#define DR16 /* Includes ----------------------------------------------------------------- */ #include "task/user_task.h" /* USER INCLUDE BEGIN */ + +#define DR16 #ifdef AT9S #include "device/at9s_pro.h" #endif diff --git a/User/task/supercap.c b/User/task/supercap.c new file mode 100644 index 0000000..a955d90 --- /dev/null +++ b/User/task/supercap.c @@ -0,0 +1,50 @@ +/* + supercap Task + +*/ + +/* Includes ----------------------------------------------------------------- */ +#include "task/user_task.h" +/* USER INCLUDE BEGIN */ +#include "device/supercap.h" + +/* USER INCLUDE END */ + +/* Private typedef ---------------------------------------------------------- */ +/* Private define ----------------------------------------------------------- */ +/* Private macro ------------------------------------------------------------ */ +/* Private variables -------------------------------------------------------- */ +/* USER STRUCT BEGIN */ +CAN_SuperCapTXDataTypeDef SuperCap_CanTX; +/* USER STRUCT END */ + +/* Private function --------------------------------------------------------- */ +/* Exported functions ------------------------------------------------------- */ +void Task_supercap(void *argument) { + (void)argument; /* 未使用argument,消除警告 */ + + + /* 计算任务运行到指定频率需要等待的tick数 */ + const uint32_t delay_tick = osKernelGetTickFreq() / SUPERCAP_FREQ; + + osDelay(SUPERCAP_INIT_DELAY); /* 延时一段时间再开启任务 */ + + uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */ + /* USER CODE INIT BEGIN */ + SuperCap_Init(); + SuperCap_CanTX.Enable = 1 ; //超级电容使能。1使能,0失能 + SuperCap_CanTX.Charge = 1 ; //V1.1超级电容充电。1充电,0放电,在PLUS版本中,此标志位无效,超电的充放电是自动的 + SuperCap_CanTX.Powerlimit = 120 ; //裁判系统功率限制 + SuperCap_CanTX.ChargePower = 1 ; //V1.1超级电容充电功率,在PLUS版本中,此参数,超电的充电功率随着底盘功率变化 + /* USER CODE INIT END */ + + while (1) { + tick += delay_tick; /* 计算下一个唤醒时刻 */ + /* USER CODE BEGIN */ + SuperCap_Update(); + CAN_TX_SuperCapData(&SuperCap_CanTX); + /* USER CODE END */ + osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */ + } + +} diff --git a/User/task/user_task.c b/User/task/user_task.c index 8f2ab08..99d790f 100644 --- a/User/task/user_task.c +++ b/User/task/user_task.c @@ -27,7 +27,7 @@ const osThreadAttr_t attr_blink = { const osThreadAttr_t attr_ctrl_chassis = { .name = "ctrl_chassis", .priority = osPriorityNormal, - .stack_size = 256 * 4, + .stack_size = 512 * 16, }; const osThreadAttr_t attr_ctrl_gimbal = { .name = "ctrl_gimbal", @@ -37,10 +37,15 @@ const osThreadAttr_t attr_ctrl_gimbal = { const osThreadAttr_t attr_ctrl_shoot = { .name = "ctrl_shoot", .priority = osPriorityNormal, - .stack_size = 512 * 4, + .stack_size = 256 * 4, }; const osThreadAttr_t attr_cmd = { .name = "cmd", .priority = osPriorityNormal, .stack_size = 256 * 4, -}; \ No newline at end of file +}; +const osThreadAttr_t attr_supercap = { + .name = "supercap", + .priority = osPriorityNormal, + .stack_size = 512 * 4, +}; diff --git a/User/task/user_task.h b/User/task/user_task.h index 303cd95..188a1e5 100644 --- a/User/task/user_task.h +++ b/User/task/user_task.h @@ -14,12 +14,13 @@ extern "C" { /* Exported constants ------------------------------------------------------- */ /* 任务运行频率 */ #define RC_FREQ (500.0) -#define ATTI_ESTI_FREQ (500.0) +#define ATTI_ESTI_FREQ (1000.0) #define BLINK_FREQ (100.0) #define CTRL_CHASSIS_FREQ (500.0) #define CTRL_GIMBAL_FREQ (500.0) -#define CTRL_SHOOT_FREQ (1000.0) +#define CTRL_SHOOT_FREQ (500.0) #define CMD_FREQ (500.0) +#define SUPERCAP_FREQ (500.0) /* 任务初始化延时ms */ #define TASK_INIT_DELAY (100u) @@ -30,6 +31,7 @@ extern "C" { #define CTRL_GIMBAL_INIT_DELAY (0) #define CTRL_SHOOT_INIT_DELAY (0) #define CMD_INIT_DELAY (0) +#define SUPERCAP_INIT_DELAY (0) /* Exported defines --------------------------------------------------------- */ /* Exported macro ----------------------------------------------------------- */ @@ -46,6 +48,7 @@ typedef struct { osThreadId_t ctrl_gimbal; osThreadId_t ctrl_shoot; osThreadId_t cmd; + osThreadId_t supercap; } thread; /* USER MESSAGE BEGIN */ @@ -95,6 +98,7 @@ typedef struct { UBaseType_t ctrl_gimbal; UBaseType_t ctrl_shoot; UBaseType_t cmd; + UBaseType_t supercap; } stack_water_mark; /* 各任务运行频率 */ @@ -106,6 +110,7 @@ typedef struct { float ctrl_gimbal; float ctrl_shoot; float cmd; + float supercap; } freq; /* 任务最近运行时间 */ @@ -117,6 +122,7 @@ typedef struct { float ctrl_gimbal; float ctrl_shoot; float cmd; + float supercap; } last_up_time; } Task_Runtime_t; @@ -133,6 +139,7 @@ extern const osThreadAttr_t attr_ctrl_chassis; extern const osThreadAttr_t attr_ctrl_gimbal; extern const osThreadAttr_t attr_ctrl_shoot; extern const osThreadAttr_t attr_cmd; +extern const osThreadAttr_t attr_supercap; /* 任务函数声明 */ void Task_Init(void *argument); @@ -143,6 +150,7 @@ void Task_ctrl_chassis(void *argument); void Task_ctrl_gimbal(void *argument); void Task_ctrl_shoot(void *argument); void Task_cmd(void *argument); +void Task_supercap(void *argument); #ifdef __cplusplus } diff --git a/hero.ioc b/hero.ioc index 328171b..5dc39e3 100644 --- a/hero.ioc +++ b/hero.ioc @@ -87,7 +87,7 @@ Dma.USART6_TX.5.Priority=DMA_PRIORITY_LOW Dma.USART6_TX.5.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode FREERTOS.IPParameters=Tasks01,configTOTAL_HEAP_SIZE FREERTOS.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL -FREERTOS.configTOTAL_HEAP_SIZE=0x6000 +FREERTOS.configTOTAL_HEAP_SIZE=0x10000 File.Version=6 GPIO.groupedBy=Group By Peripherals I2C3.I2C_Mode=I2C_Fast