Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Functional Block Diagram: 

Image RemovedImage Added

Modules:

  1. lights_can: 
    1. Receive can messages
    2. Raise events. 
    3. Has information about the type of board (Front or Rear).
    4. Sends sync message (only rear board).
  2. main: This module only contains a main loop where it gets the raised events from lights_can and passes them to the next three modules: strobe, simple_peripherals, and signals_fsm. Every module checks if it owns the event that is passed to it and processes it. If the event is not related to the module, the module ignores it.
  3. lights_simple_peripherals: Used for all the peripherals which have a simple on, or off state. These peripherals are: horn, high/low beams, and brake lights.
  4. lights_strobe: Uses a blinker object to blink the strobe light.
  5. lights_signals_fsm: Contains the FSM of the signals. Every often calls send_sync from lights_can to sync the two boards. Uses blinker for blinking the signals. 
  6. lights_blinker: Basically handles all the overhead related to using soft timers.
  7. lights_gpio: 
    1. Is the only module that knows about all the addresses.
    2. Can be thought of the only part where the boards actually take action?!
    3. strobesignals_fsm, and simple_peripherals all call its lights_gpio_set() function to change the state of the lights.

...