From 761b3fb4afe2e2fe9a9a15032793dc11e0316885 Mon Sep 17 00:00:00 2001 From: "jazz (gitea)" Date: Fri, 19 Dec 2025 11:20:08 -0600 Subject: [PATCH] remove test code --- Core/Src/main.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index 1b106b8..ac16b69 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -49,8 +49,11 @@ TIM_HandleTypeDef htim1; UART_HandleTypeDef huart1; /* USER CODE BEGIN PV */ -uint16_t duty; -int ctr = 65534; // or 65534? +/* + * + */ +uint16_t duty; /* current pulse width ("duty cycle") */ +int ctr = 65534; /* "counter" value, the maximum possible PWM value */ /* USER CODE END PV */ @@ -132,7 +135,6 @@ int main(void) printf("\x1B[2J\x1B[H"); /* ANSI: clear tty */ printf("duty:%u proc:%u raw:%u\r\n", duty, (uint16_t)proc, val_raw); - //printf("duty:%u raw:%u\r\n", duty, val_raw); /* Cap it */ if (duty > ctr) @@ -144,34 +146,6 @@ int main(void) /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ - /* This is meant to be run once so it breaks if you put it here. */ - //if (HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_4) != HAL_OK) - // Error_Handler(); - - - /* TESTS */ - /* - // Rising: - __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_4, duty); - duty += 100; - - if (duty >= 8000) - duty = 0; - - HAL_Delay(10); - */ - - /* - // Falling: - __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_4, duty); - duty -= 100; - - if (duty <= 100) - duty = 8000; - - HAL_Delay(10); - */ - /* END TESTS */ } /* USER CODE END 3 */ }