harinin

Untitled

Aug 3rd, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * File:   FinalProject_main.c
  3.  * Author: COSMOS
  4.  *
  5.  * Created on August 2, 2016, 10:59 AM
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include "BOARD.h"
  11. #include "events.h"
  12. #include "roach.h"
  13. #include "timers.h"
  14.  
  15. /*
  16.  *
  17.  */
  18. int main(int argc, char** argv) {
  19.     BOARD_Init();
  20.     Roach_Init();
  21.     TIMERS_Init();
  22.    
  23.     event_t currentEvent = NO_EVENT;
  24.     RunStateMachine(NO_EVENT);
  25.     while (1) {
  26.         //if an event happens run the state machine
  27.         currentEvent = CheckForEvents();
  28.         if (currentEvent != NO_EVENT)
  29.             RunStateMachine(currentEvent);
  30.     }
  31.    
  32.     return (EXIT_SUCCESS);
  33. }
Add Comment
Please, Sign In to add comment