init
Dependencies: aconno_I2C Lis2dh12 WatchdogTimer
Diff: main.h
- Revision:
- 41:07e41dbd5304
- Parent:
- 38:476a9b5629a1
- Child:
- 43:7b232f03628f
--- a/main.h Thu Jan 17 21:59:18 2019 +0000
+++ b/main.h Thu Jan 17 23:40:03 2019 +0000
@@ -8,14 +8,45 @@
All Rights Reserved.
================================================================================
Notes:
-
================================================================================
*/
-
#ifndef MAIN_INTERFACE_H_
#define MAIN_INTERFACE_H_
//------------------------------------------------------------------------------
+//DEFINES
+//------------------------------------------------------------------------------
+#define FW_VERSION 21
+#define SKU "GPSPLUS"
+#define HW_MAJORREVISION "001"
+
+//MODES
+#define USE_NRF_TEMP_SENSOR 1
+#define DEBUG_ON 1
+
+//DEFAULT SETTINGS
+#define DEFAULT_SLEEP_FRAME 60000
+#define DEFAULT_FORCE2G true
+#define DEFAULT_LOCATION_MODE 2
+#define DEFAULT_LOCATION_ACCURACY 2 // 0 = no location, 1 = cl only, 2 = gps then cl
+#define DEFAULT_LOCATION_TX_INTERVAL_MINS 1440
+#define DEFAULT_LOCATION_TX_FAILSAFE_HRS 168
+#define DEFAULT_LOCATION_TIMEOUT 180
+#define DEFAULT_MOTION_G 11
+#define DEFAULT_MOTION_START_SECONDS 120
+#define DEFAULT_MOTION_STOP_SECONDS 120
+#define DEFAULT_IMPACT_G 127
+#define DEFAULT_CONNECTION_ATTEMPTS 1
+#define DEFAULT_CONNECTION_TIMEOUT 180
+#define DEFAULT_BEACON_INTERVAL_SECONDS 10
+
+//CONSTS
+#define ONEDAYINSECONDS 86400
+#define THREEDAYSINSECONDS 259200
+#define SEVENDAYSINSECONDS 604800
+#define TENDAYSINSECONDS 864000
+
+//------------------------------------------------------------------------------
//mbed Libraries
//------------------------------------------------------------------------------
#include "mbed.h"
@@ -25,7 +56,6 @@
//#include "ble/BLE.h"
//#include "nvstore.h"
#include "FlashIAPBlockDevice.h"
-//#include "nrf_drv_uart.h"
//------------------------------------------------------------------------------
//peripheral Libraries
@@ -51,39 +81,11 @@
//#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;