diff --git a/.gitignore b/.gitignore index 3167a08..242a603 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,3 @@ build-plsr_host-Desktop_Qt_5_6_3_MinGW_32bit-Debug/ plsr/test/ tools/ .cursor/ -*.pdf -3. 定位控制手册.pdf diff --git a/app/main.c b/app/main.c index de88a64..4101d84 100644 --- a/app/main.c +++ b/app/main.c @@ -118,8 +118,9 @@ int main(void) } /** - * @brief 系统时钟:HSE → PLL → 168MHz SYSCLK(APM32F407 / STM32F4 类) - * @note 须与 OS_CPU_SysTickInit 使用的主频常量一致 + * @brief 系统时钟:HSE(12MHz) → PLL → 168MHz SYSCLK(APM32F407 / STM32F4 类) + * @note 须与 OS_CPU_SysTickInit、pulse_driver 使用的主频常量一致 + * @note PLLM 须等于晶振 MHz:12MHz 用 12;误用 8 会使 SYSCLK=252MHz,脉冲频率偏 1.5 倍 */ void SystemClock_Config(void) { @@ -133,10 +134,10 @@ void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 12; + RCC_OscInitStruct.PLL.PLLM = 12; /* HSE=12MHz → VCO in = 1MHz */ RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 4; + RCC_OscInitStruct.PLL.PLLQ = 4;/*不准改成7*/ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); diff --git a/drivers/Source/stm32f4xx_it.c b/drivers/Source/stm32f4xx_it.c index 5ef0f05..0f4bb62 100644 --- a/drivers/Source/stm32f4xx_it.c +++ b/drivers/Source/stm32f4xx_it.c @@ -225,12 +225,12 @@ void TIM2_IRQHandler(void) } /** - * @brief TIM3:PLSR WAIT/ACT 1ms 时基 + * @brief TIM5:PLSR 单次延时到期(换向 / WAIT / ACT) */ -void TIM3_IRQHandler(void) +void TIM5_IRQHandler(void) { OSIntEnter(); - PlsrSignalIoOnTim3Irq(); + PlsrSignalIoOnTim5Irq(); OSIntExit(); } diff --git a/iar/plsr.dep b/iar/plsr.dep index 012dae6..0e5f30b 100644 --- a/iar/plsr.dep +++ b/iar/plsr.dep @@ -1,490 +1,612 @@ 4 - 4093708232 + 483922943 Debug - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_cortex.h - $PROJ_DIR$\..\cmsis\Device\Include\stm32f4xx.h - $PROJ_DIR$\..\drivers\Include\Legacy\stm32_hal_legacy.h - $PROJ_DIR$\..\cmsis\Device\Include\system_stm32f4xx.h + $PROJ_DIR$\..\app\main.c + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_conf.h $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal.h $PROJ_DIR$\..\cmsis\Core\Include\mpu_armv7.h - $PROJ_DIR$\..\drivers\Include\gpio.h - $PROJ_DIR$\..\cmsis\Core\Include\core_cm4.h - $PROJ_DIR$\..\cmsis\Device\Include\stm32f407xx.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_def.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_dma.h $PROJ_DIR$\..\cmsis\Core\Include\cmsis_iccarm.h + $PROJ_DIR$\..\cmsis\Device\Include\stm32f4xx.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_cortex.h + $PROJ_DIR$\..\cmsis\Device\Include\system_stm32f4xx.h $PROJ_DIR$\..\cmsis\Core\Include\cmsis_version.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_conf.h - $PROJ_DIR$\..\app\main.h + $PROJ_DIR$\..\drivers\Include\Legacy\stm32_hal_legacy.h + $PROJ_DIR$\..\drivers\Include\gpio.h $PROJ_DIR$\..\cmsis\Core\Include\cmsis_compiler.h - $PROJ_DIR$\..\app\main.c + $PROJ_DIR$\..\cmsis\Core\Include\core_cm4.h $PROJ_DIR$\..\cmsis\Core\Include\cmsis_cp15.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_lptim.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma_ex.o - $PROJ_DIR$\Debug\Obj\os_task.o + $PROJ_DIR$\..\app\main.h + $PROJ_DIR$\..\cmsis\Device\Include\stm32f407xx.h + $TOOLKIT_DIR$\inc\c\DLib_Config_Full.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_uart.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmpi2c.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp_ex.o + $PROJ_DIR$\Debug\Obj\lib_ascii.o + $PROJ_DIR$\Debug\Obj\usart.xcl + $PROJ_DIR$\Debug\Obj\system_stm32f4xx.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ramfunc.o + $PROJ_DIR$\Debug\Obj\os_dbg.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_can.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_sdmmc.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc_ex.o + $PROJ_DIR$\Debug\Obj\lib_mem.xcl + $PROJ_DIR$\apm32f407xg_flash.icf + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi_ex.o + $PROJ_DIR$\Debug\Obj\os_q.o + $PROJ_DIR$\Debug\Obj\cpu_a.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nor.xcl + $TOOLKIT_DIR$\lib\shb_l.a $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_lptim.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nor.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_uart.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rtc.o - $PROJ_DIR$\Debug\Obj\plsr_path_plan.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dac.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd.o $PROJ_DIR$\Debug\Obj\plsr_param.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rng.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_msp.o - $PROJ_DIR$\Debug\Obj\lib_mem.o - $PROJ_DIR$\Debug\Obj\os_sem.o - $PROJ_DIR$\Debug\Obj\plsr_signal_io.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma2d.xcl - $TOOLKIT_DIR$\inc\c\yvals.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_crc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sram.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smbus.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_spi.o - $PROJ_DIR$\Debug\Obj\lib_mem.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma2d.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_eth.xcl - $PROJ_DIR$\Debug\Obj\lib_math.o - $PROJ_DIR$\Debug\Obj\plsr_run_control.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rtc.xcl - $TOOLKIT_DIR$\inc\c\ycheck.h - $TOOLKIT_DIR$\inc\c\iar_intrinsics_common.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_i2c.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_it.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_irda.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash.o - $PROJ_DIR$\Debug\Obj\lib_str.o - $PROJ_DIR$\Debug\Obj\os_flag.o - $PROJ_DIR$\Debug\Obj\os_dbg.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nand.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_adc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_msp.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cec.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_iwdg.xcl - $PROJ_DIR$\Debug\Obj\os_core.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s.o $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_crc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_utils.o - $PROJ_DIR$\Debug\Obj\plsr_param.xcl - $PROJ_DIR$\Debug\Obj\os_cpu_c.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usb.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma2d.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_usart.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_gpio.o $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc.xcl - $PROJ_DIR$\Debug\Obj\cpu_a.o - $PROJ_DIR$\Debug\Obj\plsr_accel_curve.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_i2c.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c_ex.o + $TOOLKIT_DIR$\inc\c\yvals.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_gpio.o $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac_ex.xcl - $PROJ_DIR$\Debug\Obj\lib_ascii.o - $PROJ_DIR$\Debug\Obj\os_core.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hcd.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_eth.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ramfunc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dac.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_gpio.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr.o - $TOOLKIT_DIR$\inc\c\DLib_Config_Full.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smartcard.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmc.o + $PROJ_DIR$\Debug\Obj\os_mutex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma2d.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc.o $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma.xcl - $PROJ_DIR$\Debug\Obj\os_dbg.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_adc.xcl - $PROJ_DIR$\Debug\Obj\tim.xcl - $TOOLKIT_DIR$\inc\c\stdint.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fsmc.xcl - $PROJ_DIR$\Debug\Obj\modbus_rtu.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_wwdg.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma.o + $PROJ_DIR$\Debug\Obj\os_core.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd.o + $PROJ_DIR$\Debug\Obj\plsr_persist.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spi.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_lptim.xcl + $PROJ_DIR$\Debug\Obj\lib_math.xcl $PROJ_DIR$\Debug\Obj\os_mem.xcl - $PROJ_DIR$\Debug\Obj\os_task.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rng.xcl - $PROJ_DIR$\Debug\Obj\plsr_pulse_driver.xcl + $PROJ_DIR$\Debug\Obj\os_sem.o + $PROJ_DIR$\Debug\Obj\lib_ascii.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c.xcl + $PROJ_DIR$\Debug\Obj\os_mbox.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usart.xcl + $PROJ_DIR$\Debug\Obj\os_flag.o + $PROJ_DIR$\Debug\Obj\gpio.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_tim.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash_ex.xcl + $TOOLKIT_DIR$\lib\rt7M_tl.a $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dfsdm.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_gpio.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp.xcl - $PROJ_DIR$\Debug\Obj\lib_mem_a.o - $TOOLKIT_DIR$\inc\c\DLib_Product_string.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dfsdm.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smbus.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_can.xcl - $PROJ_DIR$\Debug\Obj\modbus_rtu.xcl - $TOOLKIT_DIR$\inc\c\DLib_Product.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spi.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sram.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_irda.xcl + $PROJ_DIR$\Debug\Obj\plsr.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus.xcl + $PROJ_DIR$\Debug\List\plsr.map + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_iwdg.o + $PROJ_DIR$\Debug\Obj\modbus_rtu.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_eth.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dac.xcl + $PROJ_DIR$\Debug\Obj\plsr_pulse_driver.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nand.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_crc.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_spi.o + $PROJ_DIR$\Debug\Obj\os_tmr.o $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi.xcl - $PROJ_DIR$\Debug\Obj\plsr_signal_io.o - $PROJ_DIR$\Debug\Obj\os_cpu_c.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_exti.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_qspi.xcl - $PROJ_DIR$\Debug\Obj\os_mbox.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_wwdg.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmpi2c.o - $PROJ_DIR$\Debug\Obj\os_mutex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc.o - $TOOLKIT_DIR$\lib\dl7M_tln.a - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cortex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spdifrx.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usb.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai.o - $TOOLKIT_DIR$\inc\c\iccarm_builtin.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c.xcl - $PROJ_DIR$\Debug\Obj\plsr_persist.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr_ex.xcl - $PROJ_DIR$\Debug\Obj\os_time.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ex.o $PROJ_DIR$\Debug\Obj\gpio.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c.o + $PROJ_DIR$\Debug\Obj\lib_math.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_msp.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sd.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac_ex.o + $PROJ_DIR$\Debug\Obj\cpu_core.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rtc.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_i2c.xcl $PROJ_DIR$\Debug\Obj\stm32f4xx_it.xcl - $PROJ_DIR$\Debug\Obj\os_q.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus.xcl - $PROJ_DIR$\Debug\Obj\usart.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_sdmmc.o $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rng.o $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cec.o - $PROJ_DIR$\Debug\Obj\lib_str.xcl - $PROJ_DIR$\Debug\Obj\cpu_core.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim_ex.o + $PROJ_DIR$\Debug\Obj\lib_str.o + $TOOLKIT_DIR$\inc\c\stdint.h $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rcc.xcl + $PROJ_DIR$\Debug\Obj\os_cpu_c.o + $TOOLKIT_DIR$\inc\c\iar_intrinsics_common.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_crc.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cec.xcl $PROJ_DIR$\Debug\Obj\app_hooks.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_exti.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc.o - $PROJ_DIR$\Debug\Obj\os_time.o - $PROJ_DIR$\Debug\Obj\os_tmr.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nand.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_pwr.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pccard.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usart.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nor.xcl - $PROJ_DIR$\Debug\Obj\plsr_persist.xcl + $TOOLKIT_DIR$\inc\c\string.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_exti.o + $PROJ_DIR$\Debug\Obj\modbus_rtu.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pccard.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_crc.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_timebase_tim.xcl $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fsmc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_can.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_sdmmc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim.xcl - $PROJ_DIR$\Debug\Obj\plsr_command.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus.o - $PROJ_DIR$\Debug\Obj\cpu_core.xcl - $PROJ_DIR$\Debug\Obj\main.xcl + $PROJ_DIR$\Debug\Obj\lib_mem_a.o $PROJ_DIR$\Debug\Obj\stm32f4xx_hal.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_iwdg.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_gpio.xcl - $TOOLKIT_DIR$\lib\m7M_tls.a - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_usart.o - $PROJ_DIR$\Debug\Obj\lib_math.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_usart.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_utils.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sd.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rcc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dsi.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai_ex.xcl - $TOOLKIT_DIR$\inc\c\string.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_crc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_exti.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma2d.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmpi2c.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_gpio.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spdifrx.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_spi.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_uart.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dac.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_utils.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s.o + $TOOLKIT_DIR$\lib\dl7M_tln.a + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc_ex.o + $TOOLKIT_DIR$\inc\c\stddef.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_wwdg.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rtc.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spdifrx.xcl + $PROJ_DIR$\Debug\Obj\os_mem.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_sdmmc.o $PROJ_DIR$\Debug\Obj\main.o + $PROJ_DIR$\Debug\Exe\plsr.hex + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_i2c.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_msp.o + $PROJ_DIR$\Debug\Obj\os_time.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_gpio.xcl + $PROJ_DIR$\Debug\Obj\main.xcl + $PROJ_DIR$\Debug\Obj\plsr_run_control.xcl + $PROJ_DIR$\Debug\Obj\plsr_command.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spdifrx.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ramfunc.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s_ex.xcl + $PROJ_DIR$\Debug\Obj\plsr.pbd + $PROJ_DIR$\Debug\Obj\plsr_accel_curve.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_it.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_irda.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma.o + $PROJ_DIR$\Debug\Obj\plsr_param.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rng.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_iwdg.xcl + $PROJ_DIR$\Debug\Obj\os_tmr.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_wwdg.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_lptim.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dfsdm.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_mmc.o + $PROJ_DIR$\Debug\Obj\os_mbox.xcl + $PROJ_DIR$\Debug\Obj\cpu_c.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc_ex.xcl + $PROJ_DIR$\Debug\Obj\os_flag.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rng.xcl + $TOOLKIT_DIR$\inc\c\iccarm_builtin.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dsi.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp.xcl $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_pwr.o + $PROJ_DIR$\Debug\Exe\plsr.out + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cortex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_lptim.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma2d.o $PROJ_DIR$\Debug\Obj\os_cpu_a.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hcd.o - $PROJ_DIR$\apm32f407xg_flash.icf - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_tim.xcl - $PROJ_DIR$\Debug\Obj\lib_ascii.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_spi.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_timebase_tim.xcl - $PROJ_DIR$\Debug\Obj\os_tmr.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma.o - $PROJ_DIR$\Debug\Obj\os_flag.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd.xcl - $PROJ_DIR$\Debug\Obj\gpio.xcl - $TOOLKIT_DIR$\lib\rt7M_tl.a - $PROJ_DIR$\Debug\Obj\plsr_run_control.xcl - $PROJ_DIR$\Debug\Obj\os_mbox.o - $TOOLKIT_DIR$\inc\c\intrinsics.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sram.o - $PROJ_DIR$\Debug\Obj\startup_stm32f407xx.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmc.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc_ex.o - $PROJ_DIR$\Debug\Obj\tim.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_irda.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ramfunc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usart.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash.o - $PROJ_DIR$\Debug\Obj\plsr.xcl - $TOOLKIT_DIR$\inc\c\stddef.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_mmc.o - $PROJ_DIR$\Debug\Obj\plsr.pbd - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash.xcl - $PROJ_DIR$\Debug\Obj\usart.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sdram.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_lptim.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp_ex.xcl + $PROJ_DIR$\Debug\Obj\plsr_command.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_usart.o $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_tim.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac_ex.o - $PROJ_DIR$\Debug\Obj\plsr_pulse_driver.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smartcard.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp_ex.o + $PROJ_DIR$\Debug\Obj\plsr_run_control.o + $TOOLKIT_DIR$\inc\c\intrinsics.h $PROJ_DIR$\Debug\Obj\system_stm32f4xx.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim_ex.o - $PROJ_DIR$\Debug\Obj\system_stm32f4xx.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pccard.o - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_flash_ramfunc.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_dma_ex.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_gpio.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_flash.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_exti.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_flash_ex.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_gpio_ex.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_tim.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_tim_ex.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_it.h + $PROJ_DIR$\Debug\Obj\plsr_signal_io.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_qspi.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc.o + $PROJ_DIR$\Debug\Obj\os_task.xcl + $PROJ_DIR$\Debug\Obj\plsr_accel_curve.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sd.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hcd.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc.xcl + $PROJ_DIR$\Debug\Obj\plsr_persist.xcl + $PROJ_DIR$\Debug\Obj\tim.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usart.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hcd.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_timebase_tim.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_exti.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cortex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash.__cstat.et + $PROJ_DIR$\Debug\Obj\cpu_c.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ramfunc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_eth.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_adc.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usb.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_utils.xcl + $PROJ_DIR$\Debug\Obj\os_cpu_c.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c_ex.__cstat.et + $TOOLKIT_DIR$\inc\c\DLib_Defaults.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\lib_mem.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_exti.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_irda.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nor.o + $PROJ_DIR$\Debug\Obj\os_dbg.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rcc.o + $PROJ_DIR$\Debug\Obj\lib_str.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\os_time.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc_ex.o + $PROJ_DIR$\Debug\Obj\os_mutex.__cstat.et + $PROJ_DIR$\Debug\Obj\cpu_c.__cstat.et + $PROJ_DIR$\Debug\Obj\os_tmr.__cstat.et + $PROJ_DIR$\Debug\Obj\lib_math.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_lptim.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c.__cstat.et + $PROJ_DIR$\Debug\Obj\os_mbox.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\os_task.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_msp.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_gpio.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dsi.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_mmc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dfsdm.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma2d.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus.__cstat.et + $PROJ_DIR$\Debug\Obj\os_dbg.__cstat.et + $PROJ_DIR$\Debug\Obj\os_mem.__cstat.et + $PROJ_DIR$\Debug\Obj\os_q.__cstat.et + $PROJ_DIR$\Debug\Obj\lib_ascii.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_iwdg.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nand.__cstat.et + $PROJ_DIR$\Debug\Obj\os_time.__cstat.et + $PROJ_DIR$\Debug\Obj\os_sem.__cstat.et + $PROJ_DIR$\Debug\Obj\cpu_core.__cstat.et + $PROJ_DIR$\Debug\Obj\lib_mem.__cstat.et + $PROJ_DIR$\Debug\Obj\os_core.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sd.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nor.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_uart.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_it.__cstat.et + $PROJ_DIR$\Debug\Obj\app_hooks.__cstat.et + $PROJ_DIR$\Debug\Obj\os_flag.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_usart.__cstat.et + $PROJ_DIR$\Debug\Obj\lib_str.__cstat.et + $PROJ_DIR$\Debug\Obj\os_cpu_c.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_adc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rng.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sram.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_timebase_tim.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pccard.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_qspi.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smbus.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spdifrx.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smartcard.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sdram.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_wwdg.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spi.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_i2c.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr_persist.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr_command.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dac.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fsmc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_spi.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr_run_control.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_sdmmc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmpi2c.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_crc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_gpio.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr_param.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma2d.__cstat.et + $PROJ_DIR$\Debug\Obj\tim.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr_signal_io.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_utils.__cstat.et + $PROJ_DIR$\Debug\Obj\usart.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_exti.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_pwr.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_lptim.__cstat.et + $PROJ_DIR$\Debug\Obj\modbus_rtu.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr_accel_curve.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr_pulse_driver.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rtc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rng.__cstat.et + $PROJ_DIR$\Debug\Obj\plsr.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_tim.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rcc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_crc.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\main.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cec.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_can.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi.__cstat.et + $PROJ_DIR$\Debug\Obj\gpio.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usart.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usb.__cstat.et + $PROJ_DIR$\Debug\Obj\system_stm32f4xx.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp_ex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cortex.__cstat.et + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cryp.__cstat.et $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_rcc.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_tim_ex.h $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_uart.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_rcc_ex.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_it.h $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_pwr_ex.h $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_pwr.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_rcc_ex.h - $PROJ_DIR$\..\drivers\Include\tim.h - $PROJ_DIR$\..\drivers\Include\stm32f4xx_ll_utils.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_tim.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_def.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_dma.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_flash.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_flash_ex.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_flash_ramfunc.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_gpio.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_exti.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_dma_ex.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_hal_gpio_ex.h $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal.c - $PROJ_DIR$\..\drivers\Include\usart.h - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cec.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cortex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp_ex.c $PROJ_DIR$\..\drivers\Source\gpio.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_crc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc_ex.c $PROJ_DIR$\..\drivers\Include\stm32f4xx_ll_system.h - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp.c $PROJ_DIR$\..\drivers\Include\stm32f4xx_ll_pwr.h + $PROJ_DIR$\..\drivers\Include\stm32f4xx_ll_utils.h $PROJ_DIR$\..\drivers\Include\stm32f4xx_ll_rcc.h - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_can.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_eth.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hash_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi.c + $PROJ_DIR$\..\drivers\Include\tim.h + $PROJ_DIR$\..\drivers\Include\usart.h + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_exti.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dsi.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash_ramfunc.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_irda.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_iwdg.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac_ex.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpsmbus.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpsmbus_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dfsdm.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_exti.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_eth.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hash.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2c.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_lptim.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hcd.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_crc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dfsdm.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma2d.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_mmc.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_gpio.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash_ramfunc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hash_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hcd.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2c.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2c_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_can.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cec.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cortex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp_ex.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_it.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_adc.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sd.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spdifrx.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pcd.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi_ex.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pwr_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sai_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nor.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_qspi.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rcc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_lptim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pwr.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spi.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sd.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nand.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rtc_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_smbus.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sdram.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_msp.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_mmc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rcc_ex.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sai.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_smartcard.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pccard.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_iwdg.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_smbus.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_irda.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spdifrx.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sram.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_qspi.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pwr.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_uart.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rng.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rtc.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_tim.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_tim_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_msp.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sdram.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nand.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pccard.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rcc_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sai_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spi.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pcd_ex.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_timebase_tim.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_usart.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nor.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pcd.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rng.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rtc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_exti.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmpi2c.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rng.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dac.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fsmc.c $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_wwdg.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_spi.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_crc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_tim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_utils.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_lptim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_pwr.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_adc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rcc.c + $PROJ_DIR$\..\drivers\Source\system_stm32f4xx.c + $PROJ_DIR$\..\drivers\Source\tim.c + $PROJ_DIR$\..\drivers\Source\usart.c + $PROJ_DIR$\startup_stm32f407xx.s + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_uart.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_usart.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_timebase_tim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma2d.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_i2c.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usb.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_it.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_sdmmc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usart.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_gpio.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rtc.c $PROJ_DIR$\..\ucos\uC-CPU\cpu_core.c - $PROJ_DIR$\..\ucos\uC-LIB\Ports\lib_mem_a.asm - $PROJ_DIR$\..\plsr\plsr.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_ascii.h + $PROJ_DIR$\..\plsr\run_control\plsr_run_control.c + $PROJ_DIR$\..\plsr\signal_io\plsr_signal_io.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_cfg.h + $PROJ_DIR$\..\ucos\uC-LIB\lib_def.h $PROJ_DIR$\..\ucos\uC-LIB\app_cfg.h + $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.h $PROJ_DIR$\..\plsr\persist\plsr_persist.c - $PROJ_DIR$\..\ucos\uC-LIB\app_hooks.c + $PROJ_DIR$\..\plsr\persist\plsr_persist.h + $PROJ_DIR$\..\plsr\pulse_driver\plsr_pulse_driver.h + $PROJ_DIR$\..\plsr\run_control\plsr_run_control.h + $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.c $PROJ_DIR$\..\plsr\pulse_driver\plsr_pulse_driver.c - $PROJ_DIR$\..\ucos\uC-CPU\cpu_a.asm - $PROJ_DIR$\..\ucos\uC-CPU\cpu_core.h - $PROJ_DIR$\..\ucos\uC-LIB\lib_ascii.c $PROJ_DIR$\..\plsr\plsr.h - $PROJ_DIR$\..\plsr\path_plan\plsr_path_plan.c - $PROJ_DIR$\..\plsr\run_control\plsr_run_control.h - $PROJ_DIR$\..\ucos\uC-LIB\lib_cfg.h - $PROJ_DIR$\..\plsr\signal_io\plsr_signal_io.c + $PROJ_DIR$\..\modbus\modbus_rtu.h $PROJ_DIR$\..\ucos\uC-CPU\cpu.h - $PROJ_DIR$\..\plsr\path_plan\plsr_path_plan.h - $PROJ_DIR$\..\ucos\uC-LIB\lib_ascii.h $PROJ_DIR$\..\ucos\uC-CPU\cpu_c.c - $PROJ_DIR$\..\ucos\uC-LIB\lib_def.h - $PROJ_DIR$\..\plsr\persist\plsr_persist.h - $PROJ_DIR$\..\ucos\uC-CPU\cpu_def.h - $PROJ_DIR$\..\ucos\uC-LIB\lib_math.c - $PROJ_DIR$\..\ucos\uC-LIB\lib_math.h - $PROJ_DIR$\..\ucos\uC-LIB\lib_mem.c - $PROJ_DIR$\..\ucos\uC-LIB\lib_mem.h $PROJ_DIR$\..\plsr\param\plsr_param.h - $PROJ_DIR$\..\plsr\param\plsr_param.c - $PROJ_DIR$\..\plsr\run_control\plsr_run_control.c + $PROJ_DIR$\..\plsr\plsr.c + $PROJ_DIR$\..\ucos\uC-CPU\cpu_a.asm + $PROJ_DIR$\..\ucos\uC-CPU\cpu_core.h + $PROJ_DIR$\..\ucos\uC-CPU\cpu_def.h $PROJ_DIR$\..\ucos\uC-LIB\cpu_cfg.h - $PROJ_DIR$\..\plsr\pulse_driver\plsr_pulse_driver.h + $PROJ_DIR$\..\plsr\command\plsr_command.c $PROJ_DIR$\..\plsr\signal_io\plsr_signal_io.h - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rng.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usb.c - $PROJ_DIR$\..\drivers\Source\usart.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma2d.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_i2c.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_sdmmc.c - $PROJ_DIR$\startup_stm32f407xx.s - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rcc.c - $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.h $PROJ_DIR$\..\plsr\command\plsr_command.h - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmpi2c.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_crc.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_tim.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmc.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usart.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_spi.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_exti.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rtc.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_utils.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_gpio.c $PROJ_DIR$\..\modbus\modbus_rtu.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma.c - $PROJ_DIR$\..\drivers\Source\system_stm32f4xx.c - $PROJ_DIR$\..\modbus\modbus_rtu.h - $PROJ_DIR$\..\drivers\Source\tim.c - $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.c - $PROJ_DIR$\..\plsr\command\plsr_command.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dac.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_pwr.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_lptim.c - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fsmc.c - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_sem.c - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_task.c - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_time.c - $PROJ_DIR$\..\ucos\uCOS-II\Source\ucos_ii.h - $PROJ_DIR$\Debug\Obj\app_hooks.xcl - $PROJ_DIR$\..\ucos\uC-LIB\lib_str.c + $PROJ_DIR$\..\plsr\param\plsr_param.c + $PROJ_DIR$\..\ucos\uC-LIB\Ports\lib_mem_a.asm + $PROJ_DIR$\..\ucos\uC-LIB\app_hooks.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_ascii.c $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mutex.c - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_qspi.o - $PROJ_DIR$\Debug\Obj\plsr_path_plan.o - $TOOLKIT_DIR$\inc\c\DLib_Defaults.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smartcard.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_uart.xcl - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mem.c - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rtc_ex.xcl - $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu.h - $PROJ_DIR$\Debug\Obj\plsr_accel_curve.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_timebase_tim.o - $PROJ_DIR$\..\ucos\uC-LIB\lib_str.h $PROJ_DIR$\..\ucos\uCOS-II\Source\os_tmr.c - $PROJ_DIR$\Debug\Obj\plsr_command.xcl - $PROJ_DIR$\..\ucos\uC-LIB\os_cfg.h + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_q.c + $PROJ_DIR$\Debug\Obj\os_q.xcl + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_time.c + $TOOLKIT_DIR$\inc\c\ycheck.h + $PROJ_DIR$\..\ucos\uC-LIB\lib_math.c + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sdram.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma_ex.o + $PROJ_DIR$\..\ucos\uC-LIB\lib_math.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_dma2d.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma2d.xcl $PROJ_DIR$\..\ucos\uCOS-II\Source\os_flag.c + $PROJ_DIR$\..\ucos\uC-LIB\os_cfg.h + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_task.c + $PROJ_DIR$\Debug\Obj\os_mutex.xcl + $PROJ_DIR$\..\ucos\uC-LIB\lib_mem.h $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu_a.asm - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_core.c - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mbox.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_mem.c $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu_c.c $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_dbg.c - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_q.c - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus_ex.xcl - $PROJ_DIR$\Debug\Obj\cpu_c.xcl - $PROJ_DIR$\Debug\Exe\plsr.out - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spi.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rng.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dsi.xcl - $PROJ_DIR$\Debug\Obj\os_mutex.o - $TOOLKIT_DIR$\lib\shb_l.a - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc_ex.xcl - $PROJ_DIR$\Debug\List\plsr.map - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_cortex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_adc_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_crc.xcl + $PROJ_DIR$\..\ucos\uCOS-II\Source\ucos_ii.h + $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu.h + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_core.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_sem.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_str.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mbox.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mem.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_str.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash.o $TOOLKIT_DIR$\inc\c\ysizet.h - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c_ex.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_lptim.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2s_ex.xcl - $PROJ_DIR$\Debug\Obj\os_q.xcl - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sd.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_exti.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hcd.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_adc.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi_ex.xcl + $PROJ_DIR$\Debug\Obj\plsr_signal_io.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_spi.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dac.o $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_mmc.xcl - $PROJ_DIR$\Debug\Obj\os_mem.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_exti.o - $PROJ_DIR$\Debug\Exe\plsr.hex + $PROJ_DIR$\Debug\Obj\os_task.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_eth.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma.xcl + $PROJ_DIR$\Debug\Obj\app_hooks.xcl $PROJ_DIR$\Debug\Obj\os_sem.xcl - $PROJ_DIR$\Debug\Obj\plsr.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_rcc.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_flash_ex.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sdram.o - $PROJ_DIR$\Debug\Obj\cpu_c.o - $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_nand.o + $PROJ_DIR$\Debug\Obj\plsr.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpsmbus.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_usb.o + $PROJ_DIR$\Debug\Obj\usart.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmpi2c.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dma.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rcc.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_exti.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smbus.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fsmc.xcl + $PROJ_DIR$\Debug\Obj\plsr_pulse_driver.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_fmpi2c_ex.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sram.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_rng.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sdram.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smartcard.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_ltdc_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pwr_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_i2c_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_tim.xcl + $TOOLKIT_DIR$\inc\c\DLib_Product_string.h + $PROJ_DIR$\Debug\Obj\startup_stm32f407xx.o + $PROJ_DIR$\Debug\Obj\os_core.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_pwr.xcl + $PROJ_DIR$\Debug\Obj\tim.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_can.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_sai_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_gpio.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dcmi.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd_ex.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_qspi.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_dsi.o + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_hash.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pccard.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_pcd_ex.o + $TOOLKIT_DIR$\lib\m7M_tls.a + $TOOLKIT_DIR$\inc\c\DLib_Product.h + $PROJ_DIR$\Debug\Obj\stm32f4xx_hal_smbus.o + $PROJ_DIR$\Debug\Obj\cpu_core.xcl + $PROJ_DIR$\Debug\Obj\stm32f4xx_ll_fmc.xcl [ROOT_NODE] ILINK - 444 452 + 181 80 @@ -493,17 +615,40 @@ BICOMP - 183 + 150 ICCARM - 204 + 144 + + + __cstat + 339 ICCARM - 14 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 273 6 415 352 364 222 52 370 378 434 427 404 270 359 375 + 14 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 375 10 524 477 487 191 116 493 494 516 525 486 374 485 489 + + + + + $PROJ_DIR$\Debug\Exe\plsr.out + + + OBJCOPY + 145 + + + ILINK + 80 + + + + + ILINK + 30 120 33 212 103 95 20 98 223 128 111 144 82 52 185 115 24 67 64 142 48 32 61 546 148 92 78 157 187 37 56 88 190 193 573 580 196 137 578 109 182 38 217 19 544 102 582 31 75 557 184 511 586 84 537 534 94 23 542 563 553 209 40 163 200 201 97 42 135 101 159 81 36 50 118 171 147 551 229 124 55 589 54 168 194 558 28 565 45 237 532 83 199 510 46 592 153 57 564 533 110 207 131 188 139 158 215 125 132 160 513 122 47 556 127 44 146 183 180 232 108 104 143 91 189 205 554 134 22 576 555 35 74 590 136 @@ -512,2102 +657,2516 @@ BICOMP - 184 + 129 ICCARM - 83 + 580 + + + __cstat + 334 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc_ex.c + $PROJ_DIR$\..\drivers\Source\gpio.c BICOMP - 161 + 68 ICCARM - 454 + 95 + + + __cstat + 343 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 10 14 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cec.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc_ex.c BICOMP - 67 + 69 ICCARM - 156 + 137 + + + __cstat + 335 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cortex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc.c BICOMP - 453 + 202 ICCARM - 135 + 196 + + + __cstat + 333 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp.c BICOMP - 138 + 179 ICCARM - 250 + 217 + + + __cstat + 349 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\gpio.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_exti.c BICOMP - 218 + 224 ICCARM - 149 + 537 + + + __cstat + 208 ICCARM - 6 14 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_crc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dsi.c BICOMP - 198 + 178 ICCARM - 71 + 586 + + + __cstat + 251 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_adc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash_ramfunc.c BICOMP - 170 + 154 ICCARM - 429 + 23 + + + __cstat + 213 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash_ex.c BICOMP - 114 + 53 ICCARM - 140 + 94 + + + __cstat + 252 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_can.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c.c BICOMP - 119 + 65 ICCARM - 176 + 542 + + + __cstat + 244 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_eth.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c_ex.c BICOMP - 46 + 164 ICCARM - 89 + 563 + + + __cstat + 220 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac_ex.c BICOMP - 76 + 26 ICCARM - 70 + 102 + + + __cstat + 338 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hash_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpsmbus.c BICOMP - 56 + 79 ICCARM - 93 + 553 + + + __cstat + 258 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpsmbus_ex.c BICOMP - 136 + 195 ICCARM - 91 + 209 + + + __cstat + 231 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_eth.c BICOMP - 123 + 547 ICCARM - 141 + 84 + + + __cstat + 214 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dsi.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash.c BICOMP - 448 + 96 ICCARM - 195 + 534 + + + __cstat + 211 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hash.c BICOMP - 85 + 587 ICCARM - 247 + 163 + + + __cstat + 236 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_crc.c BICOMP - 242 + 90 ICCARM - 235 + 38 + + + __cstat + 337 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dac.c BICOMP - 41 + 70 ICCARM - 469 + 544 + + + __cstat + 336 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dfsdm.c BICOMP - 459 + 170 ICCARM - 234 + 75 + + + __cstat + 255 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_irda.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma2d.c BICOMP - 231 + 514 ICCARM - 57 + 184 + + + __cstat + 256 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_iwdg.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_gpio.c BICOMP - 68 + 149 ICCARM - 185 + 40 + + + __cstat + 249 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpsmbus.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hash_ex.c BICOMP - 152 + 73 ICCARM - 181 + 200 + + + __cstat + 250 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpsmbus_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hcd.c BICOMP - 442 + 538 ICCARM - 472 + 201 + + + __cstat + 206 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2c.c BICOMP - 42 + 63 ICCARM - 216 + 97 + + + __cstat + 225 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2c_ex.c BICOMP - 228 + 570 ICCARM - 144 + 42 + + + __cstat + 234 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dfsdm.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s.c BICOMP - 117 + 85 ICCARM - 112 + 135 + + + __cstat + 227 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_exti.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_can.c BICOMP - 126 + 25 ICCARM - 163 + 578 + + + __cstat + 341 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hash.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cec.c BICOMP - 425 + 119 ICCARM - 59 + 109 + + + __cstat + 340 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2c.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cortex.c BICOMP - 145 + 210 ICCARM - 239 + 182 + + + __cstat + 348 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_lptim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi.c BICOMP - 245 + 93 ICCARM - 21 + 582 + + + __cstat + 342 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_hcd.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_cryp_ex.c BICOMP - 88 + 186 ICCARM - 207 + 19 + + + __cstat + 347 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma.c BICOMP - 92 + 548 ICCARM - 164 + 557 + + + __cstat + 228 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_fmpi2c_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma_ex.c BICOMP - 457 + 71 ICCARM - 445 + 511 + + + __cstat + 257 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dcmi_ex.c BICOMP - 180 + 540 ICCARM - 229 + 31 + + + __cstat + 222 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma2d.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pwr_ex.c BICOMP - 35 + 569 ICCARM - 45 + 168 + + + __cstat + 289 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_mmc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sai_ex.c BICOMP - 462 + 579 ICCARM - 240 + 83 + + + __cstat + 325 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_gpio.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2s_ex.c BICOMP - 113 + 155 ICCARM - 95 + 101 + + + __cstat + 246 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_flash_ramfunc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nor.c BICOMP - 90 + 34 ICCARM - 232 + 229 + + + __cstat + 271 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_i2c_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_qspi.c BICOMP - 58 + 585 + + + ICCARM + 194 - ICCARM - 55 + __cstat + 294 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rcc.c BICOMP - 224 + 41 ICCARM - 19 + 558 + + + __cstat + 284 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_dma.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_lptim.c BICOMP - 175 + 58 ICCARM - 107 + 36 + + + __cstat + 243 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_it.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pwr.c BICOMP - 150 + 536 ICCARM 54 + + __cstat + 277 + ICCARM - 14 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 264 415 352 364 222 52 370 378 434 427 380 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_adc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spi.c BICOMP - 100 + 543 ICCARM - 64 + 57 + + + __cstat + 301 + + + ICCARM + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 + + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sd.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc_ex.c BICOMP - 461 + 568 ICCARM - 193 + 118 + + + __cstat + 253 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spdifrx.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sd.c BICOMP - 137 + 100 ICCARM - 203 + 199 + + + __cstat + 270 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pcd.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nand.c BICOMP - 217 + 89 ICCARM - 27 + 551 + + + __cstat + 264 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pwr_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rtc_ex.c BICOMP - 147 + 133 ICCARM - 30 + 237 + + + __cstat + 293 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rcc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sdram.c BICOMP - 79 + 566 ICCARM - 133 + 510 + + + __cstat + 299 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rtc_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_msp.c BICOMP - 426 + 99 ICCARM - 188 + 147 + + + __cstat + 248 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 14 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_smbus.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_ltdc.c BICOMP - 40 + 105 ICCARM - 118 + 50 + + + __cstat + 242 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sai.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_mmc.c BICOMP - 238 + 545 ICCARM - 142 + 171 + + + __cstat + 254 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_smartcard.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rcc_ex.c BICOMP - 249 + 174 ICCARM - 422 + 28 + + + __cstat + 288 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sram.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sai.c BICOMP - 38 + 577 ICCARM - 225 + 532 + + + __cstat + 278 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_qspi.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_smartcard.c BICOMP - 128 + 567 ICCARM - 419 + 46 + + + __cstat + 298 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pwr.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pccard.c BICOMP - 105 + 588 ICCARM - 96 + 124 + + + __cstat + 292 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_uart.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_iwdg.c BICOMP - 423 + 165 ICCARM - 23 + 81 + + + __cstat + 263 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rng.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_smbus.c BICOMP - 447 + 560 ICCARM - 29 + 592 + + + __cstat + 295 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rtc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_irda.c BICOMP - 159 + 77 ICCARM - 84 + 159 + + + __cstat + 226 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_tim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spdifrx.c BICOMP - 178 + 141 ICCARM - 127 + 153 + + + __cstat + 296 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_tim_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sram.c BICOMP - 65 + 76 ICCARM - 252 + 564 + + + __cstat + 290 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_msp.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_tim.c BICOMP - 66 + 571 ICCARM - 31 + 533 + + + __cstat + 297 ICCARM - 14 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sdram.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_tim_ex.c BICOMP - 244 + 86 ICCARM - 470 + 110 + + + __cstat + 272 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nand.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pcd_ex.c BICOMP - 63 + 584 ICCARM - 167 + 589 + + + __cstat + 279 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pccard.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pcd.c BICOMP - 169 + 583 ICCARM - 254 + 55 + + + __cstat + 286 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rcc_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rng.c BICOMP - 451 + 176 ICCARM - 75 + 565 + + + __cstat + 287 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_sai_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_rtc.c BICOMP - 196 + 113 ICCARM - 39 + 45 + + + __cstat + 285 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_spi.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma.c BICOMP - 446 + 51 ICCARM - 122 + 160 - - - ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + __cstat + 302 - + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_pcd_ex.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_exti.c BICOMP - 49 + 559 ICCARM - 223 + 122 - - - ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + __cstat + 320 - + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_timebase_tim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmpi2c.c BICOMP - 212 + 18 ICCARM - 430 + 556 + + + __cstat + 311 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_usart.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rng.c BICOMP - 191 + 162 ICCARM - 189 + 108 - - - ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + __cstat + 329 - + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_nor.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dac.c BICOMP - 172 + 87 ICCARM - 22 + 132 - - - ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + __cstat + 306 - + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_wwdg.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fsmc.c BICOMP - 130 + 561 ICCARM - 106 + 127 + + + __cstat + 307 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\ucos\uC-CPU\cpu_core.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_wwdg.c BICOMP - 182 + 167 ICCARM - 158 + 139 + + + __cstat + 300 ICCARM - 357 364 222 143 36 421 97 121 52 370 378 368 374 362 431 366 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\ucos\uC-LIB\Ports\lib_mem_a.asm + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_spi.c - AARM - 115 + BICOMP + 130 + + + ICCARM + 91 + + + __cstat + 308 - $PROJ_DIR$\..\plsr\plsr.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_crc.c BICOMP - 236 + 117 ICCARM - 467 + 125 - - - ICCARM - 359 102 51 36 421 97 121 375 379 4 13 265 9 1 8 7 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 361 369 390 380 415 352 364 222 52 370 378 434 427 + __cstat + 312 - + - $PROJ_DIR$\..\plsr\persist\plsr_persist.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_tim.c BICOMP - 173 + 72 ICCARM - 146 + 189 - - - ICCARM - 369 102 51 36 421 97 121 375 361 4 13 265 9 1 8 7 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 197 116 + __cstat + 331 - + - $PROJ_DIR$\..\ucos\uC-LIB\app_hooks.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_utils.c BICOMP - 416 + 218 ICCARM - 162 + 134 + + + __cstat + 318 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 4 13 265 9 1 8 7 102 51 12 15 11 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 372 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 2 1 350 358 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 373 370 371 - $PROJ_DIR$\..\plsr\pulse_driver\plsr_pulse_driver.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_lptim.c BICOMP - 111 + 169 ICCARM - 248 + 183 - - - ICCARM - 379 102 51 36 421 97 121 4 13 265 9 1 8 7 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 375 14 + __cstat + 322 - + - $PROJ_DIR$\..\ucos\uC-CPU\cpu_a.asm + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_pwr.c - AARM - 80 + BICOMP + 575 + + + ICCARM + 180 + + + __cstat + 321 - $PROJ_DIR$\..\ucos\uC-LIB\lib_ascii.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_adc.c BICOMP - 210 + 539 ICCARM - 86 + 215 - - - ICCARM - 366 364 222 143 36 421 97 121 52 370 378 368 + __cstat + 283 - + - $PROJ_DIR$\..\plsr\path_plan\plsr_path_plan.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rcc.c BICOMP - 25 + 114 ICCARM - 420 + 232 - - - ICCARM - 365 102 51 36 421 97 121 375 + __cstat + 332 - + - $PROJ_DIR$\..\plsr\signal_io\plsr_signal_io.c + $PROJ_DIR$\..\drivers\Source\system_stm32f4xx.c BICOMP - 34 + 192 ICCARM - 124 + 22 + + + __cstat + 346 ICCARM - 380 102 51 36 421 97 121 375 361 14 4 13 265 9 1 8 7 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 2 1 350 358 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\ucos\uC-CPU\cpu_c.c + $PROJ_DIR$\..\drivers\Source\tim.c BICOMP - 443 + 204 ICCARM - 471 + 576 + + + __cstat + 316 ICCARM - 364 222 143 36 421 97 121 52 370 378 357 368 374 362 431 366 + 374 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 14 - $PROJ_DIR$\..\ucos\uC-LIB\lib_math.c + $PROJ_DIR$\..\drivers\Source\usart.c BICOMP - 190 + 21 ICCARM - 47 + 555 + + + __cstat + 319 ICCARM - 372 364 222 143 36 421 97 121 52 370 378 357 368 374 362 431 366 + 375 14 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\ucos\uC-LIB\lib_mem.c + $PROJ_DIR$\startup_stm32f407xx.s + + + AARM + 573 + + + + + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_uart.c BICOMP - 44 + 17 ICCARM - 32 + 131 + + + __cstat + 273 ICCARM - 374 364 222 143 36 421 97 121 52 370 378 357 368 431 366 362 372 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\plsr\param\plsr_param.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_usart.c BICOMP - 73 + 39 ICCARM - 28 + 188 + + + __cstat + 280 ICCARM - 375 102 51 36 421 97 121 369 404 4 13 265 9 1 8 7 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 415 352 364 222 52 370 378 434 427 197 116 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\plsr\run_control\plsr_run_control.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_hal_timebase_tim.c BICOMP - 220 + 126 ICCARM - 48 + 207 - - - ICCARM - 361 102 51 36 421 97 121 365 389 375 379 4 13 265 9 1 8 7 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 390 380 415 352 364 222 52 370 378 434 427 + __cstat + 291 - + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rng.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma2d.c BICOMP - 110 + 49 ICCARM - 155 + 513 + + + __cstat + 315 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usb.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_i2c.c BICOMP - 77 + 106 ICCARM - 139 + 146 - - - ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + __cstat + 303 - + - $PROJ_DIR$\..\drivers\Source\usart.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usb.c BICOMP - 243 + 216 ICCARM - 153 + 554 + + + __cstat + 345 ICCARM - 273 14 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma2d.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_it.c BICOMP - 200 + 107 ICCARM - 78 + 158 - - - - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_i2c.c - - BICOMP - 53 + __cstat + 274 + + ICCARM - 82 + 14 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 354 524 477 487 191 116 493 494 516 525 496 - + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_sdmmc.c BICOMP - 177 + 27 ICCARM - 154 + 143 + + + __cstat + 310 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 - $PROJ_DIR$\startup_stm32f407xx.s - - - AARM - 226 - - - - - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rcc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usart.c BICOMP - 194 + 66 ICCARM - 468 + 205 + + + __cstat + 344 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmpi2c.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmc.c BICOMP - 201 + 594 ICCARM - 131 + 47 + + + __cstat + 324 + + + ICCARM + 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 + + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_crc.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_gpio.c BICOMP - 455 + 581 ICCARM - 37 + 44 + + + __cstat + 313 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_tim.c + $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rtc.c BICOMP - 209 + 140 ICCARM - 246 + 104 + + + __cstat + 328 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fmc.c + $PROJ_DIR$\..\ucos\uC-CPU\cpu_core.c BICOMP - 227 + 593 ICCARM - 160 + 103 + + + __cstat + 267 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 492 487 191 177 43 221 16 591 116 493 494 476 519 475 531 472 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_usart.c + $PROJ_DIR$\..\plsr\run_control\plsr_run_control.c BICOMP - 233 + 151 ICCARM - 171 - - - - - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_spi.c - - - BICOMP - 211 + 190 - ICCARM - 43 + __cstat + 309 - - - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_exti.c - - - BICOMP - 199 - + ICCARM - 464 + 482 112 508 43 221 16 591 478 489 481 2 1 350 358 5 15 12 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 497 496 480 524 477 487 191 116 493 494 516 525 - + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_rtc.c + $PROJ_DIR$\..\plsr\signal_io\plsr_signal_io.c BICOMP - 50 + 541 ICCARM - 24 + 193 + + + __cstat + 317 + + + ICCARM + 496 112 508 43 221 16 591 489 482 14 2 1 350 358 5 15 12 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 524 477 487 191 116 493 494 516 525 + + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_utils.c + $PROJ_DIR$\..\plsr\persist\plsr_persist.c BICOMP - 192 + 203 ICCARM - 72 + 56 + + + __cstat + 304 ICCARM - 271 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 4 13 265 9 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 284 280 283 + 480 112 508 43 221 16 591 489 482 497 486 2 1 350 358 5 15 12 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 524 477 487 191 116 493 494 516 525 121 572 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_gpio.c + $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.c BICOMP - 186 + 198 ICCARM - 202 + 157 + + + __cstat + 326 + + + ICCARM + 478 112 508 43 221 16 591 489 + + - $PROJ_DIR$\..\modbus\modbus_rtu.c + $PROJ_DIR$\..\plsr\pulse_driver\plsr_pulse_driver.c BICOMP - 120 + 562 ICCARM - 104 + 88 + + + __cstat + 327 ICCARM - 404 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 415 352 364 222 52 370 378 434 427 197 116 359 375 379 6 14 390 + 481 112 508 43 221 16 591 2 1 350 358 5 15 12 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 489 14 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dma.c + $PROJ_DIR$\..\ucos\uC-CPU\cpu_c.c BICOMP - 98 + 173 ICCARM - 214 + 212 + + + __cstat + 239 + + + ICCARM + 487 191 177 43 221 16 591 116 493 494 492 476 519 475 531 472 + + - $PROJ_DIR$\..\drivers\Source\system_stm32f4xx.c + $PROJ_DIR$\..\plsr\plsr.c BICOMP - 251 + 552 ICCARM - 253 + 78 + + + __cstat + 330 ICCARM - 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 4 13 265 9 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 485 112 508 43 221 16 591 489 481 2 1 350 358 5 15 12 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 482 480 497 496 524 477 487 191 116 493 494 516 525 - $PROJ_DIR$\..\drivers\Source\tim.c + $PROJ_DIR$\..\ucos\uC-CPU\cpu_a.asm + + + AARM + 33 + + + + + $PROJ_DIR$\..\plsr\command\plsr_command.c BICOMP - 101 + 152 ICCARM - 230 + 187 + + + __cstat + 305 ICCARM - 270 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 14 + 497 112 508 43 221 16 591 489 482 485 480 486 2 1 350 358 5 15 12 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 524 477 487 191 116 493 494 516 525 - $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.c + $PROJ_DIR$\..\modbus\modbus_rtu.c BICOMP - 81 + 123 ICCARM - 428 + 82 + + + __cstat + 323 ICCARM - 389 102 51 36 421 97 121 375 + 486 2 1 350 358 5 15 12 112 508 43 221 16 591 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 524 477 487 191 116 493 494 516 525 121 572 485 489 481 10 14 497 - $PROJ_DIR$\..\plsr\command\plsr_command.c + $PROJ_DIR$\..\plsr\param\plsr_param.c BICOMP - 433 + 161 ICCARM - 179 + 37 + + + __cstat + 314 ICCARM - 390 102 51 36 421 97 121 375 361 359 404 4 13 265 9 1 8 7 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 415 352 364 222 52 370 378 434 427 + 489 112 508 43 221 16 591 480 486 2 1 350 358 5 15 12 8 11 4 177 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 524 477 487 191 116 493 494 516 525 121 572 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_dac.c + $PROJ_DIR$\..\ucos\uC-LIB\Ports\lib_mem_a.asm - BICOMP - 94 - - - ICCARM - 26 + AARM + 128 - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_pwr.c + $PROJ_DIR$\..\ucos\uC-LIB\app_hooks.c BICOMP - 168 + 549 ICCARM - 205 + 120 + + + __cstat + 275 + + + ICCARM + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 2 1 350 358 5 15 12 112 508 8 11 4 13 3 7 9 138 535 353 363 366 364 359 365 6 360 361 362 356 355 357 351 352 + + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_lptim.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_ascii.c BICOMP - 18 + 62 ICCARM - 458 + 20 + + + __cstat + 262 + + + ICCARM + 472 487 191 177 43 221 16 591 116 493 494 476 + + - $PROJ_DIR$\..\drivers\Source\stm32f4xx_ll_fsmc.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mutex.c BICOMP - 103 + 518 ICCARM - 174 + 48 + + + __cstat + 238 ICCARM - 4 13 265 9 1 8 7 102 51 36 421 97 121 12 15 11 143 17 5 3 2 237 456 269 257 261 259 10 256 0 258 260 255 268 267 262 263 266 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_sem.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_tmr.c BICOMP - 466 + 166 ICCARM - 33 + 92 + + + __cstat + 240 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_task.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_q.c BICOMP - 109 + 506 ICCARM - 20 + 32 + + + __cstat + 261 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 @@ -2616,235 +3175,283 @@ BICOMP - 148 + 235 ICCARM - 165 + 148 + + + __cstat + 265 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uC-LIB\lib_str.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_math.c BICOMP - 157 + 59 ICCARM - 60 + 98 + + + __cstat + 241 ICCARM - 431 364 222 143 36 421 97 121 52 370 378 368 366 362 + 512 487 191 177 43 221 16 591 116 493 494 492 476 519 475 531 472 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mutex.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_flag.c BICOMP - 132 + 175 ICCARM - 449 + 67 + + + __cstat + 276 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mem.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_task.c BICOMP - 108 + 197 ICCARM - 463 + 546 + + + __cstat + 247 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_tmr.c + $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu_a.asm + + + AARM + 185 + + + + + $PROJ_DIR$\..\ucos\uC-LIB\lib_mem.c BICOMP - 166 + 29 ICCARM - 213 + 223 + + + __cstat + 268 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 519 487 191 177 43 221 16 591 116 493 494 492 476 531 472 475 512 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_flag.c + $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu_c.c BICOMP - 215 + 219 ICCARM - 61 + 115 + + + __cstat + 282 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 476 - $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu_a.asm - - - AARM - 206 - - - - - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_core.c + $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_dbg.c BICOMP - 87 + 230 ICCARM - 69 + 24 + + + __cstat + 259 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mbox.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_core.c BICOMP - 129 + 574 ICCARM - 221 + 52 + + + __cstat + 269 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_cpu_c.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_sem.c BICOMP - 125 + 550 ICCARM - 74 + 61 + + + __cstat + 266 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 368 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\..\ucos\uCOS-II\Ports\os_dbg.c + $PROJ_DIR$\..\ucos\uC-LIB\lib_str.c BICOMP - 62 + 233 ICCARM - 99 + 111 + + + __cstat + 281 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 531 487 191 177 43 221 16 591 116 493 494 476 472 475 - $PROJ_DIR$\..\ucos\uCOS-II\Source\os_q.c + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mbox.c BICOMP - 460 + 172 ICCARM - 151 + 64 + + + __cstat + 245 ICCARM - 415 352 364 222 143 36 421 97 121 52 370 378 434 427 + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 - $PROJ_DIR$\Debug\Exe\plsr.out + $PROJ_DIR$\..\ucos\uCOS-II\Source\os_mem.c - OBJCOPY - 465 + BICOMP + 60 - ILINK - 452 + ICCARM + 142 + + + __cstat + 260 - ILINK - 208 162 80 471 158 149 86 47 32 115 60 204 104 69 206 74 99 61 221 463 449 151 33 20 165 213 467 428 179 28 420 146 248 48 124 226 83 429 454 176 156 135 71 140 250 91 247 141 216 112 107 45 19 195 89 163 235 469 232 144 445 181 472 95 59 93 207 239 55 70 234 57 185 21 164 229 240 31 167 22 254 27 223 96 30 419 133 75 29 84 188 142 39 193 470 422 118 203 122 225 127 252 430 23 189 106 54 64 37 26 214 78 464 160 131 174 202 82 458 205 468 155 24 154 43 246 171 139 72 253 230 153 450 219 187 134 + ICCARM + 524 477 487 191 177 43 221 16 591 116 493 494 516 525 diff --git a/iar/plsr.ewp b/iar/plsr.ewp index 3f421e2..e85117e 100644 --- a/iar/plsr.ewp +++ b/iar/plsr.ewp @@ -359,7 +359,6 @@ $PROJ_DIR$\..\plsr\param $PROJ_DIR$\..\plsr\persist $PROJ_DIR$\..\plsr\pulse_driver - $PROJ_DIR$\..\plsr\path_plan $PROJ_DIR$\..\plsr\accel_curve $PROJ_DIR$\..\plsr\run_control $PROJ_DIR$\..\plsr\command @@ -2850,24 +2849,12 @@ plsr - - accel_curve - - $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.c - - - $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.h - - - - command - - $PROJ_DIR$\..\plsr\command\plsr_command.c - - - $PROJ_DIR$\..\plsr\command\plsr_command.h - - + + $PROJ_DIR$\..\plsr\plsr.c + + + $PROJ_DIR$\..\plsr\plsr.h + param @@ -2877,15 +2864,6 @@ $PROJ_DIR$\..\plsr\param\plsr_param.h - - path_plan - - $PROJ_DIR$\..\plsr\path_plan\plsr_path_plan.c - - - $PROJ_DIR$\..\plsr\path_plan\plsr_path_plan.h - - persist @@ -2904,6 +2882,15 @@ $PROJ_DIR$\..\plsr\pulse_driver\plsr_pulse_driver.h + + accel_curve + + $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.c + + + $PROJ_DIR$\..\plsr\accel_curve\plsr_accel_curve.h + + run_control @@ -2913,6 +2900,15 @@ $PROJ_DIR$\..\plsr\run_control\plsr_run_control.h + + command + + $PROJ_DIR$\..\plsr\command\plsr_command.c + + + $PROJ_DIR$\..\plsr\command\plsr_command.h + + signal_io @@ -2922,12 +2918,6 @@ $PROJ_DIR$\..\plsr\signal_io\plsr_signal_io.h - - $PROJ_DIR$\..\plsr\plsr.c - - - $PROJ_DIR$\..\plsr\plsr.h - ucos diff --git a/iar/plsr.ewt b/iar/plsr.ewt index 7e4d6b0..52a957b 100644 --- a/iar/plsr.ewt +++ b/iar/plsr.ewt @@ -3109,15 +3109,6 @@ $PROJ_DIR$\..\plsr\param\plsr_param.h - - path_plan - - $PROJ_DIR$\..\plsr\path_plan\plsr_path_plan.c - - - $PROJ_DIR$\..\plsr\path_plan\plsr_path_plan.h - - persist diff --git a/plsr/accel_curve/plsr_accel_curve.c b/plsr/accel_curve/plsr_accel_curve.c index c1c37ca..ef8a7b9 100644 --- a/plsr/accel_curve/plsr_accel_curve.c +++ b/plsr/accel_curve/plsr_accel_curve.c @@ -10,12 +10,18 @@ * 关键约束 * 频率钳制上限 100000Hz;运行门禁非法频率由 command/run_control 报 0x04。 * 脉冲预算不够到目标频时:降低峰值(三角,无匀速),调用方写故障 0x02。 + * + * 符号约定(与 plsr_accel_curve.h 一致) + * f_cur/f_tgt/f_end — 段起/峰/止频率 Hz + * acc_n/dec_n/const_n — 加/减/匀速相脉冲预算(非时间 ms) + * a_acc/a_dec — 加/减速度 Hz/s + * pulse_rt — PlsrAccelPulseRt_t,ISR 逐拍改频状态机 */ #include "plsr_accel_curve.h" #include /* 频率大于 100k 时暂时钳到 100k;启动门禁另报 0x04 */ -uint32_t PlsrAccelCurveClampFreq(uint32_t freq_hz) +static uint32_t PlsrAccelCurveClampFreq(uint32_t freq_hz) { if (freq_hz > 100000U) { @@ -62,17 +68,12 @@ static uint32_t PlsrAccelCurveIsqrt64(uint64_t val) return (uint32_t)x; } -static uint32_t PlsrAccelCurveIsqrt(uint32_t val) -{ - return PlsrAccelCurveIsqrt64((uint64_t)val); -} - /** * 起跳频率:f = sqrt(f_from^2 + 2a),a = df*1000/t_ms。 * f_from=0 → sqrt(2a);超过 f_to 钳到 f_to。 */ -uint32_t PlsrAccelCurveJumpFreq(uint32_t f_from, uint32_t f_to, - uint32_t t_ms) +static uint32_t PlsrAccelCurveJumpFreq(uint32_t f_from, uint32_t f_to, + uint32_t t_ms) { uint32_t df; uint32_t a_hz_s; @@ -132,8 +133,6 @@ static uint32_t PlsrAccelCurveSlopeDen(uint32_t default_spd) static uint32_t PlsrAccelCurveRampTimeMs(uint32_t f_from, uint32_t f_to, uint32_t default_spd, - uint32_t start_spd_ref, - uint32_t end_spd_ref, uint32_t accel_ms, uint32_t decel_ms) { @@ -142,9 +141,6 @@ static uint32_t PlsrAccelCurveRampTimeMs(uint32_t f_from, uint32_t ref_ms; uint32_t t; - (void)start_spd_ref; - (void)end_spd_ref; - if (f_from == f_to) { return 0U; @@ -188,8 +184,6 @@ static uint32_t PlsrAccelCurveRampTimeMs(uint32_t f_from, uint32_t PlsrAccelCurveResolveStartHz(uint32_t f_cfg, uint32_t f_tgt, uint32_t default_spd, - uint32_t start_spd_ref, - uint32_t end_spd_ref, uint32_t accel_ms, uint32_t decel_ms) { @@ -204,7 +198,6 @@ uint32_t PlsrAccelCurveResolveStartHz(uint32_t f_cfg, /* 起速 0 或非 0:都用 JumpFreq = sqrt(f_cfg^2 + 2a) */ t_acc = PlsrAccelCurveRampTimeMs(f_cfg, f_tgt, default_spd, - start_spd_ref, end_spd_ref, accel_ms, decel_ms); return PlsrAccelCurveJumpFreq(f_cfg, f_tgt, t_acc); } @@ -212,8 +205,6 @@ uint32_t PlsrAccelCurveResolveStartHz(uint32_t f_cfg, uint32_t PlsrAccelCurveResolveEndHz(uint32_t f_cfg, uint32_t f_tgt, uint32_t default_spd, - uint32_t start_spd_ref, - uint32_t end_spd_ref, uint32_t accel_ms, uint32_t decel_ms) { @@ -232,13 +223,11 @@ uint32_t PlsrAccelCurveResolveEndHz(uint32_t f_cfg, if (f_cfg <= 1U) { t_dec = PlsrAccelCurveRampTimeMs(f_tgt, 0U, default_spd, - start_spd_ref, end_spd_ref, accel_ms, decel_ms); return PlsrAccelCurveJumpFreq(0U, f_tgt, t_dec); } t_dec = PlsrAccelCurveRampTimeMs(f_tgt, f_cfg, default_spd, - start_spd_ref, end_spd_ref, accel_ms, decel_ms); return PlsrAccelCurveJumpFreq(f_cfg, f_tgt, t_dec); } @@ -358,337 +347,6 @@ static uint32_t PlsrAccelCurveLerp(uint32_t a, uint32_t b, uint32_t ratio_permil return a - ((a - b) * ratio_permille) / 1000UL; } -/** - * 斜坡取频(µs 时间轴)。ISR 可用:O(1)。 - * - * 直线模式:f = f0 + (f1−f0) · t/T(64 位运算保证精度,每个点在 f-t 直线上)。 - * S / 正弦:f = f0 + (f1−f0) · shape(t/T)。 - */ -uint32_t PlsrAccelCurveFreqOnRampUs(uint32_t f0, - uint32_t f1, - uint32_t t_us, - uint32_t T_us, - PlsrAccelMode_e mode) -{ - uint32_t r; - - if ((T_us == 0U) || (t_us >= T_us)) - { - return f1; - } - - if (mode == PLSR_ACCEL_LINEAR) - { - /* - * 纯代数直线:f = f0 + (f1-f0)*t/T,用 64 位避免溢出/截断。 - * 不走 permille/Lerp,保证点在直线上。 - */ - if (f1 >= f0) - { - return f0 + (uint32_t)(((uint64_t)(f1 - f0) * (uint64_t)t_us) / (uint64_t)T_us); - } - else - { - uint32_t drop = (uint32_t)(((uint64_t)(f0 - f1) * (uint64_t)t_us) / (uint64_t)T_us); - return (drop < f0) ? (f0 - drop) : 0U; - } - } - - /* S / 正弦:shape(t/T) → Lerp */ - r = (uint32_t)(((uint64_t)t_us * 1000ULL) / (uint64_t)T_us); - if (r > 1000U) - { - r = 1000U; - } - r = PlsrAccelCurveShapePermille(r, mode); - return PlsrAccelCurveLerp(f0, f1, r); -} - -/** - * 斜坡取频(ms 接口;内部转 µs)。运行时相时间来自 TIM3 1ms 累加。 - */ -/** - * 斜坡取频(ms 接口,内部转 µs 调 FreqOnRampUs)。 - * 统一入口:直线/S/正弦均走 FreqOnRampUs,不再有额外特例分支。 - */ -uint32_t PlsrAccelCurveFreqOnRampMs(uint32_t f0, - uint32_t f1, - uint32_t t_ms, - uint32_t T_ms, - PlsrAccelMode_e mode) -{ - if (T_ms < 1U) - { - return f1; - } - return PlsrAccelCurveFreqOnRampUs(f0, f1, t_ms * 1000UL, T_ms * 1000UL, mode); -} - -/** - * 减速落地频率: - * - f_end>=1:落地即止速 - * - f_end==0:返回 0(停表)。不再用「对称首档」冒充止速—— - * 那一档常算成 1Hz,示波器上会变成脉冲发完后还在 1Hz 空转。 - */ -uint32_t PlsrAccelCurveLandFreq(uint32_t f_end, - uint32_t f_peak, - uint32_t T_ms, - PlsrAccelMode_e mode) -{ - (void)f_peak; - (void)T_ms; - (void)mode; - if (f_end >= 1U) - { - return f_end; - } - return 0U; -} - -/** - * 斜坡第一拍频率(规划/开跑共用)。 - * f0>=1:第一拍即 f0。 - * f0==0:t=0 曲线为 0;若强行按 1Hz 计整周期(~1s),加速时间常被第一拍吃光, - * 表现为到不了目标频、曲线台阶/长拖尾。此处用 look-ahead 自洽点,且 ≥1Hz。 - */ -/** - * 起速=0 时第一拍自洽频率。 - * - * 自洽条件:f 使得 FreqOnRampUs(f0, f1, 10^6/f, T_us) = f - * - * 直线模式(f0=0):解析解 f = sqrt(f1 * 10^6 / T_us)。 - * S/正弦:迭代(取两次平均收敛)。 - */ -uint32_t PlsrAccelCurveFirstPulseFreq(uint32_t f0, - uint32_t f1, - uint32_t T_us, - PlsrAccelMode_e mode) -{ - uint32_t f; - uint32_t guess; - uint32_t per; - uint32_t fnew; - uint32_t i; - - if (T_us == 0U) - { - f = (f1 >= 1U) ? f1 : 1U; - return f; - } - - f = PlsrAccelCurveFreqOnRampUs(f0, f1, 0U, T_us, mode); - if (f >= 1U) - { - return f; - } - - /* 直线 f0=0:f = sqrt(f1 * 1e6 / T_us),用整数牛顿法求 sqrt(val) */ - if ((mode == PLSR_ACCEL_LINEAR) && (f0 == 0U) && (f1 >= 1U)) - { - uint64_t val = (uint64_t)f1 * 1000000ULL / (uint64_t)T_us; - uint32_t x; - if (val == 0ULL) - { - return 1U; - } - x = (uint32_t)val; - if (x > 10000U) - { - x = 10000U; - } - for (i = 0U; i < 20U; i++) - { - uint32_t x2 = (uint32_t)((x + (uint32_t)(val / (uint64_t)x)) / 2UL); - if (x2 == x || x2 == 0U) - { - break; - } - x = x2; - } - f = (x < 1U) ? 1U : x; - if (f > f1) - { - f = f1; - } - return f; - } - - /* S/正弦:迭代求自洽点,用前后平均避免震荡 */ - guess = (f1 >= 4U) ? (f1 / 4U) : 1U; - for (i = 0U; i < 16U; i++) - { - per = (1000000UL + (guess / 2UL)) / guess; - fnew = PlsrAccelCurveFreqOnRampUs(f0, f1, per, T_us, mode); - if (fnew < 1U) - { - fnew = 1U; - } - if (fnew == guess) - { - break; - } - /* 取平均避免震荡 */ - guess = (guess + fnew) / 2U; - if (guess < 1U) - { - guess = 1U; - } - } - if (guess > f1) - { - guess = f1; - } - return guess; -} - -/** - * 斜坡脉冲数:与运行时 TIM3 1ms 取频一致(t=0..T-1 每毫秒贡献 f 个脉冲)。 - * 向上取整:减速段多留脉冲,才能在发完前走到 f_end。 - * 梯形面积 (f0+f1)*T/2000 会少算末段减速(约 (f_peak-f_end)/2000 个), - * 匀速被拉长,最后一段脉冲在斜坡中途用完,到不了止速。 - */ -static uint32_t PlsrAccelCurveEstimatePulses(uint32_t f_from, - uint32_t f_to, - uint32_t t_ms, - PlsrAccelMode_e mode) -{ - uint32_t t; - uint32_t f; - uint32_t n; - uint32_t t_use; - uint64_t acc; - - if ((t_ms == 0U) || (f_from == f_to)) - { - return 0U; - } - - t_use = t_ms; - if (t_use > 120000U) - { - t_use = 120000U; - } - - acc = 0ULL; - for (t = 0U; t < t_use; t++) - { - f = PlsrAccelCurveFreqOnRampMs(f_from, f_to, t, t_ms, mode); - if (f < 1U) - { - if (f_to >= 1U) - { - f = 1U; - } - else - { - f = 0U; - } - } - acc += (uint64_t)f; - } - - n = (uint32_t)((acc + 999ULL) / 1000ULL); - if ((n == 0U) && (acc > 0ULL)) - { - n = 1U; - } - return n; -} - -/** 匀速时间向下取整:宁可早进减速,保证斜坡走完再落到 f_end */ -static uint32_t PlsrAccelCurveConstTimeMs(uint32_t const_n, uint32_t f_hz) -{ - if ((const_n == 0U) || (f_hz < 1U)) - { - return 0U; - } - return (const_n * 1000UL) / f_hz; -} - -/** - * 拟合斜坡时间 T(任务上下文);使离散模型脉冲数尽量等于 max_pulses。 - */ -uint32_t PlsrAccelCurveFitRampTimeMs(uint32_t f_from, - uint32_t f_to, - uint32_t max_pulses, - uint32_t t_prefer_ms, - PlsrAccelMode_e mode) -{ - uint32_t lo; - uint32_t hi; - uint32_t mid; - uint32_t best; - uint32_t best_err; - uint32_t n; - uint32_t err; - uint32_t guard; - - if ((max_pulses == 0U) || (f_from == f_to)) - { - return 0U; - } - - if (max_pulses <= 1U) - { - return (t_prefer_ms > 0U) ? t_prefer_ms : 1U; - } - - hi = (t_prefer_ms > 0U) ? t_prefer_ms : 1U; - guard = 0U; - n = PlsrAccelCurveEstimatePulses(f_from, f_to, hi, mode); - while ((n < max_pulses) && (hi < 120000U) && (guard < 24U)) - { - if (hi > (120000U / 2U)) - { - hi = 120000U; - } - else - { - hi = hi * 2U; - } - n = PlsrAccelCurveEstimatePulses(f_from, f_to, hi, mode); - guard++; - } - - lo = 1U; - best = (t_prefer_ms > 0U) ? t_prefer_ms : hi; - n = PlsrAccelCurveEstimatePulses(f_from, f_to, best, mode); - best_err = (n > max_pulses) ? (n - max_pulses) : (max_pulses - n); - - while (lo <= hi) - { - mid = lo + ((hi - lo) / 2UL); - n = PlsrAccelCurveEstimatePulses(f_from, f_to, mid, mode); - err = (n > max_pulses) ? (n - max_pulses) : (max_pulses - n); - if ((err < best_err) || - ((err == best_err) && (t_prefer_ms > 0U) && - (((mid > t_prefer_ms) ? (mid - t_prefer_ms) : (t_prefer_ms - mid)) < - ((best > t_prefer_ms) ? (best - t_prefer_ms) : (t_prefer_ms - mid))))) - { - best = mid; - best_err = err; - } - if (n == max_pulses) - { - return mid; - } - if (n < max_pulses) - { - lo = mid + 1UL; - } - else - { - if (mid == 0U) - { - break; - } - hi = mid - 1UL; - } - } - - return best; -} - /** * a = default_spd * 1000 / ramp_ms(Hz/s)。ramp_ms=0 → a=0(阶跃)。 */ @@ -875,7 +533,7 @@ static uint32_t PlsrAccelCurveFitPeak(uint32_t total_pulses, * 1. 钳频、解析 f_cur/f_end 若仍 <1; * 2. 由 default_spd 与 accel/decel_ms 算 a_acc/a_dec(无默认速则频差回退); * 3. PulsesForRamp 估 acc_n/dec_n;若和 > total → FitPeak 降峰重估; - * 4. 写出 plan 三相预算与 t_* 预览字段。 + * 4. 写出 plan 三相预算。 */ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, uint32_t total_pulses, @@ -883,14 +541,10 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, uint32_t f_tgt, uint32_t f_end, uint32_t default_spd, - uint32_t start_spd_ref, - uint32_t end_spd_ref, uint32_t accel_ms, uint32_t decel_ms, PlsrAccelMode_e mode) { - uint32_t t_acc; - uint32_t t_dec; uint32_t acc_n; uint32_t dec_n; uint32_t f_peak; @@ -912,13 +566,11 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, if (f_cur < 1U) { f_cur = PlsrAccelCurveResolveStartHz(0U, f_tgt, default_spd, - start_spd_ref, end_spd_ref, accel_ms, decel_ms); } if (f_end < 1U) { f_end = PlsrAccelCurveResolveEndHz(0U, f_tgt, default_spd, - start_spd_ref, end_spd_ref, accel_ms, decel_ms); } @@ -943,12 +595,6 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, } f_peak = f_tgt; - t_acc = PlsrAccelCurveRampTimeMs(f_cur, f_peak, default_spd, - start_spd_ref, end_spd_ref, - accel_ms, decel_ms); - t_dec = PlsrAccelCurveRampTimeMs(f_peak, f_end, default_spd, - start_spd_ref, end_spd_ref, - accel_ms, decel_ms); plan->f_cur = f_cur; plan->f_end = f_end; @@ -962,9 +608,6 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, if (total_pulses == 0U) { plan->const_n = 0U; - plan->t_acc_ms = 0U; - plan->t_dec_ms = 0U; - plan->t_decel_start_ms = 0U; plan->f_tgt = f_peak; plan->acc_n = 0U; plan->dec_n = 0U; @@ -975,9 +618,6 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, { plan->const_n = 0U; plan->f_tgt = f_peak; - plan->t_acc_ms = t_acc; - plan->t_dec_ms = 0U; - plan->t_decel_start_ms = t_acc; plan->acc_n = total_pulses; plan->dec_n = 0U; return; @@ -987,12 +627,6 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, { f_peak = PlsrAccelCurveFitPeak(total_pulses, f_cur, f_tgt, f_end, a_acc, a_dec); - t_acc = PlsrAccelCurveRampTimeMs(f_cur, f_peak, default_spd, - start_spd_ref, end_spd_ref, - accel_ms, decel_ms); - t_dec = PlsrAccelCurveRampTimeMs(f_peak, f_end, default_spd, - start_spd_ref, end_spd_ref, - accel_ms, decel_ms); acc_n = PlsrAccelCurvePulsesForRamp(f_cur, f_peak, a_acc); dec_n = PlsrAccelCurvePulsesForRamp(f_peak, f_end, a_dec); if (acc_n > total_pulses) @@ -1005,14 +639,6 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, dec_n = total_pulses - acc_n; } plan->const_n = 0U; - if ((t_acc == 0U) && (acc_n > 0U) && (f_cur != f_peak)) - { - t_acc = 1U; - } - if ((t_dec == 0U) && (dec_n > 0U) && (f_peak != f_end)) - { - t_dec = 1U; - } } else { @@ -1044,11 +670,8 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, } plan->f_tgt = f_peak; - plan->t_acc_ms = t_acc; - plan->t_dec_ms = t_dec; plan->acc_n = acc_n; plan->dec_n = dec_n; - plan->t_decel_start_ms = t_acc + PlsrAccelCurveConstTimeMs(plan->const_n, f_peak); } /** @@ -1129,22 +752,6 @@ uint32_t PlsrAccelCurveFreqAtPulse(const PlsrAccelPlan_t *plan, return PlsrAccelCurveClampFreq(f); } -/** 兼容旧预览:用时间估算映射到脉冲再取频 */ -uint32_t PlsrAccelCurveFreqAtSegTime(const PlsrAccelPlan_t *plan, - uint32_t seg_elapsed_ms) -{ - uint32_t approx_n; - uint32_t f_ref; - - if (plan == (PlsrAccelPlan_t *)0) - { - return 0U; - } - f_ref = (plan->f_tgt >= 1U) ? plan->f_tgt : 1U; - approx_n = (uint32_t)(((uint64_t)seg_elapsed_ms * (uint64_t)f_ref) / 1000ULL); - return PlsrAccelCurveFreqAtPulse(plan, approx_n); -} - /*============================================================================*/ /* 逐拍运行态(ISR) */ /*============================================================================*/ diff --git a/plsr/accel_curve/plsr_accel_curve.h b/plsr/accel_curve/plsr_accel_curve.h index 793d02e..718f231 100644 --- a/plsr/accel_curve/plsr_accel_curve.h +++ b/plsr/accel_curve/plsr_accel_curve.h @@ -2,20 +2,13 @@ * @file plsr_accel_curve.h * @brief 脉冲域加/匀/减规划与取频(运动学:v^2 - v0^2 = 2ax) * - * @details 模块职责 - * 纯算法层:根据起/峰/止频率、斜率时间与总脉冲,规划 acc_n/const_n/dec_n, - * 并在脉冲序号上取频。不读 wait_type,不碰 TIM/GPIO。 + * @details 按起/峰/止频率、斜率时间与总脉冲规划三相脉冲预算,并在脉冲序号上取频。 + * 不读 wait_type,不碰 TIM/GPIO。 * - * 核心约定 - * - 加速度 a ≈ default_speed * 1000 / accel_ms(Hz/s);起/止速只定端点 - * - 直线:f(n) = sqrt(f0^2 ± 2*a*n);S/正弦:按脉冲进度 shape 插值 - * - 匀速仅当 acc_n+dec_n < total(真正到达目标峰)时出现 - * - 脉冲不够到设定峰:FitPeak 降峰(三角),调用方可写故障 0x02 - * - 开段端点由运行层 ResolveStart/EndHz 解析为真实 Hz(>=1)后再 Plan - * - * 与其它模块关系 - * - plsr_run_control :PlanSeg → Plan;ISR → PulseRtStep;Refresh → FreqAtPulse - * - plsr_param :accel_mode / default_speed / accel_ms / decel_ms + * 术语(全模块统一): + * acc_n / dec_n / const_n — 加速/减速/匀速相各需的脉冲个数(规划预算,非 ms) + * f_cur / f_tgt / f_end — 段入口频率、规划峰值、段出口频率(Hz) + * a_acc / a_dec — 加/减速度(Hz/s),≈ default_speed*1000/accel_ms */ #ifndef PLSR_ACCEL_CURVE_H #define PLSR_ACCEL_CURVE_H @@ -24,118 +17,38 @@ #include "plsr_param.h" /** - * 一段脉冲域规划结果(Plan 填出,运行层只读/EnterDecel 可改写 dec_n) - * acc_n/const_n/dec_n — 三相脉冲预算 - * f_cur / f_tgt / f_end — 实际起速、峰值、止速(可能已 FitPeak) - * a_acc / a_dec — Hz/s - * t_*_ms — 斜率时间估算(预览/兼容;运行热路径不依赖) + * 单段脉冲域规划结果(PlsrAccelCurvePlan 输出) + * EnterDecel 可能改写 dec_n,诊断用 run_control 另存 s_plan_dec_n。 */ typedef struct { - uint32_t acc_n; - uint32_t const_n; - uint32_t dec_n; - uint32_t f_cur; - uint32_t f_tgt; - uint32_t f_end; - uint32_t a_acc; - uint32_t a_dec; - uint32_t t_acc_ms; - uint32_t t_dec_ms; - uint32_t t_decel_start_ms; - PlsrAccelMode_e mode; + uint32_t acc_n; /* 加速相脉冲数:从 f_cur 爬到 f_tgt */ + uint32_t const_n; /* 匀速相脉冲数:保持 f_tgt */ + uint32_t dec_n; /* 减速相脉冲数:从 f_tgt 到 f_end */ + uint32_t f_cur; /* 段入口频率 Hz(规划后实际起点,>=1) */ + uint32_t f_tgt; /* 规划峰值 Hz(FitPeak 后可能低于段表目标) */ + uint32_t f_end; /* 段出口频率 Hz */ + uint32_t a_acc; /* 加速相加速度 Hz/s */ + uint32_t a_dec; /* 减速相加速度 Hz/s */ + PlsrAccelMode_e mode; /* 直线 / S / 正弦 */ } PlsrAccelPlan_t; -/** 曲线相枚举(预留/文档;运行层用自有 RunPhase_e) */ -typedef enum { - PLSR_CURVE_PHASE_ACC = 0, - PLSR_CURVE_PHASE_CONST, - PLSR_CURVE_PHASE_DEC -} PlsrCurvePhase_e; - -/** - * @brief 频率钳到上限 100000Hz(不抬下限) - * @note 非法低频门禁由 command/run_control 写 0x04,本函数不做 - */ -uint32_t PlsrAccelCurveClampFreq(uint32_t freq_hz); - -/** - * @brief 起跳/步进频率:f = sqrt(f_from^2 + 2a),a = |f_to-f_from|*1000/t_ms - * @note f_from=0 退化为 sqrt(2a);超过 f_to 钳到 f_to;t_ms=0 直接返回 f_to - */ -uint32_t PlsrAccelCurveJumpFreq(uint32_t f_from, uint32_t f_to, - uint32_t t_ms); - -/** - * @brief 配置起速 → 规划用真实起点:JumpFreq(f_cfg, f_tgt, t_acc) - * @note 起速 0 与非 0 统一走 Jump,避免配置 0 时从 0Hz 开跑 - */ +/** 配置起速 → 规划用真实起点(Jump;起速 0 也不从 0Hz 开跑) */ uint32_t PlsrAccelCurveResolveStartHz(uint32_t f_cfg, uint32_t f_tgt, uint32_t default_spd, - uint32_t start_spd_ref, - uint32_t end_spd_ref, uint32_t accel_ms, uint32_t decel_ms); -/** - * @brief 配置止速 → 规划用真实终点 - * @note f_cfg<=1:按落地频率估计(避免 1Hz 拖尾);否则 JumpFreq - */ +/** 配置止速 → 规划用真实终点(f_cfg<=1 按落地估计) */ uint32_t PlsrAccelCurveResolveEndHz(uint32_t f_cfg, uint32_t f_tgt, uint32_t default_spd, - uint32_t start_spd_ref, - uint32_t end_spd_ref, uint32_t accel_ms, uint32_t decel_ms); /** - * @brief 斜坡取频(µs 时间轴,O(1)) - * @note 直线:代数插值;S/正弦:shape(t/T) 再 Lerp。主要用于估计/兼容,非 ISR 主路径 - */ -uint32_t PlsrAccelCurveFreqOnRampUs(uint32_t f0, - uint32_t f1, - uint32_t t_us, - uint32_t T_us, - PlsrAccelMode_e mode); - -/** @brief ms 接口,内部转 µs 调 FreqOnRampUs */ -uint32_t PlsrAccelCurveFreqOnRampMs(uint32_t f0, - uint32_t f1, - uint32_t t_ms, - uint32_t T_ms, - PlsrAccelMode_e mode); - -/** - * @brief 斜坡第一拍自洽频率(起速=0 时避免整周期 1Hz 吃光加速时间) - */ -uint32_t PlsrAccelCurveFirstPulseFreq(uint32_t f0, - uint32_t f1, - uint32_t T_us, - PlsrAccelMode_e mode); - -/** - * @brief 减速落地频率:f_end>=1 返回止速;f_end==0 返回 0(停表) - */ -uint32_t PlsrAccelCurveLandFreq(uint32_t f_end, - uint32_t f_peak, - uint32_t T_ms, - PlsrAccelMode_e mode); - -/** - * @brief 拟合斜坡时间 T,使离散脉冲估计尽量等于 max_pulses(任务上下文) - */ -uint32_t PlsrAccelCurveFitRampTimeMs(uint32_t f_from, - uint32_t f_to, - uint32_t max_pulses, - uint32_t t_prefer_ms, - PlsrAccelMode_e mode); - -/** - * @brief 规划一整段脉冲域三相预算与实际峰值 - * @param total_pulses 本段总脉冲 - * @param f_cur/f_tgt/f_end 起/目标峰/止(真实 Hz,由策略层解析) - * @note 不够爬升则 FitPeak;结果写入 *plan + * 规划一整段脉冲域三相预算与实际峰值 + * 脉冲不够爬到 f_tgt 时 FitPeak 降峰(调用方可能写故障 0x02) */ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, uint32_t total_pulses, @@ -143,62 +56,42 @@ void PlsrAccelCurvePlan(PlsrAccelPlan_t *plan, uint32_t f_tgt, uint32_t f_end, uint32_t default_spd, - uint32_t start_spd_ref, - uint32_t end_spd_ref, uint32_t accel_ms, uint32_t decel_ms, PlsrAccelMode_e mode); -/** - * @brief 按已完成脉冲数取频(任务/预览) - * @note 运行热路径请用 PlsrAccelPulseRt(逐拍 ±1 / Q24,可进 ISR) - */ +/** 按已完成脉冲数取频(任务/预览;ISR 热路径用 PulseRtStep) */ uint32_t PlsrAccelCurveFreqAtPulse(const PlsrAccelPlan_t *plan, uint32_t pulse_done); /** - * @deprecated 时间轴取频;保留给旧预览,运行请用脉冲域 - */ -uint32_t PlsrAccelCurveFreqAtSegTime(const PlsrAccelPlan_t *plan, - uint32_t seg_elapsed_ms); - -/** - * 逐拍运行态(ISR 热路径) - * - 直线:上一拍频率 ±1 逼近 sqrt(f0^2±2an),不全量 Isqrt64 - * - S/正弦:Begin 时算 Q24 步长,逐拍商余累加,不做 index/total 除法 + * 单相逐脉冲运行态(ISR 热路径,每来一个 UPDATE 调 Step 一次) + * 直线:±1Hz 逼近 sqrt(f0²±2an);S/正弦:Q24 相位累加 + shape 表 */ typedef struct { - uint32_t f; /* 当前命令频率 */ - uint32_t f0; /* 本相起点频率 */ - uint32_t f1; /* 本相终点频率 */ - uint32_t a; /* Hz/s;直线用 */ - uint32_t n; /* 本相已完成脉冲 */ - uint32_t n_total; /* 本相总脉冲(距离只在 Begin 算) */ - uint32_t phase_q24; /* S/正弦进度 0..(1<<24) */ - uint32_t step_q24; - uint32_t step_rem; /* (1<<24) % n_total */ - uint32_t rem_acc; - uint8_t rising; - uint8_t active; /* 0=匀速保持,不 Step */ + uint32_t f; /* 当前输出频率 Hz */ + uint32_t f0; /* 本相起点频率 Hz */ + uint32_t f1; /* 本相终点频率 Hz */ + uint32_t a; /* 本相加速度 Hz/s(直线用) */ + uint32_t n; /* 本相已步进脉冲数 */ + uint32_t n_total; /* 本相总步进预算(= plan 里 acc_n 或 dec_n) */ + uint32_t phase_q24; /* S/正弦:形状进度 Q24 累加器 */ + uint32_t step_q24; /* 每脉冲相位增量 = (1<<24)/n_total */ + uint32_t step_rem; /* 相位累加余数(商余法,避免每拍除法) */ + uint32_t rem_acc; /* 余数累加 */ + uint8_t rising; /* 1=频率升高,0=降低 */ + uint8_t active; /* 1=本相仍在步进;0=已到 f1 */ PlsrAccelMode_e mode; } PlsrAccelPulseRt_t; -/** @brief 进入加速相运行态(n=0,active 视 acc_n) */ -void PlsrAccelPulseRtBeginAcc(PlsrAccelPulseRt_t *rt, +void PlsrAccelPulseRtBeginAcc(PlsrAccelPulseRt_t *pulse_rt, const PlsrAccelPlan_t *plan); - -/** @brief 进入减速相运行态 */ -void PlsrAccelPulseRtBeginDec(PlsrAccelPulseRt_t *rt, +void PlsrAccelPulseRtBeginDec(PlsrAccelPulseRt_t *pulse_rt, const PlsrAccelPlan_t *plan); - -/** @brief 进入匀速:active=0,复用 f_tgt */ -void PlsrAccelPulseRtBeginConst(PlsrAccelPulseRt_t *rt, +void PlsrAccelPulseRtBeginConst(PlsrAccelPulseRt_t *pulse_rt, const PlsrAccelPlan_t *plan); -/** - * @brief 本相前进 1 脉冲,返回下一拍命令频率 - * @note 匀速直接返回缓存 f;走完 n_total 后钳到 f1 并清 active - */ -uint32_t PlsrAccelPulseRtStep(PlsrAccelPulseRt_t *rt); +/** 本相前进 1 脉冲,返回下一拍命令频率 */ +uint32_t PlsrAccelPulseRtStep(PlsrAccelPulseRt_t *pulse_rt); #endif diff --git a/plsr/command/plsr_command.c b/plsr/command/plsr_command.c index eecb413..5b32027 100644 --- a/plsr/command/plsr_command.c +++ b/plsr/command/plsr_command.c @@ -20,6 +20,7 @@ #include "plsr_param.h" #include "plsr_run_control.h" #include "plsr.h" +#include "plsr_persist.h" #include "modbus_rtu.h" /* @@ -63,6 +64,7 @@ void PlsrCommandSetFault(uint16_t code) { s_fault = code; WriteHoldReg(PLSR_MON_ERR, code); + PlsrPersistNotifyMonitorChanged(); } /** @brief 清故障(见 plsr_command.h) */ @@ -70,6 +72,7 @@ void PlsrCommandClearFault(void) { s_fault = PLSR_ERR_NONE; WriteHoldReg(PLSR_MON_ERR, PLSR_ERR_NONE); + PlsrPersistNotifyMonitorChanged(); } /** @brief 读故障镜像(见 plsr_command.h) */ @@ -84,7 +87,7 @@ void PlsrCommandInit(void) WriteHoldReg(PLSR_CTRL_REG, 0U); s_live_freq_req = 0U; s_live_freq_hz = 0U; - PlsrCommandClearFault(); + /* 不清故障:上电由 PersistRestoreMonitor 恢复;无镜像时 s_fault 默认为 0 */ PlsrCommandPublishMonitor(); } @@ -144,6 +147,7 @@ void PlsrCommandOnSegFreqHoldWrite(uint16_t start_addr, uint16_t quantity) if (seg != (PlsrSeg_t *)0) { seg->freq_hz = (int32_t)f; + PlsrPersistNotifyCommonChanged(); /* 动态改频:段表 dirty,Poll 写入 BKPSRAM */ } s_live_freq_hz = f; @@ -163,6 +167,7 @@ void PlsrCommandOnSegFreqHoldWrite(uint16_t start_addr, uint16_t quantity) void PlsrCommandPoll(void) { uint16_t ctrl = ReadHoldReg(PLSR_CTRL_REG); + uint8_t skip_monitor = 0U; if (ctrl != 0U) { @@ -188,6 +193,11 @@ void PlsrCommandPoll(void) PlsrCommandClearFault(); PlsrStop(); (void)PlsrStart(PlsrParamGetStartSeg()); + /* 已进换向/WAIT 精确等待:本周期勿再 PublishMonitor,尽快 Pend */ + if (PlsrRunControlIsPreciseWait() != 0U) + { + skip_monitor = 1U; + } } } @@ -199,5 +209,8 @@ void PlsrCommandPoll(void) (void)PlsrChangeFreq(f); } - PlsrCommandPublishMonitor(); + if (skip_monitor == 0U) + { + PlsrCommandPublishMonitor(); + } } diff --git a/plsr/command/plsr_command.h b/plsr/command/plsr_command.h index 6068e4a..9d0183e 100644 --- a/plsr/command/plsr_command.h +++ b/plsr/command/plsr_command.h @@ -83,7 +83,7 @@ void PlsrCommandSetFault(uint16_t code); /** * @brief 清故障为 0 - * @note 调用时机:START 前、CLR 控制位、Init + * @note 调用时机:START 前、CLR 控制位(Init 不再清,以便上电恢复) */ void PlsrCommandClearFault(void); diff --git a/plsr/param/plsr_param.c b/plsr/param/plsr_param.c index 8f04f04..df161e3 100644 --- a/plsr/param/plsr_param.c +++ b/plsr/param/plsr_param.c @@ -23,13 +23,13 @@ #include "ucos_ii.h" #include -static PlsrCfg_t s_cfg; -static PlsrSeg_t s_seg[PLSR_SEG_MAX]; +static PlsrCfg_t s_cfg; /* 公共运行参数映像 */ +static PlsrSeg_t s_seg[PLSR_SEG_MAX]; /* 段表映像(最多 PLSR_SEG_MAX 段) */ -static OS_EVENT *s_param_sem; -static volatile uint16_t s_expect_frames; -static volatile uint16_t s_recv_frames; -static volatile uint8_t s_xfer_active; +static OS_EVENT *s_param_sem; /* 分帧收齐后唤醒 ParamBlockTask */ +static volatile uint16_t s_expect_frames; /* 本批期望总帧数 = 1 + 段数 */ +static volatile uint16_t s_recv_frames; /* 已收帧计数 */ +static volatile uint8_t s_xfer_active; /* 1=正在接收一批分帧 */ /*============================================================================*/ /* 运行映像 */ @@ -416,7 +416,7 @@ void PlsrParamBlockTask(void *pArg) (void)pArg; - for (;;) + while(1) { (void)OSSemPend(s_param_sem, 0U, &err); if (err != OS_ERR_NONE) diff --git a/plsr/param/plsr_param.h b/plsr/param/plsr_param.h index fbbee57..174895c 100644 --- a/plsr/param/plsr_param.h +++ b/plsr/param/plsr_param.h @@ -12,14 +12,14 @@ * - modbus_rtu / modbus_data :ReadHoldReg / WriteHoldReg * - plsr_command :启动前 ApplyFromHold;运行中写频改 s_seg[].freq_hz * - plsr_run_control :GetCfg / GetSeg / GetSegCount / GetStartSeg - * - plsr_persist :Apply 成功后 NotifyCommonChanged,落盘仅公共参数 + * - plsr_persist :Apply 成功后 NotifyCommonChanged,落盘公共+段表+监控 * - PlsrParamBlockTask :独立 uC/OS 任务,等信号量后 Apply + PersistPoll * * 关键数据流 * 上位机写公共帧@0x1000 → OnHoldWrite 开传输 expect=1+N * 上位机写段帧@0x1100+ → recv++;收齐 → OSSemPost * ParamBlockTask → ApplyFromHold → 结构体更新 → PersistNotify → 状态 OK - * 上电:InitDefault → PersistLoad 覆盖公共 → ExportToHold + * 上电:InitDefault → PersistLoad 覆盖公共+段表 → ExportToHold * * 协议概要 * - 公共帧:0x1000~0x1013(20 字),0x1009=段数 N,预期总帧=1+N @@ -86,8 +86,9 @@ typedef enum { } PlsrDirLogic_e; /** - * 发送方式(影响本段终止频率 f_end 与是否允许同向不停表衔接) - * COMPLETE:段末规划到公共止速;FOLLOW:无门禁时可衔接下一段目标频 + * 发送方式(与等待类型一起决定本段 f_end,并影响是否允许同向不停表衔接) + * COMPLETE:EXT_OR_DONE 同向时匀速跑完;反向或其它等待类型规划到止速 + * FOLLOW:仅 EXT_OR_DONE 同向可规划到下一段目标并允许不停表衔接;反向同其它等待 */ typedef enum { PLSR_SEND_COMPLETE = 0, @@ -113,7 +114,9 @@ typedef enum { /** * 段末/段内等待类型(由 run_control + signal_io 执行) - * TIME/SIGNAL/ACT/EXT 均会阻止 FOLLOW 不停表衔接(BlocksFollowKeep) + * TIME/SIGNAL/ACT/EXT:完成/后续均规划到止速;并阻止 FOLLOW 不停表衔接 + * EXT_OR_DONE:与下一段同向时后续可接目标/完成匀速跑完并可 FOLLOW 衔接; + * 与下一段反向时规划同其它等待(减速到止速,下一段从起速再爬) */ typedef enum { PLSR_WAIT_TIME = 0, /* 发完后等 wait_ms(0 按 1ms),再跳转 */ @@ -208,7 +211,7 @@ void PlsrParamBlockOnHoldWrite(uint16_t start_addr, uint16_t quantity); /** * @brief 保持寄存器 → s_cfg / s_seg * @return 1=成功(当前恒为 1;完整校验/故障码待扩展) - * @note 副作用:NotifyCommonChanged 标记 Flash 待存 + * @note 副作用:NotifyCommonChanged 标记 BKPSRAM 待存 */ uint8_t PlsrParamBlockApplyFromHold(void); diff --git a/plsr/path_plan/plsr_path_plan.c b/plsr/path_plan/plsr_path_plan.c deleted file mode 100644 index 7f14268..0000000 --- a/plsr/path_plan/plsr_path_plan.c +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @file plsr_path_plan.c - * @brief 多段路径规划实现(只做决策,不碰 TIM/GPIO) - * - * @details 模块职责 - * NextSeg / ResolveAfterSeg:按 jump_seg 决定下一段或结束; - * IsForward:相对模式看 pulse_cnt 符号,绝对模式看「目标−相对原点位置」符号; - * GetWaitMs:仅 WAIT_TIME,0 映射为 1ms。 - * - * 关键数据流 - * AfterSegDone / CutSeg / ActExpire → ResolveAfterSeg → BeginSeg 或 FinishAll - * WillFollowKeep / CutSeg keep 判定 → IsForward(下一段, AbsLocalPos) - */ -#include "plsr_path_plan.h" -#include "plsr_param.h" - -/** - * @brief 解析下一段(见 plsr_path_plan.h) - */ -int16_t PlsrPathPlanNextSeg(uint16_t cur_seg_0based) -{ - PlsrSeg_t *seg = PlsrParamGetSeg(cur_seg_0based); - uint16_t n = PlsrParamGetSegCount(); - uint16_t jump = seg->jump_seg; - - /* - * 跳转目标(1-based): - * 0 → 末段:结束;非末段:顺序下一段(cur+1) - * 1..N → 跳到对应段(可顺序、回跳循环、任意段) - * 其它 → 结束 - */ - if (jump == 0U) - { - /* 非末段写 0:视为顺序下一档,不是停机 */ - if ((n >= 1U) && (cur_seg_0based + 1U < n)) - { - return (int16_t)(cur_seg_0based + 1U); - } - return -1; - } - if ((jump >= 1U) && (jump <= n)) - { - return (int16_t)(jump - 1U); - } - return -1; -} - -/** - * @brief 判断段方向(见 plsr_path_plan.h) - */ -uint8_t PlsrPathPlanIsForward(uint16_t seg_0based, int32_t acc_pulse) -{ - PlsrSeg_t *seg = PlsrParamGetSeg(seg_0based); - PlsrCfg_t *cfg = PlsrParamGetCfg(); - int32_t move; - - if (cfg->run_mode == PLSR_POS_ABSOLUTE) - { - /* move = 段目标 − 相对本次启动原点的位置 */ - move = seg->pulse_cnt - acc_pulse; - } - else - { - move = seg->pulse_cnt; - } - return (move >= 0) ? 1U : 0U; -} - -/** - * @brief 段后 WAIT 时间(见 plsr_path_plan.h) - */ -uint16_t PlsrPathPlanGetWaitMs(uint16_t seg_0based) -{ - PlsrSeg_t *seg = PlsrParamGetSeg(seg_0based); - - /* 仅段后 WAIT 时间;0 按 1ms(手册);信号/ACT/EXT 由 run_control 处理 */ - if (seg->wait_type == PLSR_WAIT_TIME) - { - return (seg->wait_ms == 0U) ? 1U : seg->wait_ms; - } - (void)seg_0based; - return 0U; -} - -/** - * @brief 段后解析下一段(见 plsr_path_plan.h) - */ -int16_t PlsrPathPlanResolveAfterSeg(uint16_t cur_seg_0based) -{ - return PlsrPathPlanNextSeg(cur_seg_0based); -} diff --git a/plsr/path_plan/plsr_path_plan.h b/plsr/path_plan/plsr_path_plan.h deleted file mode 100644 index 4ac3a17..0000000 --- a/plsr/path_plan/plsr_path_plan.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file plsr_path_plan.h - * @brief 多段路径规划:段序、跳转、相对/绝对方向判定 - * - * @details 模块职责 - * 只读段表与公共定位模式,回答「下一段是谁」「这一段正还是反」「段后 WAIT 多久」。 - * 不驱动 TIM/GPIO;等待类型的具体执行由 run_control + signal_io 完成。 - * - * 与其它模块关系 - * - plsr_param :GetSeg / GetSegCount / GetCfg - * - plsr_run_control :GotoNext、CutSeg、WillFollowKeep、BeginSeg 方向 - */ -#ifndef PLSR_PATH_PLAN_H -#define PLSR_PATH_PLAN_H - -#include - -/** - * @brief 解析下一段索引 - * @param cur_seg_0based 当前段 0-based - * @return 下一段 0-based;无下一段或非法跳转返回 -1 - * @note jump=0:末段→结束;非末段→顺序下一段 - * jump=1~N:跳到对应段(可循环) - * 其它:结束 - */ -int16_t PlsrPathPlanNextSeg(uint16_t cur_seg_0based); - -/** - * @brief 判断该段运动方向 - * @param seg_0based 段索引 - * @param acc_pulse 相对本次启动原点的位置(绝对模式算位移用) - * @return 1=正向,0=反向 - * @note 相对:看 pulse_cnt 符号;绝对:看 (目标−相对原点位置) 符号 - */ -uint8_t PlsrPathPlanIsForward(uint16_t seg_0based, int32_t acc_pulse); - -/** - * @brief 段结束后 WAIT 时间(ms) - * @note 仅 WAIT_TIME 有效;0 按 1ms;其它等待类型返回 0(由 run_control 处理) - */ -uint16_t PlsrPathPlanGetWaitMs(uint16_t seg_0based); - -/** - * @brief 段结束(或等待结束)后解析下一段 - * @note 当前语义同 NextSeg;保留独立符号便于日后插入后处理 - */ -int16_t PlsrPathPlanResolveAfterSeg(uint16_t cur_seg_0based); - -#endif diff --git a/plsr/plsr.c b/plsr/plsr.c index 03c58d3..b337492 100644 --- a/plsr/plsr.c +++ b/plsr/plsr.c @@ -10,9 +10,10 @@ * 本文件仅依赖 plsr.h 及各子模块头文件,不被其它 plsr 模块反向引用。 * * 关键数据流 - * PlsrInit 顺序:Param 默认 → Persist 加载 → PulseDriver → SignalIo → - * RunControl → ExportToHold → CommandInit - * PlsrTask 循环:CommandPoll → PersistPoll → RunControlTickMs → OSTimeDly(1) + * PlsrInit 顺序:Param 默认 → PersistLoad → PulseDriver → SignalIo → + * RunControl → PersistRestoreRuntime → ExportToHold → + * CommandInit → PersistRestoreMonitor → PersistPoll + * PlsrTask 循环:TickMs → DebouncePoll → CommandPoll → PersistPoll → WakePend */ #include "plsr.h" #include "plsr_pulse_driver.h" @@ -29,12 +30,15 @@ void PlsrInit(void) { PlsrParamInitDefault(); - PlsrPersistLoad(); /* 有 Flash 记录则覆盖公共参数;段表仍用默认/上位机下发 */ + PlsrPersistLoad(); /* BKPSRAM:覆盖公共+段表;累计/故障暂存 */ PlsrPulseDriverInit(); PlsrSignalIoInit(); PlsrRunControlInit(); - PlsrParamBlockExportToHold(); /* 上电把运行映像摊到保持寄存器,供 Modbus 0x03 读 */ + PlsrPersistRestoreRuntime(); /* 写回累计脉冲 */ + PlsrParamBlockExportToHold(); /* 上电把运行映像摊到保持寄存器,供 Modbus 0x03 读取 */ PlsrCommandInit(); + PlsrPersistRestoreMonitor(); /* 恢复故障码;0x3000/运行态强制空闲 */ + PlsrPersistPoll(); /* 消费 Restore 置的 dirty */ } /** @@ -97,14 +101,12 @@ void PlsrOnPulseIsr(void) void PlsrTask(void *pArg) { static uint8_t s_booted = 0U; -#if (PLSR_LOOP_TEST_EN != 0) - static uint8_t s_was_busy = 0U; - static uint16_t s_idle_ticks = 0U; -#endif (void)pArg; - for (;;) + PlsrRunControlWakeInit(); /* OS 已启动,创建 WAIT/ACT 到期唤醒信号量 */ + + while(1) { /* * 首次进入:Modbus 从站上电常会清零保持寄存器。 @@ -115,52 +117,26 @@ void PlsrTask(void *pArg) OSTimeDly(30U); /* ~300ms @ 100Hz tick */ PlsrParamBlockExportToHold(); PlsrCommandInit(); + PlsrPersistRestoreMonitor(); /* 若仍有 pending;无则空操作 */ s_booted = 1U; -#if (PLSR_LOOP_TEST_EN != 0) - s_was_busy = 0U; - s_idle_ticks = 0U; -#endif } + PlsrRunControlTickMs(); /* 优先:WAIT/换向到期立刻开表 */ + PlsrSignalIoDebouncePoll(); /* OS 节拍消抖确认 */ PlsrCommandPoll(); /* 收 START/STOP/CLR,回写 0x2000~0x2006 监控 */ - PlsrPersistPoll(); /* 公共参数有改且空闲则追加写入 Flash */ - PlsrRunControlTickMs(); /* ACT/WAIT/EXT、换向延时、ApplyPending */ + PlsrPersistPoll(); /* BKPSRAM:消费 dirty(累计脉冲限频落盘) */ -#if (PLSR_LOOP_TEST_EN != 0) /* - * 调试循环:检测到 busy→idle 边沿后,空闲满 1s 自动从第 1 段再启。 - * 正式产品 PLSR_LOOP_TEST_EN=0 时本段不参与编译。 + * 换向 / WAIT 时间:WakePend(0) 只等 TIM5 Post(墙钟≈设定 ms)。 + * 其它:超时 1 OS tick,兼顾 EXT 轮询。 */ - if (s_booted != 0U) + if (PlsrRunControlIsPreciseWait() != 0U) { - uint8_t busy = PlsrIsBusy(); - - if ((s_was_busy != 0U) && (busy == 0U)) - { - s_idle_ticks = 0U; - } - - if (busy == 0U) - { - s_idle_ticks++; - if (s_idle_ticks >= (uint16_t)OS_TICKS_PER_SEC) - { - s_idle_ticks = 0U; - if (PlsrParamGetSegCount() >= 1U) - { - (void)PlsrStart(1U); - } - } - } - else - { - s_idle_ticks = 0U; - } - - s_was_busy = busy; + PlsrRunControlWakePend(0U); + } + else + { + PlsrRunControlWakePend(1U); } -#endif - - OSTimeDly(1U); /* 约 1ms 任务节拍,与 TIM3 独立 */ } } diff --git a/plsr/plsr.h b/plsr/plsr.h index 0b4d1ce..9f4989c 100644 --- a/plsr/plsr.h +++ b/plsr/plsr.h @@ -13,15 +13,15 @@ * - plsr_command :Modbus 监控区 0x2000~0x2006、控制区 0x3000 指令解析 * - plsr_run_control:段状态机、等待策略、加减速执行、故障诊断 * - plsr_pulse_driver:TIM PWM 脉冲 + Y3 方向 GPIO - * - plsr_signal_io :WAIT/EXT 外部输入、TIM3 1ms 时基 + * - plsr_signal_io :WAIT/EXT 外部输入、TIM5 延时 * * 关键数据流 * 上电:PlsrInit → 默认参数 → Flash 覆盖公共参数 → 驱动/IO/运行控制初始化 * → 参数导出到保持寄存器 → 指令模块初始化 - * 周期:PlsrTask → CommandPoll(START/STOP/CLR、监控回写) - * → PersistPoll(空闲时 Flash 落盘)→ RunControlTickMs(等待/切段) + * 周期:PlsrTask → CommandPoll → PersistPoll → RunControlTickMs + * → WakePend(1)(TIM5 WAIT/ACT 到期 SemPost 可立刻唤醒) * 脉冲:TIM UPDATE 中断 → PlsrOnPulseIsr → RunControl 计数 + 逐拍改频 - * 启动:PlsrStart → RunControlStart → 路径规划 + 曲线规划 + PWM 输出 + * 启动:PlsrStart → RunControlStart → 段序/方向 + 曲线规划 + PWM 输出 */ #ifndef PLSR_H #define PLSR_H @@ -47,7 +47,7 @@ void PlsrInit(void); /** * @brief uC/OS-II 周期任务入口 * @param pArg 任务参数(未使用,传 NULL) - * @note 调用时机:创建后永久循环,建议 1ms 节拍(OSTimeDly(1)) + * @note 调用时机:创建后永久循环;WAIT/ACT 到期由信号量立刻唤醒,否则最多 1 个 OS tick * @note 副作用:轮询 Modbus 控制位、刷新监控寄存器、推进运行控制状态机、 * 空闲时触发 Flash 持久化;首次进入延迟 ~300ms 再导出参数(避免 Modbus 清零冲掉) */ @@ -93,7 +93,7 @@ int32_t PlsrGetAccPulse(void); /** * @brief 清零累计脉冲与绝对坐标原点 * @note 调用时机:CommandPoll 收到 CLR 控制位 - * @note 副作用:s_acc_pulse=0、s_abs_origin=0,同步清故障码 + * @note 副作用:s_acc_pulse=0、s_abs_origin=0,下次 Start 重新锁定原点 */ void PlsrClearAccPulse(void); diff --git a/plsr/pulse_driver/plsr_pulse_driver.c b/plsr/pulse_driver/plsr_pulse_driver.c index d13c77f..df48a1e 100644 --- a/plsr/pulse_driver/plsr_pulse_driver.c +++ b/plsr/pulse_driver/plsr_pulse_driver.c @@ -4,9 +4,10 @@ * * @details 模块职责 * 实现 plsr_pulse_driver.h 全部 API。核心约束: - * - 空闲不关 CC1E:Forced active 主动拉高,避免 AF 高阻耦合假脉冲; + * - 空闲不关 CC1E:Forced inactive 主动拉低,避免 AF 高阻耦合假脉冲; * - ARR/CCR 预装载:改频写影子寄存器,下一 UPDATE 生效,减少毛刺/多计; * - ISR 内禁止停表换 PSC:挂起 s_req_*,任务 ApplyPending。 + * - 波形:空闲/开跑起点低;运行中 PWM1+极性高 → 每周期先高后低。 * * 关键数据流 * PlanSeg → LockPscRange → DIR_WAIT → Start → ISR SetFreqIsr(只改 ARR) @@ -35,14 +36,14 @@ TIM_HandleTypeDef htim13; /* * ---------- 模块静态状态 ---------- * s_last_freq/psc/arr — 上次量化结果;匀速热路径比较后可跳过写寄存器 - * s_active_y / htim — 当前选中脉冲路 + * s_active_htim — 当前选中脉冲路 HAL 句柄 * s_psc_locked / locked_psc — 段内 PSC 锁;跨度过大时 locked=0 * s_req_freq / pending — ISR 无法换 PSC 时的挂起改频 */ static uint32_t s_last_freq; static uint32_t s_last_psc = 0xFFFFFFFFUL; static uint32_t s_last_arr = 0xFFFFFFFFUL; -static uint8_t s_active_y; +static uint32_t s_last_ccr; static TIM_HandleTypeDef *s_active_htim; static uint8_t s_psc_locked; @@ -50,6 +51,10 @@ static uint32_t s_locked_psc; static volatile uint32_t s_req_freq; static volatile uint8_t s_req_pending; +/* + * 1=DIR_WAIT 已装载寄存器且 CEN 关:到期 Commit 前必须 CNT=0 再开 PWM。 + */ +static uint8_t s_regs_prepared; /*============================================================================*/ /* 路选择 / 时钟 / GPIO */ @@ -114,9 +119,9 @@ static void PlsrPulseDriverDirGpioInit(void) /** * 停表:不关复用、不关 CC1E。 * HAL_TIM_PWM_Stop 会清 CC1E,脚变成 AF 高阻,飞线接地的沿会耦合出极短脉冲。 - * Forced active + 通道保持使能:TIM 推挽把脚主动拉高(段间空闲高)。 + * Forced inactive + 通道保持使能:TIM 推挽把脚主动拉低(段间空闲低)。 */ -static void PlsrPulseDriverOcHoldHigh(TIM_HandleTypeDef *htim) +static void PlsrPulseDriverOcHoldLow(TIM_HandleTypeDef *htim) { uint32_t ccmr; @@ -130,7 +135,7 @@ static void PlsrPulseDriverOcHoldHigh(TIM_HandleTypeDef *htim) ccmr = htim->Instance->CCMR1; ccmr &= (uint32_t)(~TIM_CCMR1_OC1M); - ccmr |= TIM_OCMODE_FORCED_ACTIVE; + ccmr |= TIM_OCMODE_FORCED_INACTIVE; htim->Instance->CCMR1 = ccmr; htim->Instance->CCER |= TIM_CCER_CC1E; @@ -139,17 +144,6 @@ static void PlsrPulseDriverOcHoldHigh(TIM_HandleTypeDef *htim) TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); } -/** @brief 比较通道切回 PWM1 模式(开跑前) */ -static void PlsrPulseDriverOcPwm1(TIM_HandleTypeDef *htim) -{ - uint32_t ccmr; - - ccmr = htim->Instance->CCMR1; - ccmr &= (uint32_t)(~TIM_CCMR1_OC1M); - ccmr |= TIM_OCMODE_PWM1; - htim->Instance->CCMR1 = ccmr; -} - /** * @brief HAL MSP:为 TIM10/11/13 配 AF GPIO 与 NVIC * @note 由 HAL_TIM_PWM_Init 回调;优先级 5,低于 EXTI/TIM3 之外的系统中断惯例 @@ -161,7 +155,8 @@ void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim) __HAL_RCC_GPIOF_CLK_ENABLE(); gpio.Mode = GPIO_MODE_AF_PP; - gpio.Pull = GPIO_PULLUP; + /* 下拉:通道若短暂高阻时保持低,避免上拉把「已高」盖住导致看不到开表上升沿 */ + gpio.Pull = GPIO_PULLDOWN; gpio.Speed = GPIO_SPEED_FREQ_HIGH; if (htim->Instance == TIM10) @@ -196,7 +191,7 @@ void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim) } /** - * @brief 初始化单路脉冲 TIM:PWM1 + ARR/CCR 预装载 + 空闲 Forced 拉高 + * @brief 初始化单路脉冲 TIM:PWM1 + ARR/CCR 预装载 + 空闲 Forced 拉低 * @param htim HAL 句柄 * @param inst TIM10 / TIM11 / TIM13 */ @@ -229,8 +224,8 @@ static void PlsrPulseDriverTimInitOne(TIM_HandleTypeDef *htim, TIM_TypeDef *inst Error_Handler(); } htim->Instance->CCMR1 |= TIM_CCMR1_OC1PE; - /* 复用保持:比较通道强制有效,推挽把脚拉高 */ - PlsrPulseDriverOcHoldHigh(htim); + /* 复用保持:强制无效,推挽空闲拉低;开跑后 PWM1 每周期仍先高后低 */ + PlsrPulseDriverOcHoldLow(htim); } /** @brief 驱动初始化(见 plsr_pulse_driver.h) */ @@ -239,14 +234,14 @@ void PlsrPulseDriverInit(void) s_last_freq = 0U; s_last_psc = 0xFFFFFFFFUL; s_last_arr = 0xFFFFFFFFUL; + s_last_ccr = 0U; s_psc_locked = 0U; s_locked_psc = 0U; s_req_pending = 0U; s_req_freq = 0U; - s_active_y = 0U; s_active_htim = &htim10; PlsrPulseDriverDirGpioInit(); - /* 三路都 Init + 空闲拉高,计数器关闭;出脉冲时只 Start 选中那路 */ + /* 三路都 Init + 空闲拉低,计数器关闭;出脉冲时只 Start 选中那路 */ PlsrPulseDriverTimInitOne(&htim10, TIM10); PlsrPulseDriverTimInitOne(&htim11, TIM11); PlsrPulseDriverTimInitOne(&htim13, TIM13); @@ -286,9 +281,13 @@ uint8_t PlsrPulseDriverIsPulseTim(TIM_TypeDef *instance) /* PSC / ARR 量化 */ /*============================================================================*/ -/** - * @brief 在给定 PSC 下计算 ARR/CCR(约 50% 占空比) - * @note freq 钳到 [1,100000];ARR 落在 16 位合法范围 +/* + * STM32 定时器频率换算(本模块约定) + * clk_hz — TIM 计数时钟(APB2=168MHz 或 APB1=84MHz) + * psc — 预分频寄存器值,实际分频 = PSC+1 + * arr — 自动重装载,一个 PWM 周期 = (ARR+1)×(PSC+1) 个计数 + * ccr — 比较值,PWM1 模式下高电平宽度 ≈ CCR 个计数(本驱动约 50% 占空) + * 目标频率:ticks = clk_hz / freq_hz ≈ (PSC+1)×(ARR+1) */ static void PlsrPulseDriverCalcArrWithPsc(uint32_t clk_hz, uint32_t freq_hz, uint32_t psc, uint32_t *arr, uint32_t *ccr) @@ -452,10 +451,10 @@ void PlsrPulseDriverUnlockPsc(void) s_locked_psc = 0U; } -/** @brief 停单路:Forced active 拉高,关 CEN/UPDATE */ +/** @brief 停单路:Forced inactive 拉低,关 CEN/UPDATE */ static void PlsrPulseDriverStopHtim(TIM_HandleTypeDef *htim) { - PlsrPulseDriverOcHoldHigh(htim); + PlsrPulseDriverOcHoldLow(htim); } /*============================================================================*/ @@ -463,11 +462,28 @@ static void PlsrPulseDriverStopHtim(TIM_HandleTypeDef *htim) /*============================================================================*/ /** - * @brief Start / StartFreeRun 公共路径 - * @param freq_hz 0=停表;>0 开跑 - * @param enable_update_it 1=开 UPDATE 中断(计数脉冲);0=自由跑 + * 关预装载后直写 ARR/CCR 工作寄存器,再打开预装载并复写影子。 + * 仅 UG 不可靠时(首拍 CCR 工作值仍为 0):CNT=0 也会整拍无高电平, + * 示波器上与「CNT>CCR 空等近一周期」无法区分。 + */ +static void PlsrPulseDriverForceArrCcr(TIM_HandleTypeDef *htim, + uint32_t arr, uint32_t ccr) +{ + htim->Instance->CR1 &= (uint32_t)(~TIM_CR1_ARPE); + htim->Instance->CCMR1 &= (uint32_t)(~TIM_CCMR1_OC1PE); + htim->Instance->ARR = arr; + htim->Instance->CCR1 = ccr; + htim->Instance->CR1 |= TIM_CR1_ARPE; + htim->Instance->CCMR1 |= TIM_CCMR1_OC1PE; + htim->Instance->ARR = arr; + htim->Instance->CCR1 = ccr; +} + +/** + * @brief 装载 PSC/ARR/CCR,Forced 拉低,CEN=0、IT=0 + * @note 换向延时期间禁止开 CEN,避免 CNT 空转。 */ -static void PlsrPulseDriverStartCommon(uint32_t freq_hz, uint8_t enable_update_it) +static void PlsrPulseDriverLoadRegs(uint32_t freq_hz) { uint32_t psc; uint32_t arr; @@ -482,7 +498,6 @@ static void PlsrPulseDriverStartCommon(uint32_t freq_hz, uint8_t enable_update_i { PlsrPulseDriverStopHtim(s_active_htim); } - s_active_y = y; s_active_htim = htim; clk_hz = PlsrPulseDriverTimClkHz(htim); @@ -492,6 +507,8 @@ static void PlsrPulseDriverStartCommon(uint32_t freq_hz, uint8_t enable_update_i s_last_freq = 0U; s_last_psc = 0xFFFFFFFFUL; s_last_arr = 0xFFFFFFFFUL; + s_last_ccr = 0U; + s_regs_prepared = 0U; return; } @@ -505,43 +522,109 @@ static void PlsrPulseDriverStartCommon(uint32_t freq_hz, uint8_t enable_update_i PlsrPulseDriverCalcPscArr(clk_hz, freq_hz, &psc, &arr, &ccr); } + if (ccr < 1U) + { + ccr = 1U; + } + s_last_freq = freq_hz; s_last_psc = psc; s_last_arr = arr; + s_last_ccr = ccr; __HAL_TIM_DISABLE(htim); __HAL_TIM_DISABLE_IT(htim, TIM_IT_UPDATE); - - /* 清 one-pulse,保证连续发脉冲 */ htim->Instance->CR1 &= (uint32_t)(~TIM_CR1_OPM); __HAL_TIM_SET_PRESCALER(htim, psc); - __HAL_TIM_SET_AUTORELOAD(htim, arr); - __HAL_TIM_SET_COMPARE(htim, TIM_CHANNEL_1, ccr); - __HAL_TIM_SET_COUNTER(htim, 0U); + PlsrPulseDriverForceArrCcr(htim, arr, ccr); - /* - * UG 在 Forced active 下做:脚保持高,避免 UG 在 PWM 复用脚上打出针。 - * 再切回 PWM1 并开计数。 - */ - PlsrPulseDriverOcHoldHigh(htim); + PlsrPulseDriverOcHoldLow(htim); + /* UG:PSC 生效;随后再钉 ARR/CCR/CNT,避免只进影子 */ htim->Instance->EGR = TIM_EGR_UG; __HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_UPDATE); __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE); + PlsrPulseDriverForceArrCcr(htim, arr, ccr); + htim->Instance->CNT = 0U; + + s_regs_prepared = 1U; +} + +/** + * @brief 开沿:先 Forced Active 出首上升沿,再切 PWM1 连续发脉冲 + * + * @note WAIT/换向后若首拍 CCR 工作值为 0,PWM1 会整拍低电平,示波器上就是 + * 「延时 + 本段第一脉冲周期」。Forced Active 与 CNT/CCR 无关,首沿必须出现。 + * Commit 内不再 UG,避免预装载影子把 CCR 又打回旧值/0。 + */ +static void PlsrPulseDriverCommitOutput(void) +{ + TIM_HandleTypeDef *htim = s_active_htim; + uint32_t ccmr; - PlsrPulseDriverOcPwm1(htim); + if ((htim == (TIM_HandleTypeDef *)0) || (htim->Instance == (TIM_TypeDef *)0)) + { + return; + } + + __HAL_TIM_DISABLE(htim); + __HAL_TIM_DISABLE_IT(htim, TIM_IT_UPDATE); + + /* 关预装载,直写工作寄存器 */ + htim->Instance->CR1 &= (uint32_t)(~TIM_CR1_ARPE); + htim->Instance->CCMR1 &= (uint32_t)(~TIM_CCMR1_OC1PE); + htim->Instance->ARR = s_last_arr; + htim->Instance->CCR1 = (s_last_ccr < 1U) ? 1U : s_last_ccr; + htim->Instance->CNT = 0U; + + /* + * 唯一的脉冲启动入口。通道必须在 CEN 前使能;TIM10/11/13 在 + * 运行中由 CC1E=0 -> 1 不保证重新建立当前 PWM1 电平,会保持无输出。 + * CNT 从 ARR 开始,下一计数节拍产生真实 UPDATE:该 UPDATE 同时建立 + * PWM1 首上升沿并进入现有脉冲 ISR 计数,边沿与 s_done 保持一一对应。 + */ + ccmr = htim->Instance->CCMR1; + ccmr &= (uint32_t)(~TIM_CCMR1_OC1M); + ccmr |= TIM_OCMODE_PWM1; + htim->Instance->CCMR1 = ccmr; htim->Instance->CCER |= TIM_CCER_CC1E; - __HAL_TIM_ENABLE(htim); + htim->Instance->CNT = s_last_arr; __HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_UPDATE); __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE); + __HAL_TIM_ENABLE_IT(htim, TIM_IT_UPDATE); + __HAL_TIM_ENABLE(htim); + + /* 运行期改频仍走预装载 */ + htim->Instance->CR1 |= TIM_CR1_ARPE; + htim->Instance->CCMR1 |= TIM_CCMR1_OC1PE; + htim->Instance->ARR = s_last_arr; + htim->Instance->CCR1 = (s_last_ccr < 1U) ? 1U : s_last_ccr; + + s_regs_prepared = 0U; +} - if (enable_update_it != 0U) +/** + * @brief Start 公共路径(每次开沿都走 Commit,不依赖 prepared 捷径) + */ +static void PlsrPulseDriverStartCommon(uint32_t freq_hz) +{ + if ((s_regs_prepared == 0U) || (freq_hz != s_last_freq) || (freq_hz == 0U)) { - __HAL_TIM_ENABLE_IT(htim, TIM_IT_UPDATE); + PlsrPulseDriverLoadRegs(freq_hz); + } + if (freq_hz != 0U) + { + PlsrPulseDriverCommitOutput(); } } +/** @brief 换向延时期间预装寄存器、CEN 保持关(见 plsr_pulse_driver.h) */ +void PlsrPulseDriverPrepare(uint32_t freq_hz) +{ + PlsrPulseDriverLoadRegs(freq_hz); +} + /** @brief 任务上下文改频(见 plsr_pulse_driver.h) */ void PlsrPulseDriverSetFreq(uint32_t freq_hz) { @@ -676,13 +759,6 @@ void PlsrPulseDriverSetFreqIsr(uint32_t freq_hz) s_last_arr = arr; } -/** @brief 挂起改频请求(见 plsr_pulse_driver.h) */ -void PlsrPulseDriverRequestFreq(uint32_t freq_hz) -{ - s_req_freq = freq_hz; - s_req_pending = 1U; -} - /** @brief 丢弃挂起(见 plsr_pulse_driver.h) */ void PlsrPulseDriverClearPending(void) { @@ -711,19 +787,14 @@ void PlsrPulseDriverApplyPending(void) /** @brief 开 PWM + UPDATE 中断(见 plsr_pulse_driver.h) */ void PlsrPulseDriverStart(uint32_t freq_hz) { - PlsrPulseDriverStartCommon(freq_hz, 1U); -} - -/** @brief 开 PWM 不使能 UPDATE(见 plsr_pulse_driver.h) */ -void PlsrPulseDriverStartFreeRun(uint32_t freq_hz) -{ - PlsrPulseDriverStartCommon(freq_hz, 0U); + PlsrPulseDriverStartCommon(freq_hz); } /** @brief 停三路(见 plsr_pulse_driver.h) */ void PlsrPulseDriverStop(void) { s_req_pending = 0U; + s_regs_prepared = 0U; PlsrPulseDriverStopHtim(&htim10); PlsrPulseDriverStopHtim(&htim11); PlsrPulseDriverStopHtim(&htim13); @@ -741,7 +812,7 @@ void PlsrPulseDriverArmOnePulseStop(void) { return; } - /* 下一 UPDATE 后计数器停止,不再多开一拍 */ + /* 下一 UPDATE 后计数器停止;须在倒数第二拍尽早武装(见 run_control ISR) */ htim->Instance->CR1 |= TIM_CR1_OPM; } diff --git a/plsr/pulse_driver/plsr_pulse_driver.h b/plsr/pulse_driver/plsr_pulse_driver.h index 73c2ce7..2abd2c8 100644 --- a/plsr/pulse_driver/plsr_pulse_driver.h +++ b/plsr/pulse_driver/plsr_pulse_driver.h @@ -19,8 +19,9 @@ * Y3 → PF9 GPIO 方向(固定,不可选) * * 频率约定 - * 0 :停止该路 PWM(空闲 Forced active 拉高) + * 0 :停止该路 PWM(空闲 Forced inactive 拉低) * 1~100k:按 Hz 输出;超出由 Calc 路径钳到 100k + * 波形:空闲/开跑起点低;运行中 PWM1 每周期先高后低 */ #ifndef PLSR_PULSE_DRIVER_H #define PLSR_PULSE_DRIVER_H @@ -36,7 +37,7 @@ extern TIM_HandleTypeDef htim13; /** * @brief 初始化三路脉冲 TIM + 方向 GPIO * @note 调用时机:PlsrInit,在 RunControl 之前 - * @note 副作用:Y0/Y1/Y2 空闲拉高、计数器关;Y3 输出低 + * @note 副作用:Y0/Y1/Y2 空闲拉低、计数器关;Y3 输出低 */ void PlsrPulseDriverInit(void); @@ -60,15 +61,16 @@ void PlsrPulseDriverLockPscRange(uint32_t f_min_hz, uint32_t f_max_hz); void PlsrPulseDriverUnlockPsc(void); /** - * @brief 以指定频率启动选中路 PWM,并打开 UPDATE 中断 - * @param freq_hz 0=停表;>0 开跑 + * @brief 开沿顺序:ARR/CCR → CNT=0 → UG → CCxE → CEN(CEN 后立刻有效电平) + * @note 换向延时到期应在 TIM5 延时中断内调用;勿经任务调度再开表 */ void PlsrPulseDriverStart(uint32_t freq_hz); /** - * @brief 同 Start,但不使能 UPDATE 中断(自由跑,不计入脉冲 ISR) + * @brief 换向延时期间装载 ARR/CCR,Forced 低且 CEN 关 + * @note 到期在 ISR 里 Start:CNT=0+UG+CEN,首沿对齐延时结束 */ -void PlsrPulseDriverStartFreeRun(uint32_t freq_hz); +void PlsrPulseDriverPrepare(uint32_t freq_hz); /** * @brief 任务上下文改频:PSC 不变则预装载 ARR;须换 PSC 则停表重装 @@ -83,12 +85,6 @@ void PlsrPulseDriverSetFreq(uint32_t freq_hz); */ void PlsrPulseDriverSetFreqIsr(uint32_t freq_hz); -/** - * @brief 请求改频(挂起),在周期边界或任务里落到硬件 - * @param freq_hz 目标 Hz;0 表示挂起停表 - */ -void PlsrPulseDriverRequestFreq(uint32_t freq_hz); - /** * @brief 消费挂起改频(TickMs / 更新路径) * @note s_req_freq==0 时 Stop;否则 SetFreq @@ -99,7 +95,7 @@ void PlsrPulseDriverApplyPending(void); void PlsrPulseDriverClearPending(void); /** - * @brief 停止三路脉冲 TIM,空闲 Forced active 拉高 + * @brief 停止三路脉冲 TIM,空闲 Forced inactive 拉低 * @note 不清方向脚;不清 PSC 锁(由上层 Unlock) */ void PlsrPulseDriverStop(void); diff --git a/plsr/run_control/plsr_run_control.c b/plsr/run_control/plsr_run_control.c index 4050923..a1ea9dd 100644 --- a/plsr/run_control/plsr_run_control.c +++ b/plsr/run_control/plsr_run_control.c @@ -9,37 +9,60 @@ * 2) 等待策略:只决定何时打断/段后等待;统一 handoff: * - 仍在输出且 freq>=1 → 链式传给下一段 * - 已停表/输出为 0 → 下一段从配置起速(0 则起跳频率)开跑 - * 3) 发送模式只影响本段 f_end(完成=止速;后续且不停表=下一段目标) + * 3) 本段 f_end 由等待类型 + 发送模式 + 与下一段方向关系决定: + * - EXT_OR_DONE + 有下一段 + 同向 + 后续 → 过渡到下一段目标 + * - EXT_OR_DONE + 有下一段 + 同向 + 完成 → f_end=峰值,匀速跑完 + * - EXT_OR_DONE + 有下一段 + 反向 → 与其它等待相同,规划到公共止速 + * - 真末段 → 一律规划到公共止速 + * - TIME/SIGNAL/ACT/EXT → 完成/后续相同,规划到公共止速 + * FOLLOW 另允许 EXT_OR_DONE 同向不停表衔接。 * 4) PlanSeg / ChangeFreq 共用规划入口,便于后期动态改频 * * 【运行节拍】纯脉冲计数: - * UPDATE ISR:s_done++;加/减速逐拍 PlsrAccelPulseRtStep + SetFreqIsr; - * 匀速复用 ARR(不改频);remain<=dec_n 进减速。 - * 任务 TickMs:仅 ACT/WAIT/EXT/换向延时 + ApplyPending(极少换 PSC)。 - * TIM3 1ms:仅 ACT/WAIT 时基。 + * UPDATE ISR:s_done++;倒数第二拍尽早 ArmOnePulseStop(OPM); + * 加/减速逐拍 PlsrAccelPulseRtStep + SetFreqIsr; + * 匀速复用 ARR(不改频);remain<=dec_n+1 进减速(补偿 ARR 预装载晚一拍)。 + * 任务 TickMs:ACT(OS 节拍)/ EXT / ApplyPending; + * TIM5 one-shot:换向/WAIT/ACT/ACT剩余;ACT 到期只置 cut_pending,等脉冲边界再切段。 + * PlsrTask:DebouncePoll + TickMs + WakePend。 + * + * 【段末频率 / ARPE】预装载开启时,本拍写的 ARR 要到再下一拍才生效; + * 若不超前,末拍实际是 f(N-1)≈sqrt(f_end^2+2a),示波器偶发「末频偏高」。 + * 减速在 remain==dec_n+1 切入;纯减速开表再预装一拍。 + * + * 【段末停表】非 FOLLOW-keep 时开段锁 s_seg_end_opm,倒数第二拍 ISR 内立刻写 + * CR1.OPM,避免改频路径拖长导致下一拍已开跑、偶发多出 1 个边沿。 * * 【故障诊断 0x2006】(PlsrCommandSetFault,告警码 1~3 不停机;4 禁止启动) * 0x01 段结束 AfterSegDone:s_done != s_target * 0x02 PlanSeg 后:规划峰值达不到设定 f_tgt(典型三角) * 0x03 加速离开 APPROACH / 减速段末:相内脉冲 ≠ 规划预算 * 0x04 目标频率 ∉ [1,100000]:Start / BeginSeg / ChangeFreq / 运行中写频 + * + * 符号约定(与 accel_curve / param 对齐) + * seg_idx0 — 段下标 0-based(寄存器/界面段号为 1-based) + * f_tgt — 段表目标频率 Hz(规划输入,可能与规划峰值不同) + * s_done — 本段已发脉冲数;s_target — 本段目标脉冲数 + * s_plan_acc_n — PlanSeg 锁定的加速相脉冲预算(0x03 诊断用) + * s_decel_budget — 进入减速相时锁定的步进预算(可能因 ARPE 缩短) + * remain — 本段剩余脉冲 = s_target - s_done */ #include "plsr_run_control.h" -#include "plsr_path_plan.h" #include "plsr_accel_curve.h" #include "plsr_param.h" #include "plsr_pulse_driver.h" #include "plsr_command.h" #include "plsr_signal_io.h" +#include "plsr_persist.h" #include "ucos_ii.h" #include /* * ---------- 运行主状态机 RcState_e ---------- * RC_IDLE — 无段在执行;可 Start;脉冲 ISR 不推进 - * RC_DIR_WAIT — 方向 GPIO 已设,等 dir_delay_ms(OS tick)后开 PWM - * RC_RUN — 脉冲 ISR 推进 s_done、逐拍改频;TickMs 处理 EXT - * RC_WAIT_COND — 段后等待:时间(TIM3)或 WAIT/EXT 下降沿 + * RC_DIR_WAIT — 真换向后 TIM5 one-shot 等 dir_delay;到期 ISR 内开 PWM + * RC_RUN — 脉冲 ISR 推进;TickMs 处理 EXT / ACT(OS) + * RC_WAIT_COND — 段后等待:TIM5 时间 或 WAIT/EXT 沿 */ typedef enum { RC_IDLE = 0, @@ -65,70 +88,65 @@ typedef enum { * * 段进度:s_state, s_busy, s_cur_seg, s_done, s_target, s_forward * 频率链:s_cur_freq, s_chain_freq, s_chain_valid, s_follow_cont, s_pwm_on - * 坐标 :s_acc_pulse(全局累计), s_abs_origin(本次 Start 快照,绝对模式用) - * 曲线 :s_accel_plan, s_pulse_rt, s_phase, s_plan_acc_n, s_plan_dec_n, s_decel_budget - * ACT :s_act_armed, s_act_time_ms, s_act_arm_ms, s_act_cut_pending, s_act_handoff_keep, s_act_expire_req - * WAIT :s_wait_is_signal, s_wait_deadline_ms, s_wait_expire_req - * 换向 :s_dir_deadline(OS tick) + * 坐标 :s_acc_pulse(全局累计), s_abs_origin(首次 Start 锁定,绝对模式用) + * 曲线 :s_accel_plan, s_pulse_rt, s_phase, s_plan_acc_n, s_decel_budget + * ACT :s_act_*(TIM5 计时;到期 cut_pending → 脉冲边界 ActExpire) + * WAIT :s_wait_is_signal / expire_req + * 换向 :s_dir_expire_req / s_dir_out / s_dir_valid * 段参数:s_run_accel_ms, s_run_decel_ms(PlanSeg 锁定,ChangeFreq 复用) */ -static volatile RcState_e s_state; -static volatile uint8_t s_busy; -static volatile uint8_t s_forward; -static volatile uint16_t s_cur_seg; -static volatile uint32_t s_cur_freq; -static volatile int32_t s_done; -static volatile int32_t s_target; -static volatile int32_t s_acc_pulse; -static int32_t s_abs_origin; /* 本次启动时累计作绝对原点 */ - -static INT32U s_dir_deadline; -static uint32_t s_wait_deadline_ms; /* TIM3:段后 WAIT 时间 / ACT※4 剩余 */ -static uint16_t s_act_time_ms; /* 本段 ACT 时长(出脉冲后计) */ -static uint32_t s_act_arm_ms; /* 武装时刻的 TIM3 s_ms,与改频 elapsed 脱钩 */ -static volatile uint8_t s_act_armed; -static volatile uint8_t s_act_expire_req; /* TIM3 置位,任务里切段(避免 ISR 里 PlanSeg) */ -static volatile uint8_t s_act_cut_pending; /* ACT 到期,等待当前脉冲 UPDATE 边界 */ -static volatile uint8_t s_act_handoff_keep; /* 边界停表后,下一段仍从当前频率衔接 */ -static volatile uint8_t s_wait_expire_req; /* WAIT 时间到:ISR 只置位 */ -static uint8_t s_wait_is_signal; /* RC_WAIT_COND:1=等 WAIT 沿,0=等时间 */ - -static PlsrAccelPlan_t s_accel_plan; -static PlsrAccelPulseRt_t s_pulse_rt; -static volatile RunPhase_e s_phase; /* ISR 读相,须 volatile */ -static uint32_t s_approach_from; -static uint32_t s_decel_from; -static uint8_t s_follow_cont; - -static uint32_t s_chain_freq; -static uint8_t s_chain_valid; -static uint8_t s_pwm_on; - -/* 本段由策略层解析后的加减速时间(段内只用这两份,不再读 wait) */ -static uint16_t s_run_accel_ms; -static uint16_t s_run_decel_ms; - -/* 规划锁定的加/减速脉冲预算(供 0x03 诊断;EnterDecel 会改写 plan.dec_n,故另存) */ -static uint32_t s_plan_acc_n; -static uint32_t s_plan_dec_n; -static uint32_t s_decel_budget; +static volatile RcState_e s_state; /* 主状态机:IDLE/DIR_WAIT/RUN/WAIT_COND */ +static volatile uint8_t s_busy; /* 1=整趟运行未结束(含等待) */ +static volatile uint8_t s_forward; /* 1=当前段正向,0=反向 */ +static volatile uint16_t s_cur_seg; /* 当前段下标 0-based */ +static volatile uint32_t s_cur_freq; /* 当前输出频率 Hz */ +static volatile int32_t s_done; /* 本段已发脉冲计数 */ +static volatile int32_t s_target; /* 本段目标脉冲数(相对=位移,绝对=差值) */ +static volatile int32_t s_acc_pulse; /* 全局累计脉冲(有符号,正=正向) */ +static int32_t s_abs_origin; /* 绝对模式:首次 Start 时 s_acc_pulse 快照 */ +static uint8_t s_abs_origin_locked; + +static volatile uint8_t s_dir_expire_req; /* 1=方向延时 TIM5 到期,任务侧处理 */ +static uint8_t s_dir_out; /* 上次已输出到 Y3 的方向 */ +static uint8_t s_dir_valid; /* 1=本趟已建立方向,可判下一段同向/反向 */ +static OS_EVENT *s_wake_sem; /* ISR/延时到期唤醒 PlsrTask */ +static uint16_t s_act_time_ms; /* 本段 ACT 设定时长 ms */ +static volatile uint8_t s_act_armed; /* 1=ACT 计时器已武装 */ +static volatile uint8_t s_act_expire_req; /* 1=脉冲边界已处理 ACT 到期,任务切段 */ +static volatile uint8_t s_act_cut_pending; /* 1=ACT 墙钟到,等 UPDATE 边界再切段 */ +static volatile uint8_t s_act_handoff_keep; /* ACT 边界停表后仍用当前频衔接下一段 */ +static volatile uint8_t s_wait_expire_req; /* 保留:时间 WAIT 到期标志 */ +static uint8_t s_wait_is_signal; /* WAIT_COND:1=等信号沿,0=等时间 */ + +static PlsrAccelPlan_t s_accel_plan; /* 本段曲线规划结果 */ +static PlsrAccelPulseRt_t s_pulse_rt; /* ISR 逐拍改频状态 */ +static volatile RunPhase_e s_phase; /* 段内相:APPROACH/CONST/DECEL */ +static uint8_t s_follow_cont; /* 1=下一段从当前频率无缝衔接 */ + +static uint32_t s_chain_freq; /* 段末停表前的落地频率,供下段 f_from */ +static uint8_t s_chain_valid; /* 1=s_chain_freq 有效 */ +static uint8_t s_pwm_on; /* 1=PWM 正在输出 */ +static uint8_t s_seg_end_opm; /* 1=本段末拍用 OPM 单脉冲停表 */ + +static uint16_t s_run_accel_ms; /* 本段锁定加速时间 ms(ChangeFreq 复用) */ +static uint16_t s_run_decel_ms; /* 本段锁定减速时间 ms */ + +static uint32_t s_plan_acc_n; /* PlanSeg 锁定加速脉冲预算(0x03) */ +static uint32_t s_plan_dec_n; /* PlanSeg 锁定减速脉冲预算 */ +static uint32_t s_decel_budget; /* EnterDecel 时锁定的减速步进预算 */ -/* - * PlsrSegCallIo_t — 策略层解析后交给 PlanSeg 的段端点参数 - * f_from 本段起始频率(真实 Hz,>=1) - * f_end 本段终止频率(完成=止速;后续=下一段目标) - * accel_ms 本段加速时间(来自公共参数,段内不读 wait_type) - * decel_ms 本段减速时间 +/** + * 策略层解析后交给 PlanSeg 的段端点(不含 wait_type,仅频率与时间) */ typedef struct { - uint32_t f_from; - uint32_t f_end; - uint16_t accel_ms; - uint16_t decel_ms; -} PlsrSegCallIo_t; + uint32_t freq_start_hz; /* 本段入口频率 Hz(>=1,由衔接/起速解析) */ + uint32_t freq_end_hz; /* 本段出口频率 Hz(由 wait/send/方向解析) */ + uint16_t accel_ms; /* 本段加速参考时间 ms */ + uint16_t decel_ms; /* 本段减速参考时间 ms */ +} PlsrSegPlanEndpoints_t; static void PlsrRunControlAfterSegDone(void); -static void PlsrRunControlBeginSeg(uint16_t seg_0); +static void PlsrRunControlBeginSeg(uint16_t seg_idx0); static void PlsrRunControlGotoNextOrFinish(uint16_t cur_seg); static void PlsrRunControlFinishAll(void); static void PlsrRunControlArmActExtOnPulseStart(void); @@ -137,9 +155,9 @@ static void PlsrRunControlActExpire(void); static void PlsrRunControlEnterPostWaitOrNext(void); static uint16_t PlsrRunControlActTimeMs(const PlsrSeg_t *seg); static uint8_t PlsrRunControlBlocksFollowKeep(uint16_t cur_seg); -static uint8_t PlsrRunControlWillFollowKeep(uint16_t cur_seg); -static uint8_t PlsrRunControlResolveSegCallIo(uint16_t seg_0, uint32_t f_tgt, - PlsrSegCallIo_t *io); +//static uint8_t PlsrRunControlWillFollowKeep(uint16_t cur_seg); +static uint8_t PlsrRunControlResolveSegPlanEndpoints(uint16_t seg_idx0, uint32_t f_tgt, + PlsrSegPlanEndpoints_t *endpoints); static uint16_t PlsrRunControlWaitTimeMs(const PlsrSeg_t *seg); static void PlsrRunControlPlanSeg(uint32_t total, uint32_t f_from, uint32_t f_tgt, uint32_t f_end, @@ -153,11 +171,110 @@ static uint32_t PlsrRunControlClampSpeed(uint32_t spd); static uint8_t PlsrRunControlGetSegTargetFreq(int32_t freq_hz, uint32_t default_spd, uint32_t *out_hz); +static int16_t PlsrRunControlNextSeg(uint16_t cur_seg_0based); +static uint8_t PlsrRunControlIsForward(uint16_t seg_0based, int32_t acc_pulse); +static void PlsrRunControlClearChainAndStop(void); +static void PlsrRunControlApplyKeepOrStop(uint8_t allow_act_handoff); +static void PlsrRunControlWakePost(void); +static void PlsrRunControlWakeDrain(void); + +/** + * @brief 解析下一段索引(原 path_plan) + * @note jump=0:末段结束,非末段顺序下一段;jump=1..N:跳到对应段;其它结束 + */ +static int16_t PlsrRunControlNextSeg(uint16_t cur_seg_0based) +{ + PlsrSeg_t *seg = PlsrParamGetSeg(cur_seg_0based); + uint16_t n = PlsrParamGetSegCount(); + uint16_t jump = seg->jump_seg; + + if (jump == 0U) + { + if ((n >= 1U) && (cur_seg_0based + 1U < n)) + { + return (int16_t)(cur_seg_0based + 1U); + } + return -1; + } + if ((jump >= 1U) && (jump <= n)) + { + return (int16_t)(jump - 1U); + } + return -1; +} + +/** + * @brief 判断段方向:相对看 pulse_cnt 符号;绝对看目标−局部位置 + */ +static uint8_t PlsrRunControlIsForward(uint16_t seg_0based, int32_t acc_pulse) +{ + PlsrSeg_t *seg = PlsrParamGetSeg(seg_0based); + PlsrCfg_t *cfg = PlsrParamGetCfg(); + int32_t move; + + if (cfg->run_mode == PLSR_POS_ABSOLUTE) + { + move = seg->pulse_cnt - acc_pulse; + } + else + { + move = seg->pulse_cnt; + } + return (move >= 0) ? 1U : 0U; +} + +/** + * @brief 停表并清频率链(段后 WAIT / 反向切段共用) + */ +static void PlsrRunControlClearChainAndStop(void) +{ + PlsrPulseDriverStop(); + s_follow_cont = 0U; + s_pwm_on = 0U; + s_chain_valid = 0U; + s_chain_freq = 0U; + s_cur_freq = 0U; +} + +/** + * @brief 中途切段 handoff:同向且有有效频率则不停表衔接,否则停表清链 + * @param allow_act_handoff 1=允许 s_act_handoff_keep(边界停表后仍衔接) + */ +static void PlsrRunControlApplyKeepOrStop(uint8_t allow_act_handoff) +{ + int16_t next_seg_idx; + uint8_t keep; + uint8_t pwm_ok; + + next_seg_idx = PlsrRunControlNextSeg(s_cur_seg); + pwm_ok = (s_pwm_on != 0U) || + ((allow_act_handoff != 0U) && (s_act_handoff_keep != 0U)); + keep = 0U; + if ((next_seg_idx >= 0) && (pwm_ok != 0U) && (s_cur_freq >= 1U) && + (PlsrRunControlIsForward((uint16_t)next_seg_idx, PlsrRunControlAbsLocalPos()) == + s_forward)) + { + keep = 1U; + } + + if (keep != 0U) + { + PlsrPulseDriverClearOnePulseStop(); + s_follow_cont = 1U; + s_chain_valid = 1U; + s_chain_freq = s_cur_freq; + } + else + { + PlsrRunControlClearChainAndStop(); + PlsrPulseDriverClearOnePulseStop(); + } +} /** * @brief 开跑瞬间武装 ACT/EXT * @note EXT:清旧沿防误切;WAIT 信号不在此清(段中沿留给※2) - * @note ACT:写时长与 arm_ms 后再武装,计时跟自由运行 s_ms + * @note ACT:写时长后武装 TIM5;到期 OPM 收当前拍,下一 UPDATE 再 ActExpire */ static void PlsrRunControlArmActExtOnPulseStart(void) { @@ -179,10 +296,9 @@ static void PlsrRunControlArmActExtOnPulseStart(void) s_wait_expire_req = 0U; if (seg->wait_type == PLSR_WAIT_ACT) { - /* 先写时长/起点再武装。计时用自由运行 s_ms,不被 PlanSeg 清 elapsed */ s_act_time_ms = PlsrRunControlActTimeMs(seg); - s_act_arm_ms = PlsrSignalIoGetMs(); s_act_armed = 1U; + PlsrSignalIoScheduleDelayMs((uint32_t)s_act_time_ms); } } @@ -194,9 +310,7 @@ static void PlsrRunControlArmActExtOnPulseStart(void) */ static void PlsrRunControlCutSegToNext(void) { - int16_t next0; - uint8_t keep; - + PlsrSignalIoCancelDelay(); s_state = RC_IDLE; s_act_armed = 0U; s_act_expire_req = 0U; @@ -204,32 +318,7 @@ static void PlsrRunControlCutSegToNext(void) s_act_handoff_keep = 0U; s_wait_expire_req = 0U; - next0 = PlsrPathPlanResolveAfterSeg(s_cur_seg); - keep = 0U; - if ((next0 >= 0) && (s_pwm_on != 0U) && (s_cur_freq >= 1U) && - (PlsrPathPlanIsForward((uint16_t)next0, PlsrRunControlAbsLocalPos()) == s_forward)) - { - keep = 1U; - } - - if (keep != 0U) - { - PlsrPulseDriverClearOnePulseStop(); - s_follow_cont = 1U; - s_chain_valid = 1U; - s_chain_freq = s_cur_freq; - } - else - { - PlsrPulseDriverStop(); - PlsrPulseDriverClearOnePulseStop(); - s_follow_cont = 0U; - s_pwm_on = 0U; - s_cur_freq = 0U; - s_chain_valid = 0U; - s_chain_freq = 0U; - } - + PlsrRunControlApplyKeepOrStop(0U); PlsrRunControlGotoNextOrFinish(s_cur_seg); } @@ -242,42 +331,12 @@ static void PlsrRunControlCutSegToNext(void) */ static void PlsrRunControlActExpire(void) { - int16_t next0; - uint8_t keep; - s_act_armed = 0U; s_act_expire_req = 0U; s_wait_expire_req = 0U; s_state = RC_IDLE; - next0 = PlsrPathPlanResolveAfterSeg(s_cur_seg); - keep = 0U; - if ((next0 >= 0) && - ((s_pwm_on != 0U) || (s_act_handoff_keep != 0U)) && - (s_cur_freq >= 1U) && - (PlsrPathPlanIsForward((uint16_t)next0, PlsrRunControlAbsLocalPos()) == s_forward)) - { - keep = 1U; - } - - if (keep != 0U) - { - PlsrPulseDriverClearOnePulseStop(); - s_follow_cont = 1U; - s_chain_valid = 1U; - s_chain_freq = s_cur_freq; - } - else - { - PlsrPulseDriverStop(); - PlsrPulseDriverClearOnePulseStop(); - s_follow_cont = 0U; - s_pwm_on = 0U; - s_cur_freq = 0U; - s_chain_valid = 0U; - s_chain_freq = 0U; - } - + PlsrRunControlApplyKeepOrStop(1U); s_act_handoff_keep = 0U; PlsrRunControlGotoNextOrFinish(s_cur_seg); @@ -302,15 +361,11 @@ static void PlsrRunControlEnterPostWaitOrNext(void) if (seg->wait_type == PLSR_WAIT_TIME) { wms = PlsrRunControlWaitTimeMs(seg); - PlsrPulseDriverStop(); - s_follow_cont = 0U; - s_pwm_on = 0U; - s_chain_valid = 0U; - s_chain_freq = 0U; - s_cur_freq = 0U; + PlsrRunControlClearChainAndStop(); s_wait_is_signal = 0U; - s_wait_deadline_ms = PlsrSignalIoDeadlineFromNow(wms); + PlsrRunControlWakeDrain(); s_state = RC_WAIT_COND; + PlsrSignalIoScheduleDelayMs((uint32_t)wms); return; } if (seg->wait_type == PLSR_WAIT_SIGNAL) @@ -319,12 +374,7 @@ static void PlsrRunControlEnterPostWaitOrNext(void) * 与 WAIT 时间相同:本段发完停表,再等 EXTI 确认后的下降沿。 * 只认锁存的沿,不读当前电平——口线虚低或脉冲耦合都会误跳下一段。 */ - PlsrPulseDriverStop(); - s_follow_cont = 0U; - s_pwm_on = 0U; - s_chain_valid = 0U; - s_chain_freq = 0U; - s_cur_freq = 0U; + PlsrRunControlClearChainAndStop(); if (PlsrSignalIoTakeWaitFalling() != 0U) { PlsrRunControlGotoNextOrFinish(s_cur_seg); @@ -341,12 +391,7 @@ static void PlsrRunControlEnterPostWaitOrNext(void) * 纯 EXT:脉冲发完后仍要等 EXT 沿才跳转。 * 停表,下一段从起速/起跳重新规划。 */ - PlsrPulseDriverStop(); - s_follow_cont = 0U; - s_pwm_on = 0U; - s_chain_valid = 0U; - s_chain_freq = 0U; - s_cur_freq = 0U; + PlsrRunControlClearChainAndStop(); /* 只清消抖中的假沿;已确认的 fell 保留,供下面 TakeExtFalling 消费 */ PlsrSignalIoClearPending(); if (PlsrSignalIoTakeExtFalling() != 0U) @@ -371,15 +416,15 @@ static void PlsrRunControlEnterPostWaitOrNext(void) */ static void PlsrRunControlGotoNextOrFinish(uint16_t cur_seg) { - int16_t next0 = PlsrPathPlanResolveAfterSeg(cur_seg); + int16_t next_seg_idx = PlsrRunControlNextSeg(cur_seg); - if (next0 < 0) + if (next_seg_idx < 0) { PlsrRunControlFinishAll(); } else { - PlsrRunControlBeginSeg((uint16_t)next0); + PlsrRunControlBeginSeg((uint16_t)next_seg_idx); } } @@ -428,12 +473,12 @@ static void PlsrRunControlCheckApproachCurveFault(uint8_t by_pulse_budget) /** * 0x03 减速曲线诊断 * 时机:段结束 AfterSegDone;仅当仍处 DECEL 相。 - * 条件:进入减速时记下的 remain(s_decel_budget)与相内实发脉冲不等。 + * 条件:相内步进须至少跑满进入时锁定的预算(ARPE 超前下允许 n==budget)。 */ static void PlsrRunControlCheckDecelCurveFault(void) { if ((s_phase == PH_DECEL) && (s_decel_budget > 0U) && - (s_pulse_rt.n != s_decel_budget)) + (s_pulse_rt.n < s_decel_budget)) { PlsrCommandSetFault(PLSR_ERR_CURVE_MISMATCH); } @@ -461,8 +506,6 @@ static void PlsrRunControlAfterSegDone(void) */ if (seg->wait_type == PLSR_WAIT_ACT) { - uint16_t remain; - PlsrPulseDriverStop(); PlsrPulseDriverClearOnePulseStop(); s_follow_cont = 0U; @@ -471,17 +514,24 @@ static void PlsrRunControlAfterSegDone(void) s_chain_valid = 0U; s_chain_freq = 0U; s_act_expire_req = 0U; - if ((s_act_armed != 0U) && - (PlsrSignalIoMsReached(s_act_arm_ms + (uint32_t)s_act_time_ms) == 0U)) + if (s_act_armed != 0U) { - uint32_t used = PlsrSignalIoGetMs() - s_act_arm_ms; - remain = (used < (uint32_t)s_act_time_ms) ? - (uint16_t)((uint32_t)s_act_time_ms - used) : 1U; + uint32_t remain_ms = PlsrSignalIoDelayRemainMs(); + + PlsrSignalIoCancelDelay(); s_act_armed = 0U; - s_wait_is_signal = 0U; - s_wait_deadline_ms = PlsrSignalIoDeadlineFromNow(remain); - s_state = RC_WAIT_COND; - return; + if (remain_ms >= 1U) + { + s_wait_is_signal = 0U; + PlsrRunControlWakeDrain(); + s_state = RC_WAIT_COND; + PlsrSignalIoScheduleDelayMs(remain_ms); + return; + } + } + else + { + PlsrSignalIoCancelDelay(); } s_act_armed = 0U; PlsrRunControlGotoNextOrFinish(s_cur_seg); @@ -492,11 +542,11 @@ static void PlsrRunControlAfterSegDone(void) s_act_expire_req = 0U; s_wait_expire_req = 0U; - keep_pwm = PlsrRunControlWillFollowKeep(s_cur_seg); + keep_pwm = (s_seg_end_opm == 0U) ? 1U : 0U; if (cfg->send_mode == PLSR_SEND_COMPLETE) { - /* 段正常结束:下一段起速 = 本段实际止速 plan.f_end,不能用峰值 s_cur_freq */ + /* 段正常结束:下一段起速优先用本段落地频(EXT_OR_DONE 完成时常为峰值) */ s_chain_freq = s_accel_plan.f_end; s_chain_valid = 1U; } @@ -549,19 +599,19 @@ static uint8_t PlsrRunControlBlocksFollowKeep(uint16_t cur_seg) /** * 调用/等待策略:根据发送模式、等待条件、衔接状态,解析本段 - * f_from / f_end / accel_ms / decel_ms。段内处理不读 wait_type。 + * freq_start_hz / freq_end_hz / accel_ms / decel_ms。段内处理不读 wait_type。 * * @return 1 成功 */ -static uint8_t PlsrRunControlResolveSegCallIo(uint16_t seg_0, uint32_t f_tgt, - PlsrSegCallIo_t *io) +static uint8_t PlsrRunControlResolveSegPlanEndpoints(uint16_t seg_idx0, uint32_t f_tgt, + PlsrSegPlanEndpoints_t *endpoints) { PlsrCfg_t *cfg = PlsrParamGetCfg(); - int16_t next0; - uint8_t end_at_stop; /* 1:本段终止频率用公共止速 */ + PlsrSeg_t *seg = PlsrParamGetSeg(seg_idx0); + int16_t next_seg_idx; - io->accel_ms = cfg->accel_ms; - io->decel_ms = cfg->decel_ms; + endpoints->accel_ms = cfg->accel_ms; + endpoints->decel_ms = cfg->decel_ms; /* ---------- 起始频率 ---------- * 中途切段(ACT/EXT)会置 follow_cont:用打断瞬间的频率衔接下一段。 @@ -571,73 +621,81 @@ static uint8_t PlsrRunControlResolveSegCallIo(uint16_t seg_0, uint32_t f_tgt, */ if ((s_follow_cont != 0U) && (s_cur_freq >= 1U)) { - io->f_from = s_cur_freq; + endpoints->freq_start_hz = s_cur_freq; } else if ((s_pwm_on != 0U) && (s_cur_freq >= 1U)) { - io->f_from = s_cur_freq; + endpoints->freq_start_hz = s_cur_freq; } - else if ((s_chain_valid != 0U) && (s_chain_freq >= 1U) && - ((s_pwm_on != 0U) || (s_follow_cont != 0U))) + else if ((s_chain_valid != 0U) && (s_chain_freq >= 1U)) { - io->f_from = s_chain_freq; + /* 完成模式段末停表后:用本段落地频作起速(如 EXT_OR_DONE 的匀速峰值) */ + endpoints->freq_start_hz = s_chain_freq; + s_chain_valid = 0U; + s_chain_freq = 0U; } else { - io->f_from = PlsrAccelCurveResolveStartHz(cfg->start_speed, + endpoints->freq_start_hz = PlsrAccelCurveResolveStartHz(cfg->start_speed, f_tgt, cfg->default_speed, - cfg->start_speed, - cfg->end_speed, - io->accel_ms, - io->decel_ms); + endpoints->accel_ms, + endpoints->decel_ms); } /* * ---------- 终止频率 ---------- - * 完成方式 / 真末段 / 发完后要停表等(WAIT时间/信号/纯EXT/ACT): - * 本段规划到止速。 - * EXT_OR_DONE:脉冲先完可衔接下一段;EXT 先到则丢弃剩余减速。 - * 后续方式且无门禁:过渡到下一段目标。 + * EXT_OR_DONE + 有下一段 + 同向 + 后续 → 过渡到下一段目标 + * EXT_OR_DONE + 有下一段 + 同向 + 完成 → freq_end_hz=峰值,匀速跑完 + * EXT_OR_DONE + 有下一段 + 反向 → 与 TIME/SIGNAL/ACT/EXT 相同,规划到止速 + * 真末段(无下一段)→ 一律规划到公共止速(含 EXT_OR_DONE) + * TIME / SIGNAL / ACT / EXT → 完成与后续相同,一律规划到公共止速 */ - next0 = PlsrPathPlanNextSeg(seg_0); - end_at_stop = (next0 < 0) ? 1U : 0U; + next_seg_idx = PlsrRunControlNextSeg(seg_idx0); - if ((cfg->send_mode == PLSR_SEND_COMPLETE) || - (PlsrRunControlBlocksFollowKeep(seg_0) != 0U)) + if ((seg->wait_type == PLSR_WAIT_EXT_OR_DONE) && (next_seg_idx >= 0)) { - end_at_stop = 1U; - } + int32_t end_pos = PlsrRunControlAbsLocalPos(); + uint8_t next_fwd; - if (end_at_stop != 0U) - { - io->f_end = PlsrAccelCurveResolveEndHz(cfg->end_speed, - f_tgt, - cfg->default_speed, - cfg->start_speed, - cfg->end_speed, - io->accel_ms, - io->decel_ms); - return 1U; - } + /* 用本段结束后的坐标判下一段方向(与 WillFollowKeepAt 一致) */ + if (s_forward != 0U) + { + end_pos += s_target; + } + else + { + end_pos -= s_target; + } + next_fwd = PlsrRunControlIsForward((uint16_t)next_seg_idx, end_pos); - /* 后续方式 + 有下一段:过渡到下一段目标 */ - { - PlsrSeg_t *nseg = PlsrParamGetSeg((uint16_t)next0); - if (PlsrRunControlGetSegTargetFreq(nseg->freq_hz, - cfg->default_speed, - &io->f_end) == 0U) + if (next_fwd == s_forward) { - /* 下一段频率非法:本段先止速收尾,下一段 Begin 再报 0x04 */ - io->f_end = PlsrAccelCurveResolveEndHz(cfg->end_speed, - f_tgt, - cfg->default_speed, - cfg->start_speed, - cfg->end_speed, - io->accel_ms, - io->decel_ms); + if (cfg->send_mode == PLSR_SEND_FOLLOW) + { + PlsrSeg_t *nseg = PlsrParamGetSeg((uint16_t)next_seg_idx); + if (PlsrRunControlGetSegTargetFreq(nseg->freq_hz, + cfg->default_speed, + &endpoints->freq_end_hz) != 0U) + { + return 1U; + } + /* 下一段频率非法:本段匀速收尾,下一段 Begin 再报 0x04 */ + endpoints->freq_end_hz = f_tgt; + return 1U; + } + /* 完成模式非末段同向:匀速跑完,不减速到 0 */ + endpoints->freq_end_hz = f_tgt; + return 1U; } + /* 反向:落入下方,规划到止速 */ } + + endpoints->freq_end_hz = PlsrAccelCurveResolveEndHz(cfg->end_speed, + f_tgt, + cfg->default_speed, + endpoints->accel_ms, + endpoints->decel_ms); return 1U; } @@ -668,23 +726,24 @@ static uint16_t PlsrRunControlActTimeMs(const PlsrSeg_t *seg) /** * @brief 段末是否可不停表衔接下一段 + * @param local_pos 用于判下一段方向的局部坐标(应用「本段结束后」的位置) * @note 须 FOLLOW + 有同向下一段 + 无 BlocksFollowKeep */ -static uint8_t PlsrRunControlWillFollowKeep(uint16_t cur_seg) +static uint8_t PlsrRunControlWillFollowKeepAt(uint16_t cur_seg, int32_t local_pos) { PlsrCfg_t *cfg = PlsrParamGetCfg(); - int16_t next0; + int16_t next_seg_idx; if (cfg->send_mode != PLSR_SEND_FOLLOW) { return 0U; } - next0 = PlsrPathPlanNextSeg(cur_seg); - if (next0 < 0) + next_seg_idx = PlsrRunControlNextSeg(cur_seg); + if (next_seg_idx < 0) { return 0U; } - if (PlsrPathPlanIsForward((uint16_t)next0, PlsrRunControlAbsLocalPos()) != s_forward) + if (PlsrRunControlIsForward((uint16_t)next_seg_idx, local_pos) != s_forward) { return 0U; } @@ -695,28 +754,13 @@ static uint8_t PlsrRunControlWillFollowKeep(uint16_t cur_seg) return 1U; } -/** @brief ms → OS tick(向上取整,至少 1) */ -static INT32U PlsrRunControlMsToTicks(uint32_t ms) -{ - INT32U t; - - if (ms == 0U) - { - return 0U; - } - t = ((INT32U)ms * (INT32U)OS_TICKS_PER_SEC + 999UL) / 1000UL; - if (t < 1UL) - { - t = 1UL; - } - return t; -} - -/** @brief OS 时间是否已到 deadline(有符号环绕安全) */ -static uint8_t PlsrRunControlOsTimeReached(INT32U deadline) -{ - return ((INT32S)(OSTimeGet() - deadline) >= 0) ? 1U : 0U; -} +///** +// * @brief 段末是否可不停表衔接下一段(用当前累计位置) +// */ +//static uint8_t PlsrRunControlWillFollowKeep(uint16_t cur_seg) +//{ +// return PlsrRunControlWillFollowKeepAt(cur_seg, PlsrRunControlAbsLocalPos()); +//} /** * 解析段目标频率。 @@ -792,26 +836,9 @@ static void PlsrRunControlApplyOutFreqIsr(uint32_t profile_freq) s_cur_freq = profile_freq; } -static void PlsrRunControlEnterPhase(RunPhase_e ph, uint32_t anchor_freq) -{ - s_phase = ph; - if (ph == PH_APPROACH) - { - s_approach_from = anchor_freq; - } - else if (ph == PH_DECEL) - { - s_decel_from = anchor_freq; - } - else if (ph == PH_CONST) - { - (void)anchor_freq; - } -} - static uint8_t PlsrRunControlHasDecel(void) { - return ((s_accel_plan.dec_n > 0U) && + return ((s_plan_dec_n > 0U) && (s_accel_plan.f_tgt != s_accel_plan.f_end)) ? 1U : 0U; } @@ -824,6 +851,39 @@ static uint32_t PlsrRunControlRemainPulses(void) return 0U; } +/** + * ARPE:本拍 ISR 写入的 ARR 要到「再下一拍」才被计数器使用。 + * 故在 remain==dec_n+1 时进入并写入 f(1),末拍才能吃到 f_end。 + * 若已晚进(remain<=dec_n),预算改为 remain-1,仍保证 remain==2 时落到止速。 + */ +static uint8_t PlsrRunControlShouldEnterDecel(uint32_t remain) +{ + if (PlsrRunControlHasDecel() == 0U) + { + return 0U; + } + return (remain <= (s_plan_dec_n + 1U)) ? 1U : 0U; +} + +static uint32_t PlsrRunControlDecelEnterBudget(uint32_t remain) +{ + uint32_t planned = s_plan_dec_n; + + if (planned < 1U) + { + planned = 1U; + } + if (remain > planned) + { + return planned; + } + if (remain > 1U) + { + return remain - 1U; + } + return 1U; +} + /** 绝对模式:相对本次启动原点的位置 */ static int32_t PlsrRunControlAbsLocalPos(void) { @@ -831,36 +891,39 @@ static int32_t PlsrRunControlAbsLocalPos(void) } /** - * @brief 进入减速相:用 remain 覆盖 plan.dec_n,BeginDec,锁定 s_decel_budget(0x03 用) + * @brief 进入减速相:budget 为曲线步进总数(非物理 remain),BeginDec */ -static void PlsrRunControlEnterDecel(uint32_t from_hz, uint32_t remain_pulses) +static void PlsrRunControlEnterDecel(uint32_t from_hz, uint32_t budget) { - PlsrRunControlEnterPhase(PH_DECEL, from_hz); + if (budget < 1U) + { + budget = 1U; + } + s_phase = PH_DECEL; - s_decel_budget = remain_pulses; + s_decel_budget = budget; s_accel_plan.acc_n = 0U; s_accel_plan.const_n = 0U; - s_accel_plan.dec_n = remain_pulses; + s_accel_plan.dec_n = budget; s_accel_plan.f_tgt = from_hz; - s_decel_from = from_hz; PlsrAccelPulseRtBeginDec(&s_pulse_rt, &s_accel_plan); s_pulse_rt.f = from_hz; +} - if (remain_pulses == 0U) - { - s_accel_plan.t_dec_ms = 0U; - return; - } - - if (from_hz == s_accel_plan.f_end) - { - s_accel_plan.t_dec_ms = 0U; - return; - } +/** + * 开表纯减速:Start(f1) 后再预装 f2,补偿 ARPE,使第 N 拍为 f_end。 + */ +static void PlsrRunControlPrimeDecelOnStart(void) +{ + uint32_t next; - if (s_accel_plan.t_dec_ms == 0U) + next = PlsrAccelPulseRtStep(&s_pulse_rt); + PlsrRunControlApplyOutFreq(next, 1U); + if (s_pulse_rt.n_total > 1U) { - s_accel_plan.t_dec_ms = 1U; + next = PlsrAccelPulseRtStep(&s_pulse_rt); + PlsrPulseDriverSetFreq(next); + s_cur_freq = next; } } @@ -889,7 +952,7 @@ static void PlsrRunControlEnterConstHold(uint8_t do_start) { f_hold = 1U; } - PlsrRunControlEnterPhase(PH_CONST, f_hold); + s_phase = PH_CONST; PlsrAccelPulseRtBeginConst(&s_pulse_rt, &s_accel_plan); PlsrPulseDriverClearPending(); PlsrRunControlApplyOutFreq(f_hold, do_start); @@ -903,7 +966,7 @@ static void PlsrRunControlEnterConstHoldIsr(void) { f_hold = 1U; } - PlsrRunControlEnterPhase(PH_CONST, f_hold); + s_phase = PH_CONST; PlsrAccelPulseRtBeginConst(&s_pulse_rt, &s_accel_plan); PlsrPulseDriverClearPending(); PlsrRunControlApplyOutFreqIsr(f_hold); @@ -923,10 +986,10 @@ static void PlsrRunControlRefreshProfile(uint8_t do_start) remain = PlsrRunControlRemainPulses(); if ((s_phase == PH_CONST) && - (PlsrRunControlHasDecel() != 0U) && - (remain <= s_accel_plan.dec_n)) + (PlsrRunControlShouldEnterDecel(remain) != 0U)) { - PlsrRunControlEnterDecel(s_accel_plan.f_tgt, remain); + PlsrRunControlEnterDecel(s_accel_plan.f_tgt, + PlsrRunControlDecelEnterBudget(remain)); } if (s_phase == PH_CONST) @@ -938,6 +1001,16 @@ static void PlsrRunControlRefreshProfile(uint8_t do_start) return; } + /* 纯减速开表:超前预装,避免末拍停在 f(N-1) */ + if ((s_phase == PH_DECEL) && + (do_start != 0U) && + (s_done == 0) && + (s_pulse_rt.n == 0U)) + { + PlsrRunControlPrimeDecelOnStart(); + return; + } + next = PlsrAccelCurveFreqAtPulse(&s_accel_plan, done_n); if (next < 1U) { @@ -956,10 +1029,10 @@ static void PlsrRunControlRefreshProfile(uint8_t do_start) { next = s_accel_plan.f_tgt; PlsrRunControlOnApproachDone(); - if ((PlsrRunControlHasDecel() != 0U) && - (remain <= s_accel_plan.dec_n)) + if (PlsrRunControlShouldEnterDecel(remain) != 0U) { - PlsrRunControlEnterDecel(next, remain); + PlsrRunControlEnterDecel(next, + PlsrRunControlDecelEnterBudget(remain)); } else { @@ -977,6 +1050,12 @@ static void PlsrRunControlRefreshProfile(uint8_t do_start) /** * @brief 规划本段波形并锁 PSC / 进初始相(见文件头故障 0x02) + * @param total 本段目标脉冲数 + * @param f_from 段入口频率 Hz(策略层 freq_start_hz) + * @param f_tgt 段表目标峰值 Hz + * @param f_end 段出口频率 Hz(策略层 freq_end_hz) + * @param accel_ms 加速参考时间 ms + * @param decel_ms 减速参考时间 ms * @note 与 ChangeFreq 共用;不读 wait_type */ static void PlsrRunControlPlanSeg(uint32_t total, uint32_t f_from, @@ -1002,8 +1081,6 @@ static void PlsrRunControlPlanSeg(uint32_t total, uint32_t f_from, f_tgt, f_end, cfg->default_speed, - cfg->start_speed, - cfg->end_speed, accel_ms, decel_ms, cfg->accel_mode); @@ -1023,9 +1100,8 @@ static void PlsrRunControlPlanSeg(uint32_t total, uint32_t f_from, } /* - * 锁定本段规划预算,供 0x03 对照。 - * EnterDecel 会改写 s_accel_plan.dec_n,故加速预算另存 s_plan_acc_n; - * 减速对照用进入减速瞬间的 remain(s_decel_budget)。 + * 锁定本段规划预算,供 0x03 对照与 ARPE 超前进减速。 + * EnterDecel 会改写 s_accel_plan.dec_n,故 acc/dec 预算另存。 */ s_plan_acc_n = s_accel_plan.acc_n; s_plan_dec_n = s_accel_plan.dec_n; @@ -1091,8 +1167,6 @@ static void PlsrRunControlPlanSeg(uint32_t total, uint32_t f_from, PlsrPulseDriverLockPscRange(f_lo, f_hi); } - s_approach_from = f_start; - s_decel_from = s_accel_plan.f_tgt; if (s_pwm_on == 0U) { s_cur_freq = f_start; @@ -1110,16 +1184,16 @@ static void PlsrRunControlPlanSeg(uint32_t total, uint32_t f_from, (s_accel_plan.f_end != s_accel_plan.f_tgt) && (f_start >= s_accel_plan.f_tgt)) { - PlsrRunControlEnterDecel(f_start, total); + PlsrRunControlEnterDecel(f_start, s_plan_dec_n); } else if (f_start == s_accel_plan.f_tgt) { - PlsrRunControlEnterPhase(PH_CONST, f_start); + s_phase = PH_CONST; PlsrAccelPulseRtBeginConst(&s_pulse_rt, &s_accel_plan); } else { - PlsrRunControlEnterPhase(PH_APPROACH, f_start); + s_phase = PH_APPROACH; PlsrAccelPulseRtBeginAcc(&s_pulse_rt, &s_accel_plan); } } @@ -1129,6 +1203,7 @@ static void PlsrRunControlPlanSeg(uint32_t total, uint32_t f_from, */ static void PlsrRunControlFinishAll(void) { + PlsrSignalIoCancelDelay(); PlsrPulseDriverStop(); PlsrPulseDriverUnlockPsc(); PlsrPulseDriverClearDir(); @@ -1139,20 +1214,22 @@ static void PlsrRunControlFinishAll(void) s_follow_cont = 0U; s_chain_valid = 0U; s_chain_freq = 0U; + s_dir_valid = 0U; + s_dir_expire_req = 0U; s_act_armed = 0U; s_act_expire_req = 0U; s_act_cut_pending = 0U; s_act_handoff_keep = 0U; s_wait_expire_req = 0U; s_act_time_ms = 0U; - s_act_arm_ms = 0U; + PlsrPersistNotifyMonitorChanged(); /* 全部结束:落盘累计与空闲状态 */ } /** - * @brief 开一段:算位移/方向 → 解析端点 → PlanSeg → DIR_WAIT 或衔接 RUN - * @param seg_0 0-based 段号;越界则 FinishAll + * @brief 开一段:算位移/方向 → PlanSeg → 同向直开 / 换向 DIR_WAIT / FOLLOW 衔接 + * @param seg_idx0 0-based 段号;越界则 FinishAll */ -static void PlsrRunControlBeginSeg(uint16_t seg_0) +static void PlsrRunControlBeginSeg(uint16_t seg_idx0) { PlsrSeg_t *seg; PlsrCfg_t *cfg; @@ -1160,22 +1237,22 @@ static void PlsrRunControlBeginSeg(uint16_t seg_0) int32_t move; uint32_t f_tgt; uint32_t total; - PlsrSegCallIo_t io; + PlsrSegPlanEndpoints_t endpoints; - if (seg_0 >= PlsrParamGetSegCount()) + if (seg_idx0 >= PlsrParamGetSegCount()) { PlsrRunControlFinishAll(); return; } - seg = PlsrParamGetSeg(seg_0); + seg = PlsrParamGetSeg(seg_idx0); cfg = PlsrParamGetCfg(); - s_cur_seg = seg_0; + s_cur_seg = seg_idx0; cnt = seg->pulse_cnt; if (cfg->run_mode == PLSR_POS_ABSOLUTE) { - /* 以本次启动时累计为原点:move = 段目标 − 相对原点位置 */ + /* 以首次启动锁定原点:move = 段目标 − 相对原点位置 */ move = cnt - PlsrRunControlAbsLocalPos(); if (move == 0) { @@ -1214,13 +1291,28 @@ static void PlsrRunControlBeginSeg(uint16_t seg_0) } /* 策略层解析起/止速与加减速;段内只跑 PlanSeg */ - (void)PlsrRunControlResolveSegCallIo(seg_0, f_tgt, &io); + (void)PlsrRunControlResolveSegPlanEndpoints(seg_idx0, f_tgt, &endpoints); total = (uint32_t)s_target; - PlsrRunControlPlanSeg(total, io.f_from, f_tgt, io.f_end, - io.accel_ms, io.decel_ms); + PlsrRunControlPlanSeg(total, endpoints.freq_start_hz, f_tgt, endpoints.freq_end_hz, + endpoints.accel_ms, endpoints.decel_ms); s_done = 0; s_busy = 1U; + { + /* 用本段结束后的坐标判 keep,与 AfterSegDone 一致;结果锁进 s_seg_end_opm */ + int32_t end_pos = PlsrRunControlAbsLocalPos(); + + if (s_forward != 0U) + { + end_pos += s_target; + } + else + { + end_pos -= s_target; + } + s_seg_end_opm = + (PlsrRunControlWillFollowKeepAt(seg_idx0, end_pos) == 0U) ? 1U : 0U; + } if (total == 0U) { @@ -1236,11 +1328,39 @@ static void PlsrRunControlBeginSeg(uint16_t seg_0) s_follow_cont = 0U; PlsrRunControlArmActExtOnPulseStart(); } + else if ((s_dir_valid != 0U) && (s_forward == s_dir_out)) + { + /* 与上一段同向:方向脚已对,跳过换向延时直接开表 */ + PlsrPulseDriverSetDir(s_forward); + s_state = RC_RUN; + PlsrRunControlRefreshProfile(1U); + PlsrRunControlArmActExtOnPulseStart(); + } else { PlsrPulseDriverSetDir(s_forward); - s_dir_deadline = OSTimeGet() + PlsrRunControlMsToTicks(cfg->dir_delay_ms); - s_state = RC_DIR_WAIT; + s_dir_out = s_forward; + s_dir_valid = 1U; + s_dir_expire_req = 0U; + if (cfg->dir_delay_ms == 0U) + { + s_state = RC_RUN; + PlsrRunControlRefreshProfile(1U); + PlsrRunControlArmActExtOnPulseStart(); + } + else + { + /* + * 先置 DIR_WAIT 再开 TIM5,避免极短延时下 IRQ 早于状态切换。 + */ + s_state = RC_DIR_WAIT; + PlsrRunControlWakeDrain(); + PlsrSignalIoScheduleDelayMs((uint32_t)cfg->dir_delay_ms); + if (s_cur_freq >= 1U) + { + PlsrPulseDriverPrepare(s_cur_freq); + } + } } } @@ -1257,23 +1377,97 @@ void PlsrRunControlInit(void) s_target = 0; s_acc_pulse = 0; s_abs_origin = 0; + s_abs_origin_locked = 0U; s_follow_cont = 0U; s_chain_freq = 0U; s_chain_valid = 0U; + s_dir_valid = 0U; + s_dir_out = 0U; + s_dir_expire_req = 0U; s_run_accel_ms = 0U; s_run_decel_ms = 0U; + s_plan_acc_n = 0U; + s_plan_dec_n = 0U; + s_decel_budget = 0U; + s_seg_end_opm = 0U; s_phase = PH_CONST; - s_approach_from = 0U; - s_decel_from = 0U; s_act_armed = 0U; s_act_expire_req = 0U; s_act_cut_pending = 0U; s_act_handoff_keep = 0U; s_wait_expire_req = 0U; s_act_time_ms = 0U; - s_act_arm_ms = 0U; s_wait_is_signal = 0U; - s_wait_deadline_ms = 0U; + /* s_wake_sem 在 OSInit 后由 WakeInit 创建 */ +} + +/** + * ISR/任务:唤醒 PlsrTask(二进制语义:先排空再 Post,避免残留令牌使下一段秒醒) + */ +static void PlsrRunControlWakeDrain(void) +{ + if (s_wake_sem != (OS_EVENT *)0) + { + while (OSSemAccept(s_wake_sem) > 0U) + { + /* drain */ + } + } +} + +static void PlsrRunControlWakePost(void) +{ + if (s_wake_sem != (OS_EVENT *)0) + { + (void)OSSemPost(s_wake_sem); + } +} + +/** + * @brief 创建任务唤醒信号量(见 plsr_run_control.h) + */ +void PlsrRunControlWakeInit(void) +{ + if (s_wake_sem == (OS_EVENT *)0) + { + s_wake_sem = OSSemCreate(0U); + } +} + +/** + * @brief PlsrTask 休眠(见 plsr_run_control.h) + */ +void PlsrRunControlWakePend(uint16_t timeout_ticks) +{ + INT8U err; + + if (s_wake_sem == (OS_EVENT *)0) + { + if (timeout_ticks < 1U) + { + timeout_ticks = 1U; + } + OSTimeDly((INT32U)timeout_ticks); + return; + } + OSSemPend(s_wake_sem, timeout_ticks, &err); + (void)err; +} + +/** + * @brief 是否在 TIM5 精确等待(见 plsr_run_control.h) + */ +uint8_t PlsrRunControlIsPreciseWait(void) +{ + if (s_state == RC_DIR_WAIT) + { + return 1U; + } + if ((s_state == RC_WAIT_COND) && (s_wait_is_signal == 0U)) + { + return 1U; + } + return 0U; } /** @brief 启动多段序列(见 plsr_run_control.h) */ @@ -1319,8 +1513,15 @@ uint8_t PlsrRunControlStart(uint16_t start_seg_1based) s_chain_valid = 0U; s_chain_freq = 0U; s_cur_freq = PlsrRunControlClampSpeed(cfg->start_speed); - /* 绝对模式:本次启动瞬间累计作为坐标原点(不清零监控累计) */ - s_abs_origin = s_acc_pulse; + /* + * 绝对原点:仅在首次 Start(或 ClearAccPulse 之后的第一次)锁定。 + * 相对跑完再切绝对,仍相对「第一次启动时刻」坐标,不以当前位置重定原点。 + */ + if (s_abs_origin_locked == 0U) + { + s_abs_origin = s_acc_pulse; + s_abs_origin_locked = 1U; + } PlsrSignalIoClearEdges(); PlsrRunControlBeginSeg((uint16_t)(start_seg_1based - 1U)); return 1U; @@ -1329,6 +1530,7 @@ uint8_t PlsrRunControlStart(uint16_t start_seg_1based) /** @brief 急停(见 plsr_run_control.h) */ void PlsrRunControlStop(void) { + PlsrSignalIoCancelDelay(); PlsrPulseDriverStop(); PlsrPulseDriverUnlockPsc(); PlsrPulseDriverClearDir(); @@ -1336,16 +1538,18 @@ void PlsrRunControlStop(void) s_state = RC_IDLE; s_cur_freq = 0U; s_pwm_on = 0U; - s_follow_cont = 0U; - s_chain_valid = 0U; - s_chain_freq = 0U; - s_act_armed = 0U; - s_act_expire_req = 0U; - s_act_cut_pending = 0U; - s_act_handoff_keep = 0U; - s_wait_expire_req = 0U; - s_act_time_ms = 0U; - s_act_arm_ms = 0U; + s_follow_cont = 0U; /*连续运行标志*/ + s_chain_valid = 0U;/*衔接频率是否有效*/ + s_chain_freq = 0U; /*段间衔接频率*/ + s_dir_valid = 0U;/*方向是否有效*/ + s_dir_expire_req = 0U;/*换向延时到期请求标志*/ + s_act_armed = 0U;/*ACT定时器是否已启动*/ + s_act_expire_req = 0U;/*ACT到期请求标志*/ + s_act_cut_pending = 0U;/*ACT 时间到,等待脉冲边界切段*/ + s_act_handoff_keep = 0U;/*ACT 切段后是否保持当前频率衔接*/ + s_wait_expire_req = 0U;/*段后等待到期请求标志*/ + s_act_time_ms = 0U;/*本段 ACT 定时时长*/ + PlsrPersistNotifyMonitorChanged(); /* 停机:立刻落盘累计/状态 */ } /** @brief 运行中改频(见 plsr_run_control.h) */ @@ -1384,7 +1588,6 @@ void PlsrRunControlTickMs(void) { PlsrSeg_t *seg; - /* ACT / WAIT 到期切段放任务里做(PlanSeg/BeginSeg 不能堵在 TIM3 ISR) */ if (s_act_expire_req != 0U) { s_act_expire_req = 0U; @@ -1403,21 +1606,20 @@ void PlsrRunControlTickMs(void) } return; } + if (s_dir_expire_req != 0U) + { + s_dir_expire_req = 0U; + return; + } if (s_state == RC_DIR_WAIT) { - if (PlsrRunControlOsTimeReached(s_dir_deadline) != 0U) - { - s_state = RC_RUN; - PlsrRunControlRefreshProfile(1U); - PlsrRunControlArmActExtOnPulseStart(); - } + /* 精确延时只靠 TIM5;此处占位,避免任务空转改状态 */ return; } if (s_state == RC_RUN) { - /* ISR 极少换 PSC 时挂起的改频 */ PlsrPulseDriverApplyPending(); seg = PlsrParamGetSeg(s_cur_seg); @@ -1454,38 +1656,39 @@ void PlsrRunControlTickMs(void) } } } - /* WAIT 时间 / ACT 剩余到期在 On1ms */ + /* 时间 WAIT / ACT 剩余:TIM5 OnDelayTimer 置 wait_expire_req */ } } -/** @brief TIM3 1ms 回调(见 plsr_run_control.h) */ -void PlsrRunControlOn1ms(void) +/** + * @brief TIM5 one-shot 到期 + * @note ACT:OPM 收当前拍 + cut_pending;不加减速脉冲数预测 + */ +void PlsrRunControlOnDelayTimer(void) { - if (s_state == RC_WAIT_COND) + if (s_state == RC_DIR_WAIT) { - /* WAIT 时间 / ACT※4 剩余:跟 TIM3 1ms,不走 OS 节拍 */ - if ((s_wait_is_signal == 0U) && - (PlsrSignalIoMsReached(s_wait_deadline_ms) != 0U)) - { - s_wait_expire_req = 1U; - } + s_state = RC_RUN; + PlsrRunControlRefreshProfile(1U); + PlsrRunControlArmActExtOnPulseStart(); + s_dir_expire_req = 1U; + PlsrRunControlWakePost(); return; } - if (s_state != RC_RUN) + if ((s_state == RC_RUN) && (s_act_armed != 0U)) { + /* 到点:当前拍发完就停(OPM);周期多长算多长 */ + s_act_armed = 0U; + s_act_cut_pending = 1U; + PlsrPulseDriverArmOnePulseStop(); return; } - if ((s_act_armed != 0U) && - (PlsrSignalIoMsReached(s_act_arm_ms + (uint32_t)s_act_time_ms) != 0U)) + if ((s_state == RC_WAIT_COND) && (s_wait_is_signal == 0U)) { - /* - * ACT 是运动控制条件,不参与曲线规划:加速、匀速、减速 - * 任一阶段到期都在当前脉冲 UPDATE 边界切段。 - */ - s_act_armed = 0U; - s_act_cut_pending = 1U; + s_wait_expire_req = 1U; + PlsrRunControlWakePost(); } } @@ -1509,9 +1712,12 @@ void PlsrRunControlOnPulseIsr(void) { s_acc_pulse--; } + PlsrPersistNotifyAccPulseDirty(); /* * ACT 到期切段只在脉冲边界执行,避免半个 PWM 周期改段。 + * 到点由 TIM5 置 cut_pending 并 OPM;此处收尾切段。 + * 加减速下周期长短不定,不按脉冲个数预测,墙钟可能多出「当前这一拍」的剩余。 */ if (s_act_cut_pending != 0U) { @@ -1519,6 +1725,7 @@ void PlsrRunControlOnPulseIsr(void) s_act_handoff_keep = 1U; s_state = RC_IDLE; s_act_expire_req = 1U; + PlsrRunControlWakePost(); return; } @@ -1528,18 +1735,27 @@ void PlsrRunControlOnPulseIsr(void) return; } + /* + * 倒数第二拍立刻武装 OPM(在改频/曲线步进之前)。 + * 若拖到 ISR 末尾才写 OPM,高频时下一拍已跑完甚至又开一拍 → 示波器偶发多 1。 + */ + if ((s_seg_end_opm != 0U) && (s_done >= (s_target - 1))) + { + PlsrPulseDriverArmOnePulseStop(); + } + remain = PlsrRunControlRemainPulses(); if (s_phase == PH_CONST) { /* * 匀速热路径:频率未变 → 不写寄存器。 - * 制动区:remain <= dec_n(规划好的距离)→ 进减速。 + * ARPE 超前:remain<=dec_n+1 进减速,使末拍 ARR 为 f_end。 */ - if ((PlsrRunControlHasDecel() != 0U) && - (remain <= s_accel_plan.dec_n)) + if (PlsrRunControlShouldEnterDecel(remain) != 0U) { - PlsrRunControlEnterDecel(s_accel_plan.f_tgt, remain); + PlsrRunControlEnterDecel(s_accel_plan.f_tgt, + PlsrRunControlDecelEnterBudget(remain)); next = PlsrAccelPulseRtStep(&s_pulse_rt); PlsrRunControlApplyOutFreqIsr(next); } @@ -1558,10 +1774,10 @@ void PlsrRunControlOnPulseIsr(void) { next = s_accel_plan.f_tgt; PlsrRunControlOnApproachDone(); - if ((PlsrRunControlHasDecel() != 0U) && - (remain <= s_accel_plan.dec_n)) + if (PlsrRunControlShouldEnterDecel(remain) != 0U) { - PlsrRunControlEnterDecel(next, remain); + PlsrRunControlEnterDecel(next, + PlsrRunControlDecelEnterBudget(remain)); next = PlsrAccelPulseRtStep(&s_pulse_rt); PlsrRunControlApplyOutFreqIsr(next); } @@ -1577,16 +1793,25 @@ void PlsrRunControlOnPulseIsr(void) } else /* PH_DECEL */ { - next = PlsrAccelPulseRtStep(&s_pulse_rt); - PlsrRunControlApplyOutFreqIsr(next); - } - - if (s_done >= (s_target - 1)) - { - if (PlsrRunControlWillFollowKeep(s_cur_seg) == 0U) + /* + * remain==1:末拍已在跑(ARR 在 remain==2 时写入),勿再 Step, + * 以免 n 超过 budget 误触 0x03。 + */ + if ((remain <= 1U) && + (s_pulse_rt.n_total > 0U) && + (s_pulse_rt.n >= s_pulse_rt.n_total)) { - PlsrPulseDriverArmOnePulseStop(); + next = s_accel_plan.f_end; + if (next < 1U) + { + next = 1U; + } + } + else + { + next = PlsrAccelPulseRtStep(&s_pulse_rt); } + PlsrRunControlApplyOutFreqIsr(next); } } @@ -1607,6 +1832,16 @@ void PlsrRunControlClearAccPulse(void) { s_acc_pulse = 0; s_abs_origin = 0; + s_abs_origin_locked = 0U; /* 下次 Start 重新锁定原点 */ + PlsrPersistNotifyMonitorChanged(); +} + +/** @brief 上电恢复累计(见 plsr_run_control.h) */ +void PlsrRunControlRestoreAccPulse(int32_t acc_pulse) +{ + s_acc_pulse = acc_pulse; + s_abs_origin = 0; + s_abs_origin_locked = 0U; /* 下次 Start 以当前累计为绝对原点 */ } /** diff --git a/plsr/run_control/plsr_run_control.h b/plsr/run_control/plsr_run_control.h index bb57e35..848d0b9 100644 --- a/plsr/run_control/plsr_run_control.h +++ b/plsr/run_control/plsr_run_control.h @@ -1,103 +1,49 @@ /** * @file plsr_run_control.h - * @brief 运行控制模块:多段脉冲执行状态机 + * @brief 运行控制:多段脉冲状态机(开段 → 发脉冲 → 等待/跳转 → 收尾) * - * @details 模块职责 - * 协调路径规划、加减速曲线、脉冲驱动与外部信号,完成「开段 → 发脉冲 → - * 段后等待/跳转 → 收尾」全流程。负责解析发送模式(完成/后续)、等待类型 - * (时间/信号/ACT/EXT)及段间频率衔接策略。 + * @details 解析发送模式、等待类型与段间频率衔接;协调 accel_curve / + * pulse_driver / signal_io / param。状态:IDLE / DIR_WAIT / RUN / WAIT_COND。 * - * 与其它模块关系 - * - plsr_path_plan :下一段索引、正反向判定(只读决策,不碰硬件) - * - plsr_accel_curve :段内梯形/三角/S/正弦脉冲域规划与 ISR 逐拍取频 - * - plsr_param :段表与公共参数只读访问 - * - plsr_pulse_driver:PWM 启停、方向、ARR/PSC 改频 - * - plsr_command :故障码 0x01~0x04 上报(PlsrCommandSetFault) - * - plsr_signal_io :TIM3 1ms、WAIT/EXT 下降沿、ACT/WAIT 超时 - * - * 关键数据流 - * Start → BeginSeg → PlanSeg → DIR_WAIT → RUN(脉冲 ISR 驱动) - * 段末 → AfterSegDone → EnterPostWaitOrNext / GotoNextOrFinish / FinishAll - * 运行中 EXT/ACT → CutSegToNext / ActExpire(可能不停表衔接下一段) - * - * 状态机概要(RcState_e) - * RC_IDLE :无段执行,可 Start - * RC_DIR_WAIT :方向已设,等 dir_delay_ms 后开 PWM - * RC_RUN :脉冲 ISR 推进 s_done,逐拍改频 - * RC_WAIT_COND :段后等待(时间到期或 WAIT/EXT 沿) + * 与 accel_curve 对齐的符号: + * f_tgt — 段表目标频率 Hz;s_done/s_target — 本段已发/目标脉冲数 */ #ifndef PLSR_RUN_CONTROL_H #define PLSR_RUN_CONTROL_H #include -/** - * @brief 运行控制模块初始化 - * @note 调用时机:PlsrInit 中,PulseDriver 初始化之后 - * @note 副作用:全部静态状态复位为 RC_IDLE / 非 busy - */ void PlsrRunControlInit(void); - -/** - * @brief 从指定段启动多段序列 - * @param start_seg_1based 起始段号 1-based,越界则回退到参数 start_seg - * @return 1=已开段;0=忙、无段或首段频率非法 - * @note 调用时机:PlsrStart 转发;启动前做 0x04 频率门禁 - * @note 副作用:记录绝对坐标原点、清外部沿、进入 BeginSeg - */ uint8_t PlsrRunControlStart(uint16_t start_seg_1based); - -/** - * @brief 急停 - * @note 副作用:关 PWM、清方向/链式频率/ACT/WAIT 全部标志 - */ void PlsrRunControlStop(void); - -/** - * @brief 运行中重规划剩余脉冲的目标频率 - * @param new_tgt_hz 新目标 Hz,[1, 100000] - * @return 1=成功;0=非 RUN、非法频率或本段已完成 - * @note 副作用:remain=s_target-s_done 作为新总长,f_from=s_cur_freq 重 PlanSeg - */ -uint8_t PlsrRunControlChangeFreq(uint32_t new_tgt_hz); - -/** - * @brief TIM3 1ms 回调(由 signal_io 转发) - * @note 调用时机:TIM3 UPDATE 中断,仅处理 ACT 到期置位、WAIT 时间到期置位 - * @note 副作用:置 s_act_cut_pending / s_wait_expire_req,实际切段在 TickMs - */ -void PlsrRunControlOn1ms(void); - -/** - * @brief 脉冲 UPDATE 中断回调 - * @note 调用时机:每发一个脉冲;仅在 RC_RUN 有效 - * @note 副作用:s_done++、累计坐标、逐拍 Step 改频、段末 AfterSegDone - */ +uint8_t PlsrRunControlIsBusy(void); +uint16_t PlsrRunControlGetCurSeg(void); +int32_t PlsrRunControlGetAccPulse(void); +void PlsrRunControlClearAccPulse(void); +/** @brief 上电从 BKPSRAM 恢复累计脉冲(不清绝对原点锁以外的运行态) */ +void PlsrRunControlRestoreAccPulse(int32_t acc_pulse); +uint32_t PlsrRunControlGetCurFreq(void); +void PlsrRunControlTickMs(void); +/** @brief TIM5 单次延时到期(换向 / WAIT / ACT 剩余) */ +void PlsrRunControlOnDelayTimer(void); void PlsrRunControlOnPulseIsr(void); +uint8_t PlsrRunControlChangeFreq(uint32_t freq_hz); /** - * @brief 毫秒级任务节拍(PlsrTask 中调用) - * @note 处理:ACT/WAIT 到期切段、DIR_WAIT 超时开跑、EXT 沿 CutSeg、ApplyPending + * @brief 创建任务唤醒信号量(须在 OSInit 之后、首次 Pend/Post 之前) */ -void PlsrRunControlTickMs(void); - -/** @return 1=运动中(s_busy) */ -uint8_t PlsrRunControlIsBusy(void); - -/** @return 累计脉冲有符号计数 */ -int32_t PlsrRunControlGetAccPulse(void); - -/** 清零累计脉冲与绝对原点 */ -void PlsrRunControlClearAccPulse(void); +void PlsrRunControlWakeInit(void); /** - * @return 当前段号 1-based;空闲时返回 0 + * @brief PlsrTask 休眠:被 ISR Post 立刻醒,或最多等 timeout_ticks 个 OS 节拍 + * @param timeout_ticks 与 OSSemPend 相同;0=一直等到 Post;常用 1 */ -uint16_t PlsrRunControlGetCurSeg(void); +void PlsrRunControlWakePend(uint16_t timeout_ticks); /** - * @return 当前输出/profile 频率 Hz(监控 0x2002 数据源) + * @brief 是否在 TIM5 单次延时等待(换向 / WAIT 时间) + * @note 此时 WakePend(0) 只等到期 Post */ -uint32_t PlsrRunControlGetCurFreq(void); +uint8_t PlsrRunControlIsPreciseWait(void); #endif diff --git a/plsr/signal_io/plsr_signal_io.c b/plsr/signal_io/plsr_signal_io.c index f75ade5..3dc8e3c 100644 --- a/plsr/signal_io/plsr_signal_io.c +++ b/plsr/signal_io/plsr_signal_io.c @@ -1,105 +1,104 @@ /** * @file plsr_signal_io.c - * @brief WAIT/EXT 输入与 TIM3 1ms 时基实现 + * @brief WAIT/EXT 输入 + TIM5 单次延时 + OS 节拍消抖 * - * @details 模块职责 - * EXTI 下降沿 → pending → TIM3 每 ms 累加 wait_ms,满 20ms 且口线仍低 → fell。 - * 触发只认「确认后的 fell」,不靠平时扫口,避免脉冲耦合尖峰误切段。 - * - * 硬件 - * X4=PB5 / EXTI9_5;X5=PG12 / EXTI15_10;上拉,空闲高。 - * TIM3:PSC=83、ARR=999 → 约 1ms @ 84MHz APB1 定时器时钟惯例。 - * - * 静态状态 - * s_ms — 自由运行毫秒 - * s_db_x4/x5 — 每口 pending / wait_ms / fell - * s_htim3 — 时基句柄 + * @details + * EXTI 下降沿 → pending;DebouncePoll 满约 20ms 且仍低 → fell。 + * TIM5(32 位,APB1 84MHz):有延时才开表。 + * PSC=8399 → 10kHz(1 次计数 = 100µs) + * ARR = delay_ms×10 − 1 → 一次溢出 = 设定的 ms(分辨率 0.1ms,够用) */ #include "plsr_signal_io.h" #include "plsr_param.h" #include "plsr_run_control.h" #include "main.h" +#include "ucos_ii.h" #define PLSR_X4_PORT GPIOB #define PLSR_X4_PIN GPIO_PIN_5 #define PLSR_X5_PORT GPIOG #define PLSR_X5_PIN GPIO_PIN_12 -#define PLSR_TIM3_PSC 83U -#define PLSR_TIM3_ARR 999U +/* + * 84MHz / 8400 = 10kHz → 100µs/格。 + * PSC=8399 落在 16 位内;不必用 1µs(那只是为了硬凑,ms 延时用不上)。 + */ +#define PLSR_TIM5_PSC_100US 8399U +#define PLSR_TIM5_TICKS_PER_MS 10U /* 10×100µs = 1ms */ +#define PLSR_DELAY_MS_MAX 65535U #define PLSR_SIGNAL_DEBOUNCE_MS 20U -/** - * 单路输入消抖状态 - * pending — EXTI 已见下降沿,等待 20ms 确认 - * wait_ms — 消抖累计 ms(TIM3 递增) - * fell — 确认有效,供 Take* 读清 - */ typedef struct { volatile uint8_t pending; - volatile uint8_t wait_ms; + volatile uint8_t stamp_ok; + volatile INT32U arm_tick; volatile uint8_t fell; GPIO_TypeDef *port; uint16_t pin; } PlsrEdge_t; -static volatile uint32_t s_ms; -static PlsrEdge_t s_db_x4; -static PlsrEdge_t s_db_x5; +static PlsrEdge_t s_db_x4; /* X4 输入消抖状态(WAIT/EXT 共用) */ +static PlsrEdge_t s_db_x5; /* X5 输入消抖状态 */ +static volatile uint8_t s_delay_armed; /* 1=TIM5 单次延时正在计时 */ -static TIM_HandleTypeDef s_htim3; +static INT32U PlsrSignalIoMsToTicks(uint32_t ms) +{ + INT32U t; -/*============================================================================*/ -/* 消抖辅助 */ -/*============================================================================*/ + if (ms == 0U) + { + return 1U; + } + t = ((INT32U)ms * (INT32U)OS_TICKS_PER_SEC + 999U) / 1000U; + if (t < 1U) + { + t = 1U; + } + return t; +} -/** @return 1=口线当前为低(接地) */ static uint8_t PlsrSignalIoPinIsLow(const PlsrEdge_t *db) { return (HAL_GPIO_ReadPin(db->port, db->pin) == GPIO_PIN_RESET) ? 1U : 0U; } -/** @brief EXTI 入口:置 pending,清消抖计时,等待 TIM3 确认 */ static void PlsrSignalIoOnFalling(PlsrEdge_t *db) { db->pending = 1U; - db->wait_ms = 0U; + db->stamp_ok = 0U; } -/** - * @brief TIM3 每 ms 调用:pending 满 20ms 后读电平 - * @note 仍为低才置 fell;已回高则丢弃(滤耦合尖峰) - */ static void PlsrSignalIoDebounceConfirm(PlsrEdge_t *db) { + INT32U need; + if (db->pending == 0U) { return; } - if (db->wait_ms < 0xFFU) + if (db->stamp_ok == 0U) { - db->wait_ms++; + db->arm_tick = OSTimeGet(); + db->stamp_ok = 1U; + return; } - if (db->wait_ms < PLSR_SIGNAL_DEBOUNCE_MS) + + need = PlsrSignalIoMsToTicks(PLSR_SIGNAL_DEBOUNCE_MS); + if ((OSTimeGet() - db->arm_tick) < need) { return; } db->pending = 0U; - /* 尖峰/耦合在 20ms 后已回到高,不算触发;飞线接地保持为低才算 */ + db->stamp_ok = 0U; if (PlsrSignalIoPinIsLow(db) != 0U) { db->fell = 1U; } } -/*============================================================================*/ -/* 硬件初始化 */ -/*============================================================================*/ - -/** @brief X4/X5 下降沿 EXTI + NVIC(优先级 8) */ static void PlsrSignalIoGpioExtiInit(void) { GPIO_InitTypeDef gpio = {0}; @@ -117,7 +116,6 @@ static void PlsrSignalIoGpioExtiInit(void) gpio.Pin = PLSR_X4_PIN; HAL_GPIO_Init(PLSR_X4_PORT, &gpio); - gpio.Pin = PLSR_X5_PIN; HAL_GPIO_Init(PLSR_X5_PORT, &gpio); @@ -132,45 +130,44 @@ static void PlsrSignalIoGpioExtiInit(void) HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); } -/** @brief TIM3 约 1ms 基时 + UPDATE 中断(优先级 9) */ -static void PlsrSignalIoTim3Init(void) +static void PlsrSignalIoTim5Init(void) { - __HAL_RCC_TIM3_CLK_ENABLE(); - - s_htim3.Instance = TIM3; - s_htim3.Init.Prescaler = PLSR_TIM3_PSC; - s_htim3.Init.CounterMode = TIM_COUNTERMODE_UP; - s_htim3.Init.Period = PLSR_TIM3_ARR; - s_htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - s_htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - (void)HAL_TIM_Base_Init(&s_htim3); - - HAL_NVIC_SetPriority(TIM3_IRQn, 9, 0); - HAL_NVIC_EnableIRQ(TIM3_IRQn); - (void)HAL_TIM_Base_Start_IT(&s_htim3); + __HAL_RCC_TIM5_CLK_ENABLE(); + + TIM5->CR1 = 0U; + TIM5->DIER = 0U; + TIM5->SR = 0U; + TIM5->PSC = PLSR_TIM5_PSC_100US; + TIM5->ARR = 0xFFFFFFFFUL; + TIM5->CNT = 0U; + TIM5->EGR = TIM_EGR_UG; + TIM5->SR = 0U; + + HAL_NVIC_SetPriority(TIM5_IRQn, 7, 0); + HAL_NVIC_EnableIRQ(TIM5_IRQn); } -/** @brief 模块初始化(见 plsr_signal_io.h) */ void PlsrSignalIoInit(void) { - s_ms = 0U; + s_delay_armed = 0U; s_db_x4.port = PLSR_X4_PORT; s_db_x4.pin = PLSR_X4_PIN; s_db_x4.pending = 0U; - s_db_x4.wait_ms = 0U; + s_db_x4.stamp_ok = 0U; + s_db_x4.arm_tick = 0U; s_db_x4.fell = 0U; s_db_x5.port = PLSR_X5_PORT; s_db_x5.pin = PLSR_X5_PIN; s_db_x5.pending = 0U; - s_db_x5.wait_ms = 0U; + s_db_x5.stamp_ok = 0U; + s_db_x5.arm_tick = 0U; s_db_x5.fell = 0U; PlsrSignalIoGpioExtiInit(); - PlsrSignalIoTim3Init(); + PlsrSignalIoTim5Init(); - /* 配置 EXTI 时可能打出假沿,丢掉 */ __HAL_GPIO_EXTI_CLEAR_IT(PLSR_X4_PIN); __HAL_GPIO_EXTI_CLEAR_IT(PLSR_X5_PIN); s_db_x4.fell = 0U; @@ -179,55 +176,98 @@ void PlsrSignalIoInit(void) s_db_x5.pending = 0U; } -/*============================================================================*/ -/* 时基 / 沿 API */ -/*============================================================================*/ +void PlsrSignalIoScheduleDelayMs(uint32_t delay_ms) +{ + uint32_t ticks; + + if (delay_ms < 1U) + { + delay_ms = 1U; + } + if (delay_ms > PLSR_DELAY_MS_MAX) + { + delay_ms = PLSR_DELAY_MS_MAX; + } + + /* N ms → N×10 个 100µs 格 */ + ticks = delay_ms * PLSR_TIM5_TICKS_PER_MS; + + TIM5->CR1 = 0U; + TIM5->DIER = 0U; + TIM5->SR = 0U; + TIM5->PSC = PLSR_TIM5_PSC_100US; + TIM5->ARR = ticks - 1U; + TIM5->CR1 = TIM_CR1_URS; + TIM5->EGR = TIM_EGR_UG; + TIM5->SR = 0U; + TIM5->CNT = 0U; + TIM5->DIER = TIM_DIER_UIE; + s_delay_armed = 1U; + TIM5->CR1 = (uint32_t)(TIM_CR1_CEN | TIM_CR1_OPM | TIM_CR1_URS); +} -uint32_t PlsrSignalIoGetMs(void) +void PlsrSignalIoCancelDelay(void) { - return s_ms; + TIM5->CR1 = 0U; + TIM5->DIER = 0U; + TIM5->SR = 0U; + s_delay_armed = 0U; } -uint32_t PlsrSignalIoDeadlineFromNow(uint32_t ms) +uint32_t PlsrSignalIoDelayRemainMs(void) { - if (ms == 0U) + uint32_t arr; + uint32_t cnt; + uint32_t left_ticks; + + if (s_delay_armed == 0U) { - return s_ms; + return 0U; } - return s_ms + ms; + if ((TIM5->CR1 & TIM_CR1_CEN) == 0U) + { + return 0U; + } + + arr = TIM5->ARR; + cnt = TIM5->CNT; + if (cnt >= (arr + 1U)) + { + return 0U; + } + left_ticks = (arr + 1U) - cnt; + return left_ticks / PLSR_TIM5_TICKS_PER_MS; } -uint8_t PlsrSignalIoMsReached(uint32_t deadline_ms) +void PlsrSignalIoDebouncePoll(void) { - return ((int32_t)(s_ms - deadline_ms) >= 0) ? 1U : 0U; + PlsrSignalIoDebounceConfirm(&s_db_x4); + PlsrSignalIoDebounceConfirm(&s_db_x5); } void PlsrSignalIoClearEdges(void) { s_db_x4.fell = 0U; s_db_x4.pending = 0U; + s_db_x4.stamp_ok = 0U; s_db_x5.fell = 0U; s_db_x5.pending = 0U; + s_db_x5.stamp_ok = 0U; } void PlsrSignalIoClearPending(void) { s_db_x4.pending = 0U; + s_db_x4.stamp_ok = 0U; s_db_x5.pending = 0U; + s_db_x5.stamp_ok = 0U; } -/** @brief sel 0=X4,非 0=X5 */ static PlsrEdge_t *PlsrSignalIoDbBySel(uint16_t sel_01) { return (sel_01 != 0U) ? &s_db_x5 : &s_db_x4; } -uint8_t PlsrSignalIoWaitIsOn(void) -{ - PlsrCfg_t *cfg = PlsrParamGetCfg(); - return PlsrSignalIoPinIsLow(PlsrSignalIoDbBySel(cfg->wait_x_sel)); -} - uint8_t PlsrSignalIoTakeWaitFalling(void) { PlsrCfg_t *cfg = PlsrParamGetCfg(); @@ -254,20 +294,18 @@ uint8_t PlsrSignalIoTakeExtFalling(void) return 0U; } -/*============================================================================*/ -/* 中断入口(由 stm32f4xx_it 转发) */ -/*============================================================================*/ - -/** @brief TIM3:清 UIF → s_ms++ → 消抖 → RunControlOn1ms */ -void PlsrSignalIoOnTim3Irq(void) +void PlsrSignalIoOnTim5Irq(void) { - if ((TIM3->SR & TIM_SR_UIF) != 0U) + if ((TIM5->SR & TIM_SR_UIF) != 0U) { - TIM3->SR = (uint32_t)~TIM_SR_UIF; - s_ms++; - PlsrSignalIoDebounceConfirm(&s_db_x4); - PlsrSignalIoDebounceConfirm(&s_db_x5); - PlsrRunControlOn1ms(); + TIM5->SR = (uint32_t)~TIM_SR_UIF; + TIM5->DIER = 0U; + TIM5->CR1 = 0U; + if (s_delay_armed != 0U) + { + s_delay_armed = 0U; + PlsrRunControlOnDelayTimer(); + } } } diff --git a/plsr/signal_io/plsr_signal_io.h b/plsr/signal_io/plsr_signal_io.h index 2acd06d..fc2d228 100644 --- a/plsr/signal_io/plsr_signal_io.h +++ b/plsr/signal_io/plsr_signal_io.h @@ -1,93 +1,50 @@ /** * @file plsr_signal_io.h - * @brief WAIT/EXT 外部输入与 TIM3 1ms 时基 + * @brief WAIT/EXT 外部输入与 TIM5 单次延时 * * @details 模块职责 * 1. 配置 X4=PB5、X5=PG12 为下降沿 EXTI(上拉空闲高,飞线接地出沿); - * 2. 20ms 消抖确认后锁存 fell,供 run_control 消费; - * 3. TIM3 自由运行毫秒计数,驱动 ACT/WAIT 到期与消抖确认,并转发 On1ms。 + * 2. 消抖:EXTI 置 pending,任务侧按 OS 节拍确认 20ms 仍低 → fell; + * 3. TIM5(32 位)仅在有延时时开启:100µs 时基,ARR=ms×10−1, + * 一次计满 = 设定 ms(最长 65535ms),到期 UPDATE → OnDelayTimer。 * * 与其它模块关系 - * - plsr_param :wait_x_sel / ext_x_sel 选择 X4 或 X5 - * - plsr_run_control :TakeWait/ExtFalling、GetMs/Deadline/MsReached、On1ms - * - stm32f4xx_it :TIM3 / EXTI9_5 / EXTI15_10 转发到本模块 On* 入口 - * - * 关键约定 - * ClearEdges — 清 pending+fell(开跑 EXT、Start) - * ClearPending— 只清消抖中假沿,保留已确认 fell(纯 EXT 发完后过滤耦合) - * Take* — 读清 fell,一次按压只切一次段 + * - plsr_param :wait_x_sel / ext_x_sel + * - plsr_run_control :TakeWait/ExtFalling、ScheduleDelayMs、OnDelayTimer + * - plsr.c :周期调用 DebouncePoll + * - stm32f4xx_it :TIM5 / EXTI 转发 */ #ifndef PLSR_SIGNAL_IO_H #define PLSR_SIGNAL_IO_H #include -/** - * @brief 初始化 GPIO EXTI + TIM3 1ms - * @note 调用时机:PlsrInit;配置后清假沿 - */ void PlsrSignalIoInit(void); /** - * @brief 读取 TIM3 毫秒计数(自由运行,约 1ms/格) - * @return 自 Init 起累加的 ms;可能无符号环绕 + * @brief 武装 TIM5 单次延时(ms),到期进 OnDelayTimer + * @param delay_ms 0 按 1ms;上限 65535ms */ -uint32_t PlsrSignalIoGetMs(void); +void PlsrSignalIoScheduleDelayMs(uint32_t delay_ms); -/** - * @brief 从当前 ms 起算 deadline - * @param ms 延时;0 表示立即到期(deadline=当前) - */ -uint32_t PlsrSignalIoDeadlineFromNow(uint32_t ms); +void PlsrSignalIoCancelDelay(void); /** - * @brief 判断是否已到或过期 - * @return 1=已到(含无符号环绕比较);0=未到 + * @brief 读 TIM5 单次延时剩余 ms(未武装或已停表返回 0;向下取整) */ -uint8_t PlsrSignalIoMsReached(uint32_t deadline_ms); +uint32_t PlsrSignalIoDelayRemainMs(void); -/** - * @brief 清 WAIT/EXT 下降沿锁存(含已确认 fell 与 pending) - * @note Start / EXT 开跑时调用,避免旧沿立刻切段 - */ -void PlsrSignalIoClearEdges(void); +void PlsrSignalIoDebouncePoll(void); -/** - * @brief 只清消抖 pending,保留已确认 fell - * @note 纯 EXT 脉冲发完后过滤 Y 口耦合假沿,同时保留真沿供 TakeExt - */ +void PlsrSignalIoClearEdges(void); void PlsrSignalIoClearPending(void); - -/** - * @brief WAIT 口当前是否为低(已接地) - * @note 仅段末判断等场景读一次;不作周期轮询触发(触发只认 EXTI+消抖) - */ -uint8_t PlsrSignalIoWaitIsOn(void); - -/** - * @brief 消耗一次已确认的 WAIT 口下降沿 - * @return 1=有沿并已清;0=无 - * @note ※2 段中接地保持 → 发完立刻下一段;※3 未触发则 RC_WAIT_COND 一直等 - */ uint8_t PlsrSignalIoTakeWaitFalling(void); - -/** - * @brief 消耗一次已确认的 EXT 口下降沿 - * @return 1=有沿并已清;0=无 - * @note 运行中 EXT / EXT_OR_DONE 切段;一次按压只切一次 - */ uint8_t PlsrSignalIoTakeExtFalling(void); -/** - * @brief TIM3 UPDATE 中断入口 - * @note s_ms++、消抖确认、转发 PlsrRunControlOn1ms - */ -void PlsrSignalIoOnTim3Irq(void); - -/** @brief EXTI9_5:处理 X4=PB5 下降沿 → 置 pending */ -void PlsrSignalIoOnExti9_5(void); +/** @brief TIM5 UPDATE:单次延时到期 */ +void PlsrSignalIoOnTim5Irq(void); -/** @brief EXTI15_10:处理 X5=PG12 下降沿 → 置 pending */ -void PlsrSignalIoOnExti15_10(void); +void PlsrSignalIoOnExti9_5(void); +void PlsrSignalIoOnExti15_10(void); #endif