/**************************************************************************** Function InitEncoderService Parameters uint8_t : the priorty of this service Returns bool, false if error in initialization, true otherwise Description Saves away the priority, initializes TIVA pins, sets up init capture, starts RPM timer ****************************************************************************/ bool InitEncoderService ( uint8_t Priority ) { ES_Event ThisEvent; MyPriority = Priority; // Setup init capture InitInputCapturePeriod( ); // Setup periodic timer InitPeriodicInt( ); // Start RPM timer ES_Timer_InitTimer(RPMtimer, RPMtime); // Post the initial transition event ThisEvent.EventType = ES_INIT; if (ES_PostToService( MyPriority, ThisEvent) == true) { return true; }else { return false; } }
//Takes a priority number, returns True. bool InitializeControlService(uint8_t Priority) { //Initialize the MyPriority variable with the passed in parameter. MyPriority = Priority; puts("Finished_Initialize_Control_Service\n\r"); InitPWM(); InitInputCapturePeriod1(); InitInputCapturePeriod2(); InitPeriodicInt(); InitLoadPWM(); //InitShootPWM(); InitAlignInputCapture(); InitUltraInputCapture(); // ES_Event NewEvent; // NewEvent.EventType = RobotStopped; // PostRobotSM(NewEvent); return true; }