I'm quite new to context switch and embedded software development. I'm developing a standalone application (no OS) with aduc7026 and keil uVision3. My problem is that at the end of an uart messagge, which I must receive by interrupt, depending on the content of the messagge I've to return return in main in the state saved before entering in the ISR or I've have to return in a specified point where a funcion call is executed.
Hoping that I've been clear. Does anyone have suggestions?
Thank ìs in advance,
Matteo
10 tips.
1 state machine. 2 state machine 3 state machine 4 state machine 5 state machine 6 state machine 7 state machine 8 state machine 9 state machine 10 stat machine
The loop running the state machine steps will not hang unless you introduce bugs or the hardware suffers problems.
Long tasks can be splitted into multiple steps, making them breakable before they are fully done.
Task switches are for running multiple jobs concurrently - most environments cant survive that you kill/restart at arbitrary place becauce of atomicity reasons.
If you still manage to.hang your main loop, then you have no real option but a (watchdog) reset. The reason is that you have then managed to put the processor in a state where it can't be trusted.
The choice is yours. Solving a problem the established way, or assume your problem is unique and implement a spaghetti failure you will spend the next couple of years trying to get reliable.