Alarm Sensor Module  0.1
⇒ back to Project Page

◆ main()

int main ( void  )

Contains the main function - the initialization of all ports, functions and the main loop:

  1. Resetting of all pins of all ports (to input pins with pull-up resistors).
  2. Initialization of ADC pin (for battery control).
  3. Initialization of RFM12 pins (for communication with main unit).
  4. Initialization of LCD pins (if LCD_DEBUG is set to 1).
  5. Initialization of RFM12.
  6. Initialization of LCD (if LCD_DEBUG is set to 1).
  7. Initialization of Timer and the respective Interrupt.
  8. Initialization of internal data structures.
  9. Main Loop:
    1. Check battery voltage value if time elapsed for the battery check
    2. Check sensor status if time elapsed for the sensor check, send alarm message in case of open contacts
    3. Send status message to main unit if time elapsed for status messages
    4. Set controller sleep mode (wait for the next timer interrupt to wake up again)
Date
  • Created 30.10.2018
  • Modified 30.10.2018
See also
rfm12_io.h
lcd.h
port_definitions.h
Author
Michael Skutek, micha.nosp@m.el@s.nosp@m.kutek.nosp@m..de

Definition at line 122 of file main.c.

Here is the call graph for this function: