init

Dependencies:   aconno_I2C Lis2dh12 WatchdogTimer

main.h

Committer:
pathfindr
Date:
2019-01-16
Revision:
38:476a9b5629a1
Parent:
36:8e359069192b
Child:
41:07e41dbd5304

File content as of revision 38:476a9b5629a1:

/*
================================================================================
Project:    GPS Tracker
Module:     ---
Status:     Development
Type:       .h header file
Copyright (c) 2018 Pathfindr Ltd
All Rights Reserved.
================================================================================
Notes:

================================================================================
*/

#ifndef MAIN_INTERFACE_H_
#define MAIN_INTERFACE_H_

//------------------------------------------------------------------------------
//mbed Libraries
//------------------------------------------------------------------------------
#include "mbed.h"
//#include "nrf_soc.h"
#include "nrf_temp.h"
#include "board.h"
//#include "ble/BLE.h"
//#include "nvstore.h"
#include "FlashIAPBlockDevice.h"
//#include "nrf_drv_uart.h"

//------------------------------------------------------------------------------
//peripheral Libraries
//------------------------------------------------------------------------------
#include "WatchdogTimer.h"
#include "LIS3DH.h"
#include "SI7060.h"
#include "acd_nrf52_saadc.h"

//------------------------------------------------------------------------------
//Application headers
//------------------------------------------------------------------------------
#include "NRFuart.h"
#include "app_data.h"
#include "states.h"
#include "common.h"
#include "sensors.h"
#include "modem.h"

//------------------------------------------------------------------------------
//Global macros
//------------------------------------------------------------------------------
//#define lowByte(w) ((uint8_t) ((w) & 0xff))
//#define highByte(w) ((uint8_t) ((w) >> 8))

#define DEBUG_ON                            1

//OLD DEBUG STUFF
#define CONSOLE_DEBUG 0
#if CONSOLE_DEBUG
#define DEBUG(str, ... ) do{\
    /*int n;\
    char buffer[200];\
    memset(buffer, '\0', sizeof(buffer));\
    n = snprintf(buffer, sizeof(buffer), str,  __VA_ARGS__);\
    buffer[sizeof(buffer)-1] = 0x00;\
    if(n < 0) { }\
    else if(n >= sizeof(buffer)) { }\
    else\
    {\
        NRFuart_puts_debug(buffer);\
    }\
}while(0)*/
#else
#define DEBUG(...)
#endif

//------------------------------------------------------------------------------
//Global data structures
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//GLOBAL VARS
//------------------------------------------------------------------------------ 

//PERFS

//VARS
extern bool GLOBAL_accel_healthy;
extern bool GLOBAL_requireSoftReset;
extern bool GLOBAL_motionFlagTriggered;
extern bool GLOBAL_debugLED;
extern bool GLOBAL_needToConfigureLis3dh;
extern bool GLOBAL_registeredOnNetwork;
extern bool GLOBAL_modemOn;
extern bool GLOBAL_LEDSequenceinProgress;
extern time_t GLOBAL_RTCunixtime;
extern time_t GLOBAL_wakeTime;
extern char GLOBAL_debug_buffer[200];
extern bool RET_force2G;
//FUNCS
extern void watchdogKick();

#endif