init
Dependencies: aconno_I2C Lis2dh12 WatchdogTimer
main.h@11:60eb0ff945f2, 2018-12-15 (annotated)
- Committer:
- pathfindr
- Date:
- Sat Dec 15 20:09:19 2018 +0000
- Revision:
- 11:60eb0ff945f2
- Parent:
- 7:e9a19750700d
- Child:
- 13:29f67f256709
3
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pathfindr | 0:94b743e06998 | 1 | /* |
| pathfindr | 0:94b743e06998 | 2 | ================================================================================ |
| pathfindr | 0:94b743e06998 | 3 | Project: MTU Tracker |
| pathfindr | 0:94b743e06998 | 4 | Module: --- |
| pathfindr | 0:94b743e06998 | 5 | Status: Development |
| pathfindr | 0:94b743e06998 | 6 | Type: .h header file |
| pathfindr | 0:94b743e06998 | 7 | Copyright (c) 2018 Pathfindr Ltd |
| pathfindr | 0:94b743e06998 | 8 | All Rights Reserved. |
| pathfindr | 0:94b743e06998 | 9 | ================================================================================ |
| pathfindr | 0:94b743e06998 | 10 | Notes: |
| pathfindr | 0:94b743e06998 | 11 | |
| pathfindr | 0:94b743e06998 | 12 | ================================================================================ |
| pathfindr | 0:94b743e06998 | 13 | */ |
| pathfindr | 0:94b743e06998 | 14 | |
| pathfindr | 0:94b743e06998 | 15 | #ifndef MAIN_INTERFACE_H_ |
| pathfindr | 0:94b743e06998 | 16 | #define MAIN_INTERFACE_H_ |
| pathfindr | 0:94b743e06998 | 17 | |
| pathfindr | 0:94b743e06998 | 18 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 19 | //mbed Libraries |
| pathfindr | 0:94b743e06998 | 20 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 21 | #include "mbed.h" |
| pathfindr | 7:e9a19750700d | 22 | #include "board.h" |
| pathfindr | 4:8d8e9bfa82e4 | 23 | #include "WatchdogTimer.h" |
| pathfindr | 0:94b743e06998 | 24 | #include "ble/BLE.h" |
| pathfindr | 11:60eb0ff945f2 | 25 | |
| pathfindr | 7:e9a19750700d | 26 | //#include "nvstore.h" |
| pathfindr | 0:94b743e06998 | 27 | |
| pathfindr | 0:94b743e06998 | 28 | |
| pathfindr | 0:94b743e06998 | 29 | //------------------------------------------------------------------------------ |
| pathfindr | 2:fd554f01abdf | 30 | //peripheral Libraries |
| pathfindr | 0:94b743e06998 | 31 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 32 | #include "LIS3DH.h" |
| pathfindr | 11:60eb0ff945f2 | 33 | #include "SI7060.h" |
| pathfindr | 0:94b743e06998 | 34 | |
| pathfindr | 0:94b743e06998 | 35 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 36 | //C Standard Libraries |
| pathfindr | 0:94b743e06998 | 37 | //------------------------------------------------------------------------------ |
| pathfindr | 2:fd554f01abdf | 38 | /* |
| pathfindr | 0:94b743e06998 | 39 | #include <ctype.h> |
| pathfindr | 0:94b743e06998 | 40 | #include <errno.h> |
| pathfindr | 0:94b743e06998 | 41 | #include <stddef.h> |
| pathfindr | 0:94b743e06998 | 42 | #include <math.h> |
| pathfindr | 0:94b743e06998 | 43 | #include <stdarg.h> |
| pathfindr | 0:94b743e06998 | 44 | #include <stdlib.h> |
| pathfindr | 0:94b743e06998 | 45 | #include <stdio.h> |
| pathfindr | 0:94b743e06998 | 46 | #include <ctype.h> |
| pathfindr | 0:94b743e06998 | 47 | #include <string.h> |
| pathfindr | 0:94b743e06998 | 48 | #include <stdbool.h> |
| pathfindr | 0:94b743e06998 | 49 | #include <stdint.h> |
| pathfindr | 2:fd554f01abdf | 50 | */ |
| pathfindr | 2:fd554f01abdf | 51 | //include <string> // dont use - causes 2ma sleep |
| pathfindr | 2:fd554f01abdf | 52 | //using std::string; |
| pathfindr | 2:fd554f01abdf | 53 | |
| pathfindr | 0:94b743e06998 | 54 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 55 | //Application headers |
| pathfindr | 0:94b743e06998 | 56 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 57 | #include "modes.h" |
| pathfindr | 7:e9a19750700d | 58 | #include "common.h" |
| pathfindr | 7:e9a19750700d | 59 | #include "sensors.h" |
| pathfindr | 7:e9a19750700d | 60 | #include "modem.h" |
| pathfindr | 11:60eb0ff945f2 | 61 | #include "filesystem.h" |
| pathfindr | 5:8f8951127724 | 62 | |
| pathfindr | 0:94b743e06998 | 63 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 64 | //Global macros |
| pathfindr | 0:94b743e06998 | 65 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 66 | #define lowByte(w) ((uint8_t) ((w) & 0xff)) |
| pathfindr | 0:94b743e06998 | 67 | #define highByte(w) ((uint8_t) ((w) >> 8)) |
| pathfindr | 0:94b743e06998 | 68 | |
| pathfindr | 11:60eb0ff945f2 | 69 | #define CONSOLE_DEBUG 1 /* Set this if you need debug messages on the console; * it will have an impact on code-size and power consumption. */ |
| pathfindr | 11:60eb0ff945f2 | 70 | #if CONSOLE_DEBUG |
| pathfindr | 0:94b743e06998 | 71 | #define DEBUG(...) { uart.printf(__VA_ARGS__); } |
| pathfindr | 0:94b743e06998 | 72 | #else |
| pathfindr | 0:94b743e06998 | 73 | #define DEBUG(...) /* nothing */ |
| pathfindr | 11:60eb0ff945f2 | 74 | #endif /* #if CONSOLE_DEBUG */ |
| pathfindr | 0:94b743e06998 | 75 | |
| pathfindr | 0:94b743e06998 | 76 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 77 | //Global data structures |
| pathfindr | 0:94b743e06998 | 78 | //------------------------------------------------------------------------------ |
| pathfindr | 0:94b743e06998 | 79 | |
| pathfindr | 7:e9a19750700d | 80 | //VARS |
| pathfindr | 7:e9a19750700d | 81 | extern bool requireSoftReset; |
| pathfindr | 11:60eb0ff945f2 | 82 | extern Serial uart; |
| pathfindr | 0:94b743e06998 | 83 | #endif |