Jelajahi Sumber

update code

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 5 tahun lalu
induk
melakukan
05bc2973c1

+ 17 - 2
Application/Bsp/bsp.c

@@ -1,19 +1,34 @@
 #include "bsp/bsp.h"
-#include "hal/hal.h"
-#include "hal/pwm.h"
 #include "foc/foc.h"
 
 void system_init(void){
 	HAL_Init();
 	SystemClock_Config();
 	HAL_GPIO_init();
+	HAL_NVIC_Init();
+	HAL_EXIT_Init();
 	HAL_PWM_Init(FOC_FS);
+	HAL_ADC1_Init();
 }
 
 void system_reboot(void){
 	
 }
 
+int get_hall_stat(int samples) {
+	samples = 1 + 2 * samples;
+
+	int h1 = 0, h2 = 0, h3 = 0;
+	int tres = samples / 2;
+
+	while (samples--) {
+		h1 += READ_HALL1();
+		h2 += READ_HALL2();
+		h3 += READ_HALL3();
+	}
+	return (h1 > tres) | ((h2 > tres) << 1) | ((h3 > tres) << 2);
+}
+
 void wdog_reload(void){
 #if CONFIG_DEBUG == 0
    

+ 5 - 0
Application/Bsp/bsp.h

@@ -1,8 +1,13 @@
 #ifndef __BSP_H__
 #define __BSP_H__
 
+#include "hal/hal.h"
+#include "hal/pwm.h"
+#include "hal/adc.h"
+
 void system_init(void);
 void system_reboot(void);
+int get_hall_stat(int samples);
 void wdog_reload(void);
 void wdog_enable(void);
 

+ 22 - 0
Application/Bsp/foc_irqs.c

@@ -1,11 +1,13 @@
 #include "stm32f3xx_hal.h"
 #include "stm32f3xx_ll_tim.h"
 #include "stm32f3xx_ll_adc.h"
+#include "stm32f3xx_ll_exti.h"
 
 __weak void foc_brake_handler(void) {}
 __weak void foc_pwm_up_handler(void) {}
 __weak void system_tick_handler(void){}
 __weak void current_sample_handler(void){}
+__weak void hall_sensor_handler(void){}
 
 void TIM1_BRK_TIM15_IRQHandler(void){
 	if (LL_TIM_IsActiveFlag_BRK2(TIM1))
@@ -32,3 +34,23 @@ void SysTick_Handler(void)
 	system_tick_handler();
 }
 
+void EXTI3_IRQHandler(void) {
+  	if ( LL_EXTI_ReadFlag_0_31(LL_EXTI_LINE_3) )
+  	{
+    	LL_EXTI_ClearFlag_0_31 (LL_EXTI_LINE_3);
+  		hall_sensor_handler();
+  	}
+}
+
+void EXTI15_10_IRQHandler(void) {
+  	if ( LL_EXTI_ReadFlag_0_31(LL_EXTI_LINE_10) )
+  	{
+    	LL_EXTI_ClearFlag_0_31 (LL_EXTI_LINE_10);
+    	hall_sensor_handler();
+  	}
+   	if ( LL_EXTI_ReadFlag_0_31(LL_EXTI_LINE_15) )
+  	{
+    	LL_EXTI_ClearFlag_0_31 (LL_EXTI_LINE_15);
+    	hall_sensor_handler();
+  	} 
+}

+ 18 - 24
Application/FOC/foc.c

@@ -1,25 +1,25 @@
 #include <string.h>
 #include "libs/task.h"
-#include "hal/pwm.h"
-#include "hal/hal.h"
+#include "bsp/bsp.h"
 #include "foc/foc.h"
 #include "foc/park_clark.h"
 #include "foc/svpwm.h"
 #include "foc/foc_task.h"
 #include "foc/phase_current.h"
+#include "foc/hall_speed.h"
 
 static void charge_cap_timer_handler(timer_t *t);
 static u32 foc_main_task_handler(void);
 
 static timer_t charge_cap_timer = {.handler = charge_cap_timer_handler};
 static motor_foc_t m_foc;
-u16 _hall_table[] = {0xFFFF, 292, 47, 1, 180, 227, 113, 0xFFFF};
 
 void foc_init(void) {
 	/* init pwm hardware timer */
 	m_foc.state = IDLE;
 	m_foc.gate_output = false;
-	memcpy(m_foc.hall_table, _hall_table, sizeof(_hall_table));
+
+	hall_sensor_init();
 	
 	PWM_TimerInit();
 
@@ -28,21 +28,16 @@ void foc_init(void) {
 	foc_hall_detect(6.0f, (u16 *)m_foc.hall_table);
 }
 
-void foc_motor_spin(dq_t *dq_v, float angle) {
-	alpha_beta_t alphabeta;
-	phase_time_t phase_time;
-	u8 sector = 0xFF;
-	Rev_Park(dq_v, degree_2_pi(angle), &alphabeta);
-	svpwm(&alphabeta, MAX_VBUS, FOC_PWM_period/2, &phase_time, &sector);
-	PWM_UpdateDuty(phase_time.A, phase_time.B, phase_time.C, FOC_PWM_period/2);
-}
-
 int foc_hall_detect(float current, u16 *hall_table){
-	dq_t dq_v = {.d = 0.0f, .q = 0.0f};
 	foc_start_pwm(true);
+	m_foc.override_p.is_override_theta = true;
+	m_foc.override_p.theta = 0.0f;
+	m_foc.override_p.is_override_v_dq = true;
+	m_foc.override_p.v_dq.d = .0f;
+	m_foc.override_p.v_dq.q = .0f;
+	
 	for (int i = 0;i < 1000;i++) {
-		dq_v.d = (float)i * current / 1000.0f;
-		foc_motor_spin(&dq_v, 0);
+		m_foc.override_p.v_dq.d = (float)i * current / 1000.0f;
 		task_udelay(1000);
 	}
 	float sin_hall[8];
@@ -55,10 +50,10 @@ int foc_hall_detect(float current, u16 *hall_table){
 	// Forwards
 	for (int i = 0;i < 3;i++) {
 		for (int j = 0;j < 360;j++) {
-			foc_motor_spin(&dq_v, j);
+			m_foc.override_p.theta = j;
 			task_udelay(10 * 1000);
 
-			int hall = HALL_Read(7);
+			int hall = get_hall_stat(7);
 			float s, c;
 			normal_sincosf(degree_2_pi(j), &s, &c);
 			sin_hall[hall] += s;
@@ -70,10 +65,10 @@ int foc_hall_detect(float current, u16 *hall_table){
 	// Reverse
 	for (int i = 0;i < 3;i++) {
 		for (int j = 360;j >= 0;j--) {
-			foc_motor_spin(&dq_v, j);
+			m_foc.override_p.theta = j;
 			task_udelay(10 * 1000);
 
-			int hall = HALL_Read(7);
+			int hall = get_hall_stat(7);
 			float s, c;
 			normal_sincosf(degree_2_pi(j), &s, &c);
 			sin_hall[hall] += s;
@@ -81,6 +76,9 @@ int foc_hall_detect(float current, u16 *hall_table){
 			hall_iterations[hall]++;
 		}
 	}
+	foc_start_pwm(false);
+	m_foc.override_p.is_override_theta = false;
+	m_foc.override_p.is_override_v_dq = false;
 	int fails = 0;
 	for(int i = 0;i < 8;i++) {
 		if (hall_iterations[i] > 30) {
@@ -92,7 +90,6 @@ int foc_hall_detect(float current, u16 *hall_table){
 			fails++;
 		}
 	}
-	foc_start_pwm(false);
 	return fails == 2;	
 }
 
@@ -129,9 +126,6 @@ void foc_pwm_up_handler(void){
 	phase_current_adc_triger(&m_foc.current_samp);
 }
 
-void hall_detect_handler(void) {
-
-}
 
 void current_sample_handler(void) {
 	foc_task(&m_foc);

+ 0 - 1
Application/FOC/foc.h

@@ -5,7 +5,6 @@
 
 void foc_init(void);
 void set_dq_voltage(float d_v, float q_v);
-void foc_motor_spin(dq_t *dq_v, float angle);
 void foc_start_pwm(bool start);
 int foc_hall_detect(float current, u16 *hall_table);
 

+ 6 - 2
Application/FOC/foc_task.c

@@ -11,7 +11,7 @@ void foc_task(motor_foc_t *foc){
 	alpha_beta_t sample_ab, pwm_ab;
 	dq_t         sample_dq, v_dq;
 	phase_time_t         phase_time;
-	foc->motor_s.theta = hall_get_theta();
+	foc->motor_s.theta = hall_sensor_get_theta();
 	if (foc->override_p.is_override_theta) {
 		foc->motor_s.theta = foc->override_p.theta;
 	}
@@ -26,9 +26,13 @@ void foc_task(motor_foc_t *foc){
 		v_dq.d = foc->dq_ref.d;
 		v_dq.q = foc->dq_ref.q;
 	}
+	if (foc->override_p.is_override_v_dq) {
+		v_dq.d = foc->override_p.v_dq.d;
+		v_dq.q = foc->override_p.v_dq.q;
+	}
 	Rev_Park(&v_dq, foc->motor_s.theta, &pwm_ab);
 
-	svpwm(&pwm_ab, foc->vbus, FOC_PWM_period/2, &phase_time, &foc->sector);
+	svpwm(&pwm_ab, foc->vbus, FOC_PWM_Half_Period, &phase_time, &foc->sector);
 	
 	u32 sample_point = get_phase_sample_point(c_sample, &phase_time, foc->sector);
 	

+ 70 - 4
Application/FOC/hall_speed.c

@@ -1,11 +1,77 @@
-#include "hal/hal.h"
+#include <string.h>
+#include "bsp/bsp.h"
+#include "libs/task.h"
+#include "math/fast_math.h"
 #include "hall_speed.h"
 
-float hall_get_theta(void){
-	return 0.0f;
+#define HALL_READ_TIMES 7
+
+static u16 _hall_table[] = {0xFFFF, 292/*1*/, 47/*2*/, 1/*3*/, 180/*4*/, 227/*5*/, 113/*6*/, 0xFFFF};
+static hall_t _hall;
+
+#define read_hall(h,t) {h = get_hall_stat(HALL_READ_TIMES); t = _hall_table[h];}
+#define tick_2_s(tick) ((float)tick / (float)SYSTEM_CLOCK)
+
+static u32 __inline delta_ticks(u32 prev) {
+	u32 now = task_ticks_abs();
+	if (now >= prev) {
+		return (now - prev);
+	}
+	return (0xFFFFFFFF - prev + now) + 1;
 }
-float hall_get_speed(void) {
+
+void hall_sensor_init(void) {
+	memset(&_hall, 0, sizeof(_hall));
+	read_hall(_hall.state, _hall.theta);
+}
+
+float hall_sensor_get_theta(void){
+	if (!_hall.working) {
+		return THETA_NONE;
+	}
+	float est_theta = tick_2_s(delta_ticks(_hall.ticks)) * _hall.degree_per_s + _hall.theta;
+	fast_norm_angle(&est_theta);
+	return est_theta;
+}
+
+float hall_sensor_get_speed(void) {
 	return 0.0f;
 }
 
+void hall_sensor_handler(void) {
+	u8 hall = get_hall_stat(HALL_READ_TIMES);
+	float theta = _hall_table[hall];
+	if (!_hall.working) {		
+		if(theta != 0xFFFF) {
+			_hall.working = true;
+			_hall.state = hall;
+			_hall.theta = theta;
+			_hall.ticks = task_ticks_abs();
+		}
+		return;
+	}
+
+	if (theta == 0xFFFF || _hall.theta == theta) { //may be hall noise, drop it
+		return;
+	}
+	float delta_theta = theta - _hall.theta;
+	float theta_abs = abs(delta_theta);
+	if (theta_abs > 70 || theta_abs < 40) { //may be hall noise, drop it
+		return;
+	}
+	if (delta_theta < 0) {
+		_hall.direction = NEGATIVE;
+	}else {
+		_hall.direction = POSITIVE;
+	}
+	float delta_time = tick_2_s(delta_ticks(_hall.ticks));
+	if (delta_time == 0.0f) { //may be errors ???
+		return;
+	}
+	_hall.degree_per_s = theta_abs / delta_time;
+
+	_hall.ticks = task_ticks_abs();
+	_hall.theta = theta;
+}
+
 

+ 20 - 2
Application/FOC/hall_speed.h

@@ -1,8 +1,26 @@
 #ifndef _HALL_SPEED_H__
 #define _HALL_SPEED_H__
+#include "libs/types.h"
+#include "hal/hal.h"
 
-float hall_get_theta(void); //return degree
-float hall_get_speed(void); //return rpm
+#define NEGATIVE          (int8_t)-1
+#define POSITIVE          (int8_t)1
+
+#define THETA_NONE        (float)0xFFFF
+typedef struct {
+	bool  alignmnet;
+	float theta;
+	float rpm;        //ÿ·ÖÖÓתËÙ
+	u8    state;
+	u32   ticks;
+	bool  working;
+	s8    direction;
+	float degree_per_s; //ÿÃë¶È£¬ ext: 10¶È/s
+}hall_t;
+
+void hall_sensor_init(void);
+float hall_sensor_get_theta(void); //return degree
+float hall_sensor_get_speed(void); //return rpm
 
 #endif /* _HALL_SPEED_H__ */
 

+ 17 - 14
Application/FOC/phase_current.c

@@ -37,24 +37,27 @@ void get_phase_current(current_samp_t *cs){
 
 
 u32 get_phase_sample_point(current_samp_t *cs, phase_time_t *time, u8 sector){
-	u32 low_side_low_duty = FOC_PWM_period/2 - time->low;	
+	u32 low_side_low_duty = FOC_PWM_Half_Period - time->low;	
 	cs->sector = sector;
+	//duty > deadtime + max(Rise time, Noise time)
 	if (low_side_low_duty > (TDead + MAX(TRise, TNoise))) {
 		cs->sector = SECTOR_5;
-		return FOC_PWM_period/2 - 1;
+		return FOC_PWM_Half_Period - 1;
+	}else {
+		u32 low_side_mid_duty = FOC_PWM_period/2 - time->midle;
+		u32 delta_duty = low_side_mid_duty - low_side_low_duty;
+		if (delta_duty > low_side_low_duty * 2) {
+			return time->low - TADC;
+		}else {
+			u32 sample_point = time->low + (TDead + MAX(TRise, TNoise));
+			if (sample_point >= FOC_PWM_Half_Period) {
+				/* ADC trigger edge must be changed from positive to negative */
+				cs->adc_inject_flags= (uint16_t) LL_ADC_INJ_TRIG_EXT_FALLING;
+				sample_point = ( 2u * FOC_PWM_Half_Period ) - sample_point - (uint16_t) 1;		
+			}
+			return sample_point;
+		}
 	}
-	u32 low_side_mid_duty = FOC_PWM_period/2 - time->midle;
-	u32 delta_duty = low_side_mid_duty - low_side_low_duty;
-	if (delta_duty > low_side_low_duty * 2) {
-		return time->low - TADC;
-	}
-	u32 sample_point = time->low + (TDead + MAX(TRise, TNoise));
-	if (sample_point >= FOC_PWM_period/2) {
-         /* ADC trigger edge must be changed from positive to negative */
-        cs->adc_inject_flags= (uint16_t) LL_ADC_INJ_TRIG_EXT_FALLING;
-        sample_point = ( 2u * FOC_PWM_period / 2 ) - sample_point - (uint16_t) 1;		
-	}
-	return sample_point;
 }
 
 void phase_current_adc_triger(current_samp_t *cs){

+ 27 - 11
Application/Hal/hal.c

@@ -1,5 +1,6 @@
 #include "hal/hal.h"
 #include "hal/pwm.h"
+#include "stm32f3xx_ll_exti.h"
 
 void HAL_MspInit(void)
 {
@@ -153,22 +154,37 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
 
 }
 
+void HAL_NVIC_Init(void){
+	/* TIM1_BRK_TIM15_IRQn interrupt configuration */
+	HAL_NVIC_SetPriority(TIM1_BRK_TIM15_IRQn, 9, 0);
+	/* TIM1_UP_TIM16_IRQn interrupt configuration */
+	HAL_NVIC_SetPriority(TIM1_UP_TIM16_IRQn, 5, 0);
+	/* ADC1_IRQn interrupt configuration */
+	HAL_NVIC_SetPriority(ADC1_IRQn, 7, 0);
+	/* HALL EXTI configuration */
+	HAL_NVIC_SetPriority(EXTI3_IRQn, 8, 0);
+	HAL_NVIC_SetPriority(EXTI15_10_IRQn, 8, 0);
+	/* USART2_IRQn interrupt configuration */
+	HAL_NVIC_SetPriority(USART2_IRQn, 8, 0);
+	/* EXTI15_10_IRQn interrupt configuration */
+	HAL_NVIC_SetPriority(EXTI15_10_IRQn, 8, 0);
+}
 
-int HALL_Read(int samples) {
-	samples = 1 + 2 * samples;
+void HAL_EXIT_Init(void) {
+	LL_EXTI_InitTypeDef exti;
+	exti.Line_0_31 = LL_EXTI_LINE_3;
+	exti.LineCommand = ENABLE;
+	exti.Mode = LL_EXTI_MODE_IT;
+	exti.Trigger = LL_EXTI_TRIGGER_RISING_FALLING;
+	LL_EXTI_Init(&exti);
 
-	int h1 = 0, h2 = 0, h3 = 0;
-	int tres = samples / 2;
+	exti.Line_0_31 = LL_EXTI_LINE_10;
+	LL_EXTI_Init(&exti);
 
-	while (samples--) {
-		h1 += READ_HALL1();
-		h2 += READ_HALL2();
-		h3 += READ_HALL3();
-	}
-	return (h1 > tres) | ((h2 > tres) << 1) | ((h3 > tres) << 2);
+	exti.Line_0_31 = LL_EXTI_LINE_15;
+	LL_EXTI_Init(&exti);
 }
 
-
 void Error_Handler(void)
 {
 	__disable_irq();

+ 7 - 4
Application/Hal/hal.h

@@ -48,14 +48,16 @@
 #define READ_HALL2() (HAL_GPIO_ReadPin(HALL_2_GROUP, HALL_2_PIN) == GPIO_PIN_SET ?1:0)
 #define READ_HALL3() (HAL_GPIO_ReadPin(HALL_3_GROUP, HALL_3_PIN) == GPIO_PIN_SET ?1:0)
 
-#define TIM_CLOCK (72000000L * 2) /*SystemClock_Config中TIM1的clk从sys PLL 过来,固定2倍的PLL频率*/
+#define SYSTEM_CLOCK (72000000L)
+#define TIM_CLOCK (SYSTEM_CLOCK * 2) /*SystemClock_Config中TIM1的clk从sys PLL 过来,固定2倍的PLL频率*/
 #define TIM_CLOCK_MHz (144)
-#define ADC_CLOCK (72000000L)
+#define ADC_CLOCK (SYSTEM_CLOCK)
 #define ADC_CLOCK_MHz (72)
 #define NS_PER_TCLK (7) /* (1/144000000 * 1000000000) */
-#define NS_2_TCLK(ns) ((ns/NS_PER_TCLK) + 1)
+#define NS_2_TCLK(ns) ((ns/NS_PER_TCLK) + 1) //ns 转为pwm使用的那个TIM的clk count
 #define FOC_FS (20 * 1000)
 #define FOC_PWM_period (TIM_CLOCK/FOC_FS)
+#define FOC_PWM_Half_Period (FOC_PWM_period/2)
 #define MAX_VBUS (12.f) //12v
 
 #define ADC_TRIG_CONV_LATENCY_CYCLES 3.5f
@@ -73,6 +75,7 @@
 void Error_Handler(void);
 void SystemClock_Config(void);
 void HAL_GPIO_init(void);
-int HALL_Read(int samples);
+void HAL_NVIC_Init(void);
+void HAL_EXIT_Init(void);
 
 #endif /* _HAL_H__ */

+ 6 - 6
Application/Hal/pwm.c

@@ -20,7 +20,7 @@ void HAL_PWM_Init(int fs) {
 	htim1.Instance = TIM1;
 	htim1.Init.Prescaler = 0;
 	htim1.Init.CounterMode = TIM_COUNTERMODE_CENTERALIGNED1;
-	htim1.Init.Period = (SystemCoreClock / fs);
+	htim1.Init.Period = (TIM_CLOCK / fs /2);
 	htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
 	htim1.Init.RepetitionCounter = 0;
 	htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
@@ -46,7 +46,7 @@ void HAL_PWM_Init(int fs) {
 	  Error_Handler();
 	}
 	sConfigOC.OCMode = TIM_OCMODE_PWM1;
-	sConfigOC.Pulse = (SystemCoreClock / fs) / 2;
+	sConfigOC.Pulse = (TIM_CLOCK / fs) / 4; //运行后,根据svpwm重新设置
 	sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
 	sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
 	sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
@@ -64,12 +64,14 @@ void HAL_PWM_Init(int fs) {
 	{
 	  Error_Handler();
 	}
+	/* 触发ADC采样的配置 */
   	sConfigOC.OCMode = TIM_OCMODE_PWM2;
-  	sConfigOC.Pulse = (SystemCoreClock / fs) - 5;
+  	sConfigOC.Pulse = (TIM_CLOCK / fs) / 2 - 5; //运行后,根据pwm,sector信息,重新设置采样点
   	if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_4) != HAL_OK)
   	{
     	Error_Handler();
-  	}	
+  	}
+	/* 刹车配置 */
 	sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_ENABLE;
 	sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_ENABLE;
 	sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_1;
@@ -119,10 +121,8 @@ void PWM_TimerInit(void){
 	LL_TIM_CC_EnableChannel( TIMx, TIMxCCER_MASK_CH123 );
 
   	/* TIM1_BRK_IRQn interrupt configuration */
-  	HAL_NVIC_SetPriority(TIM1_BRK_TIM15_IRQn, 4, 1);
   	HAL_NVIC_EnableIRQ(TIM1_BRK_TIM15_IRQn);
 
-  	HAL_NVIC_SetPriority(TIM1_UP_TIM16_IRQn, 0, 0);
   	HAL_NVIC_EnableIRQ(TIM1_UP_TIM16_IRQn);
 
 	LL_TIM_EnableCounter(TIMx);

+ 1 - 0
Application/Libs/task.h

@@ -25,4 +25,5 @@ void timer_cancel(timer_t *timer);
 void task_add(task_t *task);
 void task_run(void);
 void task_udelay(u32 delay);
+u32 task_ticks_abs(void);
 task_t *task_start(task_func func, u32 delay);

+ 17 - 5
Project/Motor_PMSM.uvoptx

@@ -152,7 +152,7 @@
         <Bp>
           <Number>0</Number>
           <Type>0</Type>
-          <LineNumber>25</LineNumber>
+          <LineNumber>92</LineNumber>
           <EnabledFlag>1</EnabledFlag>
           <Address>0</Address>
           <ByteObject>0</ByteObject>
@@ -168,7 +168,7 @@
         <Bp>
           <Number>1</Number>
           <Type>0</Type>
-          <LineNumber>92</LineNumber>
+          <LineNumber>93</LineNumber>
           <EnabledFlag>1</EnabledFlag>
           <Address>0</Address>
           <ByteObject>0</ByteObject>
@@ -469,7 +469,7 @@
 
   <Group>
     <GroupName>Drivers</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -761,6 +761,18 @@
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
+    <File>
+      <GroupNumber>6</GroupNumber>
+      <FileNumber>40</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Librarys\STM32F3xx_HAL_Driver\Src\stm32f3xx_ll_exti.c</PathWithFileName>
+      <FilenameWithoutPath>stm32f3xx_ll_exti.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
   </Group>
 
   <Group>
@@ -771,7 +783,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>7</GroupNumber>
-      <FileNumber>40</FileNumber>
+      <FileNumber>41</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -783,7 +795,7 @@
     </File>
     <File>
       <GroupNumber>7</GroupNumber>
-      <FileNumber>41</FileNumber>
+      <FileNumber>42</FileNumber>
       <FileType>2</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>

+ 5 - 0
Project/Motor_PMSM.uvprojx

@@ -603,6 +603,11 @@
               <FileType>1</FileType>
               <FilePath>..\Librarys\STM32F3xx_HAL_Driver\Src\stm32f3xx_ll_tim.c</FilePath>
             </File>
+            <File>
+              <FileName>stm32f3xx_ll_exti.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Librarys\STM32F3xx_HAL_Driver\Src\stm32f3xx_ll_exti.c</FilePath>
+            </File>
           </Files>
         </Group>
         <Group>