17 changed files with 718 additions and 22 deletions
-
98.vscode/c_cpp_properties.json
-
2.vscode/keil-assistant.log
-
5.vscode/settings.json
-
0.vscode/uv4.log.lock
-
34app/.mxproject
-
2app/Core/Inc/stm32f1xx_hal_conf.h
-
52app/Core/Inc/tim.h
-
2app/Core/Src/main.c
-
104app/Core/Src/tim.c
-
223app/MDK-ARM/app.uvprojx
-
12app/app.ioc
-
2dep/libiflytop_micro
-
61src/board/hardware.cpp
-
60src/board/hardware.hpp
-
10src/board/project_board.hpp
-
27src/umain.cpp
-
46src/umain.hpp
@ -0,0 +1,98 @@ |
|||
{ |
|||
"configurations": [ |
|||
{ |
|||
"name": "app", |
|||
"includePath": [ |
|||
"./app\\Core\\Inc", |
|||
"./app\\Drivers\\STM32F1xx_HAL_Driver\\Inc", |
|||
"./app\\Drivers\\STM32F1xx_HAL_Driver\\Inc\\Legacy", |
|||
"./app\\Drivers\\CMSIS\\Device\\ST\\STM32F1xx\\Include", |
|||
"./app\\Drivers\\CMSIS\\Include", |
|||
"./dep", |
|||
"./src", |
|||
"./dep\\libtrinamic\\IFLYTOP-TMC-API", |
|||
"./app\\MDK-ARM", |
|||
"./app\\Core\\Src", |
|||
"./app\\Drivers\\STM32F1xx_HAL_Driver\\Src" |
|||
], |
|||
"defines": [ |
|||
"USE_HAL_DRIVER", |
|||
"STM32F103xB", |
|||
"__CC_ARM", |
|||
"__arm__", |
|||
"__align(x)=", |
|||
"__ALIGNOF__(x)=", |
|||
"__alignof__(x)=", |
|||
"__asm(x)=", |
|||
"__forceinline=", |
|||
"__restrict=", |
|||
"__global_reg(n)=", |
|||
"__inline=", |
|||
"__int64=long long", |
|||
"__INTADDR__(expr)=0", |
|||
"__irq=", |
|||
"__packed=", |
|||
"__pure=", |
|||
"__smc(n)=", |
|||
"__svc(n)=", |
|||
"__svc_indirect(n)=", |
|||
"__svc_indirect_r7(n)=", |
|||
"__value_in_regs=", |
|||
"__weak=", |
|||
"__writeonly=", |
|||
"__declspec(x)=", |
|||
"__attribute__(x)=", |
|||
"__nonnull__(x)=", |
|||
"__register=", |
|||
"__breakpoint(x)=", |
|||
"__cdp(x,y,z)=", |
|||
"__clrex()=", |
|||
"__clz(x)=0U", |
|||
"__current_pc()=0U", |
|||
"__current_sp()=0U", |
|||
"__disable_fiq()=", |
|||
"__disable_irq()=", |
|||
"__dmb(x)=", |
|||
"__dsb(x)=", |
|||
"__enable_fiq()=", |
|||
"__enable_irq()=", |
|||
"__fabs(x)=0.0", |
|||
"__fabsf(x)=0.0f", |
|||
"__force_loads()=", |
|||
"__force_stores()=", |
|||
"__isb(x)=", |
|||
"__ldrex(x)=0U", |
|||
"__ldrexd(x)=0U", |
|||
"__ldrt(x)=0U", |
|||
"__memory_changed()=", |
|||
"__nop()=", |
|||
"__pld(...)=", |
|||
"__pli(...)=", |
|||
"__qadd(x,y)=0", |
|||
"__qdbl(x)=0", |
|||
"__qsub(x,y)=0", |
|||
"__rbit(x)=0U", |
|||
"__rev(x)=0U", |
|||
"__return_address()=0U", |
|||
"__ror(x,y)=0U", |
|||
"__schedule_barrier()=", |
|||
"__semihost(x,y)=0", |
|||
"__sev()=", |
|||
"__sqrt(x)=0.0", |
|||
"__sqrtf(x)=0.0f", |
|||
"__ssat(x,y)=0", |
|||
"__strex(x,y)=0U", |
|||
"__strexd(x,y)=0", |
|||
"__strt(x,y)=", |
|||
"__swp(x,y)=0U", |
|||
"__usat(x,y)=0U", |
|||
"__wfe()=", |
|||
"__wfi()=", |
|||
"__yield()=", |
|||
"__vfp_status(x,y)=0" |
|||
], |
|||
"intelliSenseMode": "${default}" |
|||
} |
|||
], |
|||
"version": 4 |
|||
} |
@ -0,0 +1,2 @@ |
|||
[info] Log at : 2023/6/14|21:19:34|GMT+0800 |
|||
|
@ -0,0 +1,5 @@ |
|||
{ |
|||
"files.associations": { |
|||
"compare": "cpp" |
|||
} |
|||
} |
@ -1,36 +1,38 @@ |
|||
[PreviousLibFiles] |
|||
LibFiles=Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xb.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.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_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_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h; |
|||
LibFiles=Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xb.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.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_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_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h; |
|||
|
|||
[PreviousUsedIarFiles] |
|||
SourceFiles=..\Core\Src\main.c;..\Core\Src\stm32f1xx_it.c;..\Core\Src\stm32f1xx_hal_msp.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;;; |
|||
HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\Core\Inc; |
|||
CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER; |
|||
|
|||
[PreviousUsedKeilFiles] |
|||
SourceFiles=..\Core\Src\main.c;..\Core\Src\gpio.c;..\Core\Src\iwdg.c;..\Core\Src\tim.c;..\Core\Src\usart.c;..\Core\Src\stm32f1xx_it.c;..\Core\Src\stm32f1xx_hal_msp.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;;; |
|||
HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\Core\Inc; |
|||
CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER; |
|||
|
|||
[PreviousGenFiles] |
|||
AdvancedFolderStructure=true |
|||
HeaderFileListSize=6 |
|||
HeaderFileListSize=7 |
|||
HeaderFiles#0=..\Core\Inc\gpio.h |
|||
HeaderFiles#1=..\Core\Inc\iwdg.h |
|||
HeaderFiles#2=..\Core\Inc\usart.h |
|||
HeaderFiles#3=..\Core\Inc\stm32f1xx_it.h |
|||
HeaderFiles#4=..\Core\Inc\stm32f1xx_hal_conf.h |
|||
HeaderFiles#5=..\Core\Inc\main.h |
|||
HeaderFiles#2=..\Core\Inc\tim.h |
|||
HeaderFiles#3=..\Core\Inc\usart.h |
|||
HeaderFiles#4=..\Core\Inc\stm32f1xx_it.h |
|||
HeaderFiles#5=..\Core\Inc\stm32f1xx_hal_conf.h |
|||
HeaderFiles#6=..\Core\Inc\main.h |
|||
HeaderFolderListSize=1 |
|||
HeaderPath#0=..\Core\Inc |
|||
HeaderFiles=; |
|||
SourceFileListSize=6 |
|||
SourceFileListSize=7 |
|||
SourceFiles#0=..\Core\Src\gpio.c |
|||
SourceFiles#1=..\Core\Src\iwdg.c |
|||
SourceFiles#2=..\Core\Src\usart.c |
|||
SourceFiles#3=..\Core\Src\stm32f1xx_it.c |
|||
SourceFiles#4=..\Core\Src\stm32f1xx_hal_msp.c |
|||
SourceFiles#5=..\Core\Src\main.c |
|||
SourceFiles#2=..\Core\Src\tim.c |
|||
SourceFiles#3=..\Core\Src\usart.c |
|||
SourceFiles#4=..\Core\Src\stm32f1xx_it.c |
|||
SourceFiles#5=..\Core\Src\stm32f1xx_hal_msp.c |
|||
SourceFiles#6=..\Core\Src\main.c |
|||
SourceFolderListSize=1 |
|||
SourcePath#0=..\Core\Src |
|||
SourceFiles=; |
|||
|
|||
[PreviousUsedKeilFiles] |
|||
SourceFiles=..\Core\Src\main.c;..\Core\Src\gpio.c;..\Core\Src\iwdg.c;..\Core\Src\usart.c;..\Core\Src\stm32f1xx_it.c;..\Core\Src\stm32f1xx_hal_msp.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;;; |
|||
HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\Core\Inc; |
|||
CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER; |
|||
|
@ -0,0 +1,52 @@ |
|||
/* USER CODE BEGIN Header */ |
|||
/** |
|||
****************************************************************************** |
|||
* @file tim.h |
|||
* @brief This file contains all the function prototypes for |
|||
* the tim.c file |
|||
****************************************************************************** |
|||
* @attention |
|||
* |
|||
* Copyright (c) 2023 STMicroelectronics. |
|||
* All rights reserved. |
|||
* |
|||
* This software is licensed under terms that can be found in the LICENSE file |
|||
* in the root directory of this software component. |
|||
* If no LICENSE file comes with this software, it is provided AS-IS. |
|||
* |
|||
****************************************************************************** |
|||
*/ |
|||
/* USER CODE END Header */ |
|||
/* Define to prevent recursive inclusion -------------------------------------*/ |
|||
#ifndef __TIM_H__ |
|||
#define __TIM_H__ |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
/* Includes ------------------------------------------------------------------*/ |
|||
#include "main.h" |
|||
|
|||
/* USER CODE BEGIN Includes */ |
|||
|
|||
/* USER CODE END Includes */ |
|||
|
|||
extern TIM_HandleTypeDef htim4; |
|||
|
|||
/* USER CODE BEGIN Private defines */ |
|||
|
|||
/* USER CODE END Private defines */ |
|||
|
|||
void MX_TIM4_Init(void); |
|||
|
|||
/* USER CODE BEGIN Prototypes */ |
|||
|
|||
/* USER CODE END Prototypes */ |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif /* __TIM_H__ */ |
|||
|
@ -0,0 +1,104 @@ |
|||
/* USER CODE BEGIN Header */ |
|||
/** |
|||
****************************************************************************** |
|||
* @file tim.c |
|||
* @brief This file provides code for the configuration |
|||
* of the TIM instances. |
|||
****************************************************************************** |
|||
* @attention |
|||
* |
|||
* Copyright (c) 2023 STMicroelectronics. |
|||
* All rights reserved. |
|||
* |
|||
* This software is licensed under terms that can be found in the LICENSE file |
|||
* in the root directory of this software component. |
|||
* If no LICENSE file comes with this software, it is provided AS-IS. |
|||
* |
|||
****************************************************************************** |
|||
*/ |
|||
/* USER CODE END Header */ |
|||
/* Includes ------------------------------------------------------------------*/ |
|||
#include "tim.h" |
|||
|
|||
/* USER CODE BEGIN 0 */ |
|||
|
|||
/* USER CODE END 0 */ |
|||
|
|||
TIM_HandleTypeDef htim4; |
|||
|
|||
/* TIM4 init function */ |
|||
void MX_TIM4_Init(void) |
|||
{ |
|||
|
|||
/* USER CODE BEGIN TIM4_Init 0 */ |
|||
|
|||
/* USER CODE END TIM4_Init 0 */ |
|||
|
|||
TIM_ClockConfigTypeDef sClockSourceConfig = {0}; |
|||
TIM_MasterConfigTypeDef sMasterConfig = {0}; |
|||
|
|||
/* USER CODE BEGIN TIM4_Init 1 */ |
|||
|
|||
/* USER CODE END TIM4_Init 1 */ |
|||
htim4.Instance = TIM4; |
|||
htim4.Init.Prescaler = 63; |
|||
htim4.Init.CounterMode = TIM_COUNTERMODE_UP; |
|||
htim4.Init.Period = 65535; |
|||
htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; |
|||
htim4.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; |
|||
if (HAL_TIM_Base_Init(&htim4) != HAL_OK) |
|||
{ |
|||
Error_Handler(); |
|||
} |
|||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; |
|||
if (HAL_TIM_ConfigClockSource(&htim4, &sClockSourceConfig) != HAL_OK) |
|||
{ |
|||
Error_Handler(); |
|||
} |
|||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; |
|||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; |
|||
if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK) |
|||
{ |
|||
Error_Handler(); |
|||
} |
|||
/* USER CODE BEGIN TIM4_Init 2 */ |
|||
|
|||
/* USER CODE END TIM4_Init 2 */ |
|||
|
|||
} |
|||
|
|||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) |
|||
{ |
|||
|
|||
if(tim_baseHandle->Instance==TIM4) |
|||
{ |
|||
/* USER CODE BEGIN TIM4_MspInit 0 */ |
|||
|
|||
/* USER CODE END TIM4_MspInit 0 */ |
|||
/* TIM4 clock enable */ |
|||
__HAL_RCC_TIM4_CLK_ENABLE(); |
|||
/* USER CODE BEGIN TIM4_MspInit 1 */ |
|||
|
|||
/* USER CODE END TIM4_MspInit 1 */ |
|||
} |
|||
} |
|||
|
|||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) |
|||
{ |
|||
|
|||
if(tim_baseHandle->Instance==TIM4) |
|||
{ |
|||
/* USER CODE BEGIN TIM4_MspDeInit 0 */ |
|||
|
|||
/* USER CODE END TIM4_MspDeInit 0 */ |
|||
/* Peripheral clock disable */ |
|||
__HAL_RCC_TIM4_CLK_DISABLE(); |
|||
/* USER CODE BEGIN TIM4_MspDeInit 1 */ |
|||
|
|||
/* USER CODE END TIM4_MspDeInit 1 */ |
|||
} |
|||
} |
|||
|
|||
/* USER CODE BEGIN 1 */ |
|||
|
|||
/* USER CODE END 1 */ |
@ -1 +1 @@ |
|||
Subproject commit 51100549ca3b283c5281efec0921a281910c56fc |
|||
Subproject commit 66cbc54d57a7a2d1b2e704e1042a98a44ce0959e |
@ -0,0 +1,61 @@ |
|||
#include "hardware.hpp"
|
|||
using namespace iflytop; |
|||
|
|||
#define TAG "hardware"
|
|||
|
|||
extern "C" { |
|||
int fputc(int ch, FILE* stream) { |
|||
uint8_t c = ch; |
|||
HAL_UART_Transmit(&DEBUG_UART, &c, 1, 100); |
|||
return ch; |
|||
} |
|||
} |
|||
|
|||
|
|||
void Hardware::initialize() { |
|||
STM32_HAL::regListener(this); |
|||
} |
|||
void Hardware::periodicJob() {} |
|||
/*******************************************************************************
|
|||
* 测试指示灯 * |
|||
*******************************************************************************/ |
|||
void Hardware::debug_light_init() { DEBUG_LIGHT_GPIO.initAsOutput(STM32_GPIO::kOutput_nopull, false, false); } |
|||
void Hardware::debug_light_periodicJob() { |
|||
static uint32_t lastprocess = 0; |
|||
if (sys_haspassedms(lastprocess) > 300) { |
|||
lastprocess = HAL_GetTick(); |
|||
DEBUG_LIGHT_GPIO.toggleState(); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
/*******************************************************************************
|
|||
* INPUT SENSOR * |
|||
*******************************************************************************/ |
|||
void Hardware::input_sensor_init() {} |
|||
|
|||
uint32_t Hardware::input_sensor_get_table0() { |
|||
uint32_t val = 0; |
|||
return val; |
|||
} |
|||
|
|||
void Hardware::input_sensor_table0_dump() { |
|||
uint32_t val = input_sensor_get_table0(); |
|||
ZLOGI(TAG, "input_sensor_table0_dump:%d%d%d%d %d%d%d%d %d%d%d%d %d%d%d", (val >> 0) & 0x01, //
|
|||
(val >> 1) & 0x01, //
|
|||
(val >> 2) & 0x01, //
|
|||
(val >> 3) & 0x01, //
|
|||
(val >> 4) & 0x01, //
|
|||
(val >> 5) & 0x01, //
|
|||
(val >> 6) & 0x01, //
|
|||
(val >> 7) & 0x01, //
|
|||
(val >> 8) & 0x01, //
|
|||
(val >> 9) & 0x01, //
|
|||
(val >> 10) & 0x01, //
|
|||
(val >> 11) & 0x01, //
|
|||
(val >> 12) & 0x01, //
|
|||
(val >> 13) & 0x01, //
|
|||
(val >> 14) & 0x01); |
|||
// return val;
|
|||
} |
@ -0,0 +1,60 @@ |
|||
#pragma once
|
|||
#include "board/project_board.hpp"
|
|||
#include "libiflytop_micro/stm32/basic/basic.h"
|
|||
#include "libiflytop_micro\stm32\basic\iflytop_micro_os.hpp"
|
|||
#include "libiflytop_micro\stm32\basic\stm32_hal.hpp"
|
|||
#include "libiflytop_micro\stm32\component\tmcutils\tmc51x0_port_impl.hpp"
|
|||
#include "main.h"
|
|||
#include "usart.h"
|
|||
namespace iflytop { |
|||
#define MAX_HARDWARE_LISTENER_NUM 5
|
|||
class HardwareListener { |
|||
public: |
|||
virtual void Hardware_OnHardwareException(){}; |
|||
virtual void Hardware_OnCanRxData(void *packet){}; |
|||
virtual void Hardware_onHomeRefSwitchISR(){}; |
|||
}; |
|||
|
|||
class Hardware : public STM32_HAL_LISTENER, //
|
|||
public IflytopMicroOS, |
|||
public STM32_GPIO_LISTENER { |
|||
private: |
|||
|
|||
public: |
|||
|
|||
public: |
|||
Hardware(/* args */){}; |
|||
~Hardware(){}; |
|||
void initialize(); |
|||
void periodicJob(); |
|||
/*******************************************************************************
|
|||
* 测试指示灯 * |
|||
*******************************************************************************/ |
|||
void debug_light_init(); |
|||
void debug_light_periodicJob(); |
|||
|
|||
public: |
|||
/*******************************************************************************
|
|||
* INPUT SENSOR * |
|||
*******************************************************************************/ |
|||
void input_sensor_init(); |
|||
uint32_t input_sensor_get_table0(); |
|||
void input_sensor_table0_dump(); |
|||
|
|||
public: |
|||
/*******************************************************************************
|
|||
* OVERRIDE IflytopMicroOS * |
|||
*******************************************************************************/ |
|||
virtual void sleepMS(int ms) { HAL_Delay(ms); }; |
|||
virtual uint32_t hasPassedMS(uint32_t ticket) { return sys_haspassedms(ticket); }; |
|||
virtual uint32_t getTicket() { return HAL_GetTick(); }; |
|||
virtual uint32_t getNowMS() { return HAL_GetTick(); }; |
|||
virtual void sleepus(uint32_t us) { sys_delay_us(&DELAY_US_TIMER, us); } |
|||
|
|||
/*******************************************************************************
|
|||
* STM32_GPIO_LISTENER * |
|||
*******************************************************************************/ |
|||
private: |
|||
}; |
|||
|
|||
} // namespace iflytop
|
@ -0,0 +1,10 @@ |
|||
#pragma once
|
|||
#include "libiflytop_micro\stm32\basic\stm32_gpio.hpp"
|
|||
#define VERSION "v1.0"
|
|||
// 调试串口
|
|||
#define DEBUG_UART huart2
|
|||
// 调试指示灯
|
|||
#define DEBUG_LIGHT_GPIO PA1
|
|||
// 微秒延迟定时器,注意该延时定时器需要按照以下文档进行配置
|
|||
// http://192.168.1.3:3000/zwikipedia/iflytop_wikipedia/src/branch/master/doc/stm32cubemx_us_timer.md
|
|||
#define DELAY_US_TIMER htim4
|
@ -0,0 +1,27 @@ |
|||
#include "umain.hpp"
|
|||
|
|||
#include <limits.h>
|
|||
#include <stdint.h>
|
|||
|
|||
using namespace iflytop; |
|||
using namespace std; |
|||
|
|||
/*******************************************************************************
|
|||
* CODE BEGIN * |
|||
*******************************************************************************/ |
|||
#define TAG "umain"
|
|||
int random(int max) { return SysTick->VAL % max; } |
|||
/*******************************************************************************
|
|||
* MAIN * |
|||
*******************************************************************************/ |
|||
void Main::main(int argc, char const *argv[]) { |
|||
sys_loggger_enable(true); |
|||
ZLOGI(TAG, "setup") |
|||
m_hardware.initialize(); |
|||
m_hardware.debug_light_init(); |
|||
m_hardware.input_sensor_init(); |
|||
while (true) { |
|||
m_hardware.periodicJob(); |
|||
m_hardware.debug_light_periodicJob(); |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
#pragma once
|
|||
#include <stdbool.h>
|
|||
#include <stdio.h>
|
|||
|
|||
#include "board/project_board.hpp"
|
|||
#include "libiflytop_micro\stm32\basic\basic.h"
|
|||
#include "libiflytop_micro\stm32\component\tmc\ic\tmc4361A.hpp"
|
|||
//
|
|||
#include <stdlib.h>
|
|||
|
|||
#include "board/hardware.hpp"
|
|||
#include "libiflytop_micro\stm32\basic\stm32_tim.hpp"
|
|||
#include "libiflytop_micro\stm32\basic\zsignal.hpp"
|
|||
#include "libiflytop_micro\stm32\component\iflytop_can_slave_module\device_base_control_service.hpp"
|
|||
#include "libiflytop_micro\stm32\component\iflytop_can_slave_module\idcard_reader_service.hpp"
|
|||
#include "libiflytop_micro\stm32\component\iflytop_can_slave_module\single_axis_motor_control_v2.hpp"
|
|||
#include "libiflytop_micro\stm32\component\iflytop_can_slave_v1\iflytop_can_slave.hpp"
|
|||
#include "libiflytop_micro\stm32\component\m3078\m3078_code_scaner.hpp"
|
|||
|
|||
#define UPDATE_REG(reg, value, periodms) \
|
|||
{ \ |
|||
static uint32_t lastReportTicket = 0; \ |
|||
if (m_hardware.hasPassedMS(lastReportTicket) > (periodms + random(3))) { \ |
|||
lastReportTicket = m_hardware.getTicket(); \ |
|||
m_protocolStack.writeRegValue(reg, value, false); \ |
|||
} \ |
|||
} |
|||
namespace iflytop { |
|||
class Main { |
|||
public: |
|||
Hardware m_hardware; |
|||
|
|||
Main() {} |
|||
void main(int argc, char const *argv[]); |
|||
|
|||
public: |
|||
}; |
|||
} // namespace iflytop
|
|||
|
|||
static iflytop::Main mainObject; |
|||
extern "C" { |
|||
int umain(int argc, char const *argv[]) { |
|||
mainObject.main(argc, argv); |
|||
return 0; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue