page1
START
Set up phase map.
Set up interrupts.
Set up ports.
Get controls values
Read sensors
Set Space
Shaft Moved?
No
Yes
Delay space period
Set BLDC phase mark from sensors
ISR: ADC Interrupt
Get ADC channel index
Store ADC value for controls
Set to read other ADC channel
Initiate next read
End