@Haddock01 wrote:
I looked at the examples. Nothing that surprise me. Thanx.
I forgot that the computer are Master and the periperials are slaves. The slaves never initate a comm with the application! It makes my life easier. That means that I need two loops. The first main-loop contains a statemachine that takes care of the overall process. The other loop contains a event which initiates a communication with a specific unit. This "comm-loop" gets commands from the main-loop.
Is this model a way to deal with this? (perhaps I should start a new thread about this ..)
If you want to "constantly" talk with your device irregardless of the state machine logic, then this is a great route to go. If not, then you won't be gaining much going to a second loop as it will become a synchronous communication scheme anyways (therefore might as well have the SPI communications in the state machine).
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5