Add PWM for the spark plug

Add 33.3 Hz PWM for the spark plug
This commit is contained in:
2024-09-02 17:50:01 +03:00
parent 78e0a88604
commit 25f1f074f7
2 changed files with 4 additions and 4 deletions

5
main.c
View File

@@ -136,12 +136,13 @@ for (unsigned char i = 0; i < BUFFER_SIZE; i++)
/* Infinite loop */
/* USER CODE BEGIN WHILE */
HAL_UART_Receive_IT(&huart3, receiveBuffer, BUFFER_SIZE);
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
HAL_TIM_IC_Start_IT(&htim2, TIM_CHANNEL_3);
HAL_TIM_IC_Start_IT(&htim2, TIM_CHANNEL_4);
while (1)
{
// MAX6675_Temperature = MAX6675_GetTemperature(SPI1);
MAX6675_Temperature = MAX6675_GetTemperature(SPI1);
HAL_Delay(1000);
HAL_UART_Transmit_IT(&huart3, transmitBuffer, BUFFER_SIZE);
@@ -157,8 +158,6 @@ HAL_TIM_IC_Start_IT(&htim2, TIM_CHANNEL_4);
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};