Professional Documents
Culture Documents
state machine)
Data private to the module: MyPriority, CurrentState, DeferralQueue
InitLEDMatrix
Takes a priority number, returns True.
CurrentState is ReadyToSend
ThisEvent is MATRIX_UPDATE
Post ES_UPDATE_ROW to this service
Set CurrentState = Writing
ThisEvent is ES_UPDATE_COMPLETE
Post ES_UPDATE_ROW event to this service
Set CurrentState equal to Writing
End ReadyToSend Block
CurrentState is Writing
ThisEvent is ES_UPDATE_ROW
If DM_TakeDisplayUpdateStep returns false
Set CurrentState equals to ReadyToSend
Post ES_UPDATE_COMPLETE event to this service
Else
Set CurrentState to WritingLastRow
Post ES_UPDATE_COMPLETE event to this service
EndIf
Default case
Defer event
End Writing Block
CurrentState is WritingLastRow
ThisEvent is ES_UPDATE_COMPLETE
Set CurrentState = ReadyToSend
Recall deferred events
Default case
Defer event
End WritingLastRow Block
End of RunLEDMatrixSM