/****************************************************************************/
/* Copyright 2015 MBARI                                                     */
/****************************************************************************/
/* Summary  : Definitions for Config Data in Program Flash                  */
/* Filename : config.h                                                      */
/* Author   : Robert Herlien (rah)                                          */
/* Project  : OASIS Mooring Replacement (OASIS5)                            */
/* Revision: 1.0                                                            */
/* Created  : 10/29/2015                                                    */
/*                                                                          */
/* MBARI provides this documentation and code "as is", with no warranty,    */
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium  */
/* Research Institute to assist in its use, correction, modification, or    */
/* enhancement. This information should not be published or distributed to  */
/* third parties without specific written permission from MBARI.            */
/*                                                                          */
/****************************************************************************/
/* Modification History:                                                    */
/* Written by Mike Risi for Respirometer project in 2009                    */
/* Modified by Bob Herlien for SensorNode for xFOCE, May 2013               */
/* Modified by Bob Herlien for OASIS5, 29oct2015                            */
/****************************************************************************/

#ifndef CONFIG_H
#define CONFIG_H

#define DEFAULT_ID          1
#define DEFAULT_BAUD        115200
#define DEFAULT_CFG_XMIT    1
#ifdef O5_DB_DBG
#define DFLT_PWR_AT_RESET   0x21
#else
#define DFLT_PWR_AT_RESET   1
#endif

#define BOOTLOADER_FLAG     0xAAAA

typedef struct
{
    unsigned int id;
    unsigned long baud;
    unsigned long serialNum;
    int blinkyDebug;
    int menuAtReset;
    int pwrAtReset;
} ConfigData;

int cfgCheck(ConfigData* config);
int cfgRead(ConfigData* config);
int cfgWrite(ConfigData* config);
int cfgSetBootFlag();

#endif
