 *        If four seconds are up
 *          Update the time
 *          Construct a timestamp
-*          Power-on the SD card
 *          Write data
-*          Power-off the SD card
 *        If sleep is enabled (disabled when serial is enabled)
 *          Enter Sleep (low-power mode)
 *          < Will wake up on Interrupt and continue: >
+*        If the Magnetometer interrupted:
+*          Read the magnetometer data and check for peaks.
 *      Repeat Loop
 *      
 * Interrupts:

* RTC:             Real Time Clock to track time and wake up controller every four seconds.
\*******************************************************************************************/

/*********************************************************\
* Software Description
* Overview: 
*   User inputs:
*     Serial input.
*   Device outputs:
*     Serial output
*     Datalog file


/*********************************************************************************\
 * 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
