 #include "handleSerial.h"
 #include "powerSleep.h"
 #include "state.h"
+#include "RTC_PCF8523.h"
 
 // DANIEL
 /*********************************************************************************\
  * Setup:
- *    System State structure
+ *    System State structure      Complete
  *    Setup Digital I/O pins
  *      Pin 2 (INT0)
  *      Pin 3 (INT1)

  *   Set serialOn flag.
  *   call serialPowerUp()
  \*****************************************/  
  if((digitalRead(5) == 0) && !State.serialOn)
  {
    State.serialOn = true;
    serialPowerUp();

  if(!State.serialOn)
    enterSleep();
}

// DANIEL
/* Function Title: INT0_ISR()
 * 
 * Friendly Name:  Sensor Interrupt Service Routine (ISR)
 * 
 * Description: increments the value of the pulse count variable by one, each time this 
 *              function is called by hardware.
 */
void INT0_ISR()
{
  State.pulseCount += 1;  // increment pulseCount variable by one
}

// DANIEL
/* Function Title: INT1_ISR()
 * 
 * Friendly Name:  Real Time Clock OUT Interrupt Service Routine (ISR)
 * 
 * Description: sets the 4-second flag to true each time this function
 *              is called by hardware. The Real Time Clock generates
 *              the signal that calls this ISR once every four seconds.
 */
void INT1_ISR()
{
  State.flag4 = true;     // sets the "four second flag" to true
}
