USR/SRC/Motor.c
@@ -4,10 +4,19 @@ #include "gd32e23x_timer.h" #include "bldc_ctrl.h" #include "pwm.h" #include "string.h" static volatile motor_rotate_t motor_drive = {0}; static uint32_t motor_pluse = 0; static void motor_phasechange(void); static void update_speed_dir(uint8_t dir_in); extern void Motor_Init(void) { motor_drive.timeout = 0; motor_drive.speed = 0; motor_drive.enable_flag = 0; memset(motor_drive.speed_group, 0, SPEED_FILTER_NUM); }; /** * @brief ʹÄÜ»ô¶û´«¸ÐÆ÷ * @param ÎÞ