Module T_Master.c Description This is a HSM for the master state machine of our robot Notes Private definitions MyPriority /*---------------------------- Module Functions ---------------------------*/ /* prototypes for private functions for this service.They should be functions relevant to the behavior of this service */ bool InitMasterSM (uint8_t Priority) //Set priority //Create entry event //Initialize input capture //Initialize timers //Initialize interrupts //Initialize PWM //Initialize hardware //Turn LEDs off //Open servo //Turn motors off //Initialize Spud //Start master SM ES_Event_t RunMasterSM(ES_Event_t CurrentEvent) //If event is a timeout //If timer is the RPM reset timer //Reset RPM //Consume event //Call during master //Consume event void StartMasterSM (ES_Event_t CurrentEvent) //Run master SM static ES_Event_t DuringMaster(ES_Event_t Event) //If event is an entry event //Start spud //Start mining //Else if exit event //Run spud //Run mining Else //Run spud //Run mining