In the thread svcWaitSynchronization is waiting for threadRequest to be signaled (this what pressing the A button is does). When threadRequest is signaled the svcWaitSynchronization call returns and then the next call is to clear the event. It then updates the counter and svcWaitSynchronization waits for the event to be singled again.I was looking for an example for threads in C.
I found this one. https://github.com/smealum/ctrulib/blob/master/examples/threads/event/source/main.c
Does someone have a better example?
Maybe something with comments.
Also i don't get one thing.
When you press A, shouldn't the counter keep going up?
It only goes up by 1 every time i click it.
svcCreateThread returns 0