Flags not working and breaking the program

Flags not working and breaking the program

par Jon Märki,
Number of replies: 1

Hello,

By implementing the flags I have a lot of trouble making it work properly, the modification of the flag group works perfectly but in my main loop (I didn't do it in a uC/OS-II task so maybe that might be the problem, I don't know) my pending instruction doesn't work although the bits corresponding to the buttons are properly set (Tested in the debugger, the mainFlagGrp has a flag value corresponding to the button pressed!). Do you know what I'm doing wrong ?
When I'm checking for cleared bits it's fine, it just doesn't work with the set bits.


This is the code in the main loop.


This is the code in the ISR when I press any button.

Thank you for your help.

In reply to Jon Märki

Re: Flags not working and breaking the program

par Jon Märki,

It's all good, just needed to do the work properly and use the tasks instead of doing a loop in the main function.