changed the code for the PWM signals

This commit is contained in:
hamza
2024-06-06 16:46:57 +03:00
parent 8983097b87
commit 5ed35b605b
6 changed files with 33 additions and 34 deletions

View File

@ -123,7 +123,7 @@ int main(void)
tmp1075_init(&hi2c1);
AMS_Init(&hspi1);
can_init(&hcan);
PWM_control_init(&htim15, &htim15, &htim1);
PWM_control_init(&htim15, &htim1);
HAL_Delay(10);
/* USER CODE END 2 */
@ -134,18 +134,6 @@ int main(void)
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
/*
int ttt = HAL_GetTick() + 45000;
PWM_powerground_control(0);
while (HAL_GetTick() < ttt){}
state.current_state = STATE_ACTIVE;
sm_update();
PWM_powerground_control(15);
ttt = HAL_GetTick() + 5000;
while (HAL_GetTick() < ttt){}
*/
AMS_Loop();
sm_update();
//sm_test_cycle_states();
@ -433,7 +421,7 @@ static void MX_TIM15_Init(void)
Error_Handler();
}
sConfigOC.OCMode = TIM_OCMODE_PWM1;
sConfigOC.Pulse = 10000;
sConfigOC.Pulse = 0;
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
@ -443,7 +431,6 @@ static void MX_TIM15_Init(void)
{
Error_Handler();
}
sConfigOC.Pulse = 0;
if (HAL_TIM_PWM_ConfigChannel(&htim15, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
{
Error_Handler();