Hello,
I have a problem when it comes to implementing interrupts and threads in Zephyr. So from my previous experience with bare metal programming i know what Interrupts are number 1 priority in embedded systems, but somehow it doesn't work in zephyr:
-Here is a code that im struggling with:
I want an application that has 2 threads for blinking diodes and an interrupt button to stop blinking.
So here it how it works:
When the threads are running I can see diodes blinking, and when i click button_2 interrupt I can see printed counter number, but if i press button that is responsible for changing toggler and diode blinking the code sometimes stops, i have to press it like 5-6 times so code starts working again and its not working fluently. In my mind it should work like this:
Diodes blinking
I press the button and diodes stops blinking and i see LogINF that toggler is not parity
but it doesnt work like this it mostly gets stuck, and i have to press it like ive said above 5-6 times and i see 100 Logs printed immediately and the diode start to blink again.
-How does interrupts affect threads?
-where should i implement interrupts code?- From my POV it shouldnt be inside thread entry function because what if thread 1 that has interrupt is terminated or aborted, the interrupt wont work I guess