将 CURRENT_OFFSET 从 0 修改为 -1.60f 以校准电流采样偏差。 同时将 ADC 规则通道的采样时间从 55.5 周期调整为 28.5 周期,提高采样响应速度。 feat(timer): 新增 TIMER1 中断及 PWM 周期位置触发功能 新增 TIMER1_CH3 用于在 PWM 周期特定位置(如 50%)触发中断,并配置相关 NVIC 和中断处理逻辑。 修改 TIMER3 的定时周期注释与实际值一致,为 50 微秒。 重新组织 TIMER2 中断中的任务调度顺序,提升执行效率和逻辑清晰度。 refactor(main): 重构主循环任务处理顺序 调整 main.cpp 中任务执行顺序,确保高优先级任务及时处理。 将部分传感器更新任务移动至更合理的位置,保证数据同步性和控制实时性。
29 lines
571 B
C
29 lines
571 B
C
#ifndef _TIMER_H
|
|
#define _TIMER_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
|
|
void User_timer_init(void);
|
|
void Set_Pwm(uint16_t channel, float duty_cycle);
|
|
void Set_3Pwm(float duty_cycle0, float duty_cycle1,float duty_cycle2);
|
|
void TIMER2_IRQHandler(void);
|
|
void TIMER3_config(void);
|
|
void TIMER3_IRQHandler(void);
|
|
|
|
void timer1_pwm_config(void);
|
|
void timer1_gpio_config(void);
|
|
void TIMER1_IRQHandler(void); // 添加TIMER1中断处理函数声明
|
|
|
|
/* 获取系统运行时间 */
|
|
uint64_t get_system_runtime_us(void);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif |