remove test code

This commit is contained in:
2025-12-19 11:20:08 -06:00
parent 20bac61473
commit 761b3fb4af

View File

@@ -49,8 +49,11 @@ TIM_HandleTypeDef htim1;
UART_HandleTypeDef huart1; UART_HandleTypeDef huart1;
/* USER CODE BEGIN PV */ /* 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 */ /* USER CODE END PV */
@@ -132,7 +135,6 @@ int main(void)
printf("\x1B[2J\x1B[H"); /* ANSI: clear tty */ 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 proc:%u raw:%u\r\n", duty, (uint16_t)proc, val_raw);
//printf("duty:%u raw:%u\r\n", duty, val_raw);
/* Cap it */ /* Cap it */
if (duty > ctr) if (duty > ctr)
@@ -144,34 +146,6 @@ int main(void)
/* USER CODE END WHILE */ /* USER CODE END WHILE */
/* USER CODE BEGIN 3 */ /* 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 */ /* USER CODE END 3 */
} }