Hello Elvar Liiv,
My main question here is, is this the right way to use semaphores or could
wrongly used semaphores cause my program to crash. Then I use only one thread
and semaphore, everything works nicely.
There is nothing against using a single task with a single semaphore. You could use a queue in stead of a semaphore, and send a specific message, like eWheel and eGas.
But it is interesting to know why your application is crashing.
When you call
, is that really from an interrupt context, or from some library call-back? If it is not from an ISR, you better not use the
What do you mean with “crashes”? Does the CPU get an exception? Or maybe, does the code land in some
Do you have in-circuit debugging? That could be very helpful to inspect a crash.