 *      
 *   2. INT1_ISR()
 *      
-\*********************************************************/
+\*****************************************************************/
 
 #include <SPI.h>
 #include <SD.h>

  rtcTransfer(reg_Tmr_A_freq_ctrl, WRITE, 0x02);
  rtcTransfer(reg_Tmr_A_reg, WRITE, 0x04);
  rtcTransfer(reg_Control_2, WRITE, 0x02);
  rtcTransfer(reg_Control_3, WRITE, 0x80);                        // Set RTC to switch to Battery on power off

  /*Interrupts TODO: change the INT0_ISR to record magnetometer data*/

  attachInterrupt(digitalPinToInterrupt(2), INT0_ISR, RISING);   // Setup Interrupts
  attachInterrupt(digitalPinToInterrupt(3), INT1_ISR, FALLING);


/*********************************************************************************\
 * Setup:
 *    Setup the System State structure     
 *    Setup the Digital I/O pins
 *      Pin 2 (INT0):  Magnetometer Interrupt
 *      Pin 3 (INT1):  RTC 4-Second Interrupt
 *      Pin 5 (INPUT): Serial Activate Button
 *    Initialize Magnetometer
 *    Setup RTC Timer
 *    Setup interrupts
 *    Load Date_t with Date/Time info
 *    Disable unneeded peripherals
 *    If Activate Serial Button is pressed
 *      Power on the Serial Interface
\*********************************************************************************/

volatile State_t State;             // System State structure
