Question
Timer Call back question ?
Dear Members,
I have a callback :
void Timer10_Callback()
{
seconds += 1;
if (seconds == 30)
{
minute = 1;
seconds = 0;
rpm=count;
rps=(float)rpm/30;
count=0;
}
}and main() inside while()
current_rps = rps;
if (minute>=1)
{
printf("============\r\n");
printf("RPS = %f\r\n",current_rps);
bpm = current_rps*60;
printf("RPM = %f\r\n",rpm);
printf("============\r\n");
//HAL_Delay(2000);
minute = 0;
} can I put my code inside while() into my callback, or it's too long because of printf ?
because the handler already here:
void TIM10_IRQHandler(void)
{
/* USER CODE BEGIN TIM10_IRQn 0 */
/* USER CODE END TIM10_IRQn 0 */
HAL_TIM_IRQHandler(&htim10);
/* USER CODE BEGIN TIM10_IRQn 1 */
Timer10_Callback();
/* USER CODE END TIM10_IRQn 1 */
}and I want to print out the result when it's finished calculating, it's only printing it when the loop is rotating on that point....
Any clues ?
Thanks
