2024-11-12 10:51 AM - last edited on 2024-11-12 02:04 PM by Tesla DeLorean
where I wrote it among the codes.. // Here I have to wait 500ms.
Can you help me to prevent the timers from being affected by this wait?
Can you give me the codes that I will add. Because I am very confused..
I tried many things but they all stopped the interrupts..
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance==TIM1)
{
if(input1==0)
{
HAL_GPIO_WritePin(GPIOA, GPIO_Pin_1, GPIO_PIN_SET);
// Here I have to wait 500ms.
HAL_GPIO_WritePin(GPIOA, GPIO_Pin_1, GPIO_PIN_RESET);
}
}
Solved! Go to Solution.
2024-11-17 11:19 PM
@XooM wrote:I don't have a program in the while loop. My program is in timer1 and timer16. When I do what you said, it gives an error, so I added the file.
I did everything you said but the errors are not decreasing.
Could you please look at my project file? Please I am stuck and cannot proceed.
What error? Added what file? Explain in more detail.
If you're talking about the latest project you've uploaded, did you even look at my main.h file?
extern and #include are needed just like i have in my main.h which you need to add to your main.h
.
2024-11-17 11:23 PM
I added this to my previous file. I forgot to add it to the project I created from scratch called test3.
2024-11-17 11:25 PM - edited 2024-11-18 08:21 AM
Bu dosyayı benimkine ekledim ve hala hata veriyor.
2024-11-17 11:53 PM
when you added the prototypes, you didn't add the semi colon
2024-11-17 11:56 PM
2024-11-18 12:39 AM - edited 2024-11-18 01:08 AM
PA10_off does not work after 1sec. PA10 "1" is always
It should be "0" after 1sec but timercallback does not work.
2024-11-18 01:09 AM
Can you try it on your own board? It definitely doesn't work.
2024-11-18 01:22 AM - edited 2024-11-18 01:25 AM
I have been trying to make a 500 ms delay since the first message I opened in the topic.
Unfortunately, I couldn't take any steps forward. It always blocked the mcu and timers.
TimerCallbackTimerStart(&timerCallback, PA10_Off, 500, TIMER_NO_REPEAT);
I was very hopeful about the function above.
PollingRoutine.c/h I will not use these files, my aim is to stop the pin I want after 500ms.
2024-11-18 01:40 AM
If the PA10_off function was used after 1 second, it would be something to look for..
My aim was to make a PAx? that was active anywhere in my project passive after a period of 100 200 500ms... but it doesn't work.
2024-11-18 08:12 AM
@XooM wrote:
PA10_off does not work after 1sec. PA10 "1" is always
It should be "0" after 1sec but timercallback does not work.
It's because you keep calling it in a while loop. Each time you call it, it resets the callback timer.
Look at my signature and watch the video