page1
ISR: Byte Received
End
Update attributes from key press
Get byte (key press)
Get ADC channel index
ISR: Control Read
End
Update statistic data
Store mark value
Channel 0?
Yes
No
Store space value
Set to read other channel and start
Update moving space average
Update moving mark average
Read sensors
Set BLDC phase mark from sensors
ISR: Shaft moved
End
Update statistic data
Empty read?
Yes
No
End
Set up phase map.
Set up interrupts.
Set up ports.
Set up statistic structures.
START
Sleep 1 second
Show banner
Get statistics
Show statistics
Update statistic data
ISR: Timer Expired
End
Restart timer interrupt
Just done mark?
Yes
No
Set space period
Set mark period
Stop timer interrupt
Set space
Set BLDC mark from stored
field set in sensor read