2009:USB Mouse Driver

From 1511Wookiee
Jump to navigationJump to search

Driver State Design Notes

State Startup:
Look for interrupt
Get Interrupt, Start timer -> Startup2
No Interrupt -> Startup


State Startup2:
Wait timer...
Timer expires
If input = 1: Main1
If input = 0: Startup


State LongMain1:
Start timer
Go main2


LongMain2:
Wait on interrupt
Get interrupt, AND timer time == long period (ie, no movement): ShortMain1
Get interrupt, AND timer time < long period (movement): count++; Go LongMain3

LongMain3
Wait on interrupt
Get interrupt, timer != long period: Startup
Get interrupt, timer == long period: go to ShortMain1


ShortMain1:
Start timer
Go to shortmain2


ShortMain2:
Wait on interrupt
Get interrupt AND timer time == short period (ie, no movement): LongMain1
Get interrupt, AND timer time < short period (movement): count++; Go ShortMain3


ShortMain3
Wait on interrupt
Get interrupt, timer != short period: Startup
Get interrupt, timer == short period: go to LongMain1