From 6bcbf34cd7d9b60f808d0d3ab329c5d851373201 Mon Sep 17 00:00:00 2001 From: Bertrand Lemasle Date: Wed, 26 Dec 2018 16:42:43 +1300 Subject: [PATCH] Reformatted config header files comments --- src/config/Alerts.h | 21 ++++++--------------- src/config/BackupNetwork.h | 16 ++++++---------- src/config/Gps.h | 13 ++++--------- src/config/Hardware.h | 4 ++-- src/config/Main.h | 20 ++++++-------------- src/config/System.h | 25 ++++--------------------- 6 files changed, 28 insertions(+), 71 deletions(-) diff --git a/src/config/Alerts.h b/src/config/Alerts.h index 61247f8..0c7aa4c 100644 --- a/src/config/Alerts.h +++ b/src/config/Alerts.h @@ -10,24 +10,15 @@ * between readings. Setting a clearance level much higher avoid * clearing the levels and retriggering them the next time. */ + +#define ALERTS_ON_SERIAL _DEBUG ///< Display alerts on serial when connected rather than sending an SMS. #define CONFIG_DEFAULT_BATTERY_ALERT_LEVEL1 45 ///< Battery percentage at which to trigger the first low battery alert. #define CONFIG_DEFAULT_BATTERY_ALERT_LEVEL2 38 ///< Battery percentage at which to trigger the final low battery alert. #define CONFIG_DEFAULT_BATTERY_ALERT_CLEAR 60 ///< Battery percentage at which to clear all battery alerts. #define CONFIG_DEFAULT_ACTIVE_ALERTS 0 ///< Default active alerts -#define CONFIG_DEFAULT_CONTACT_PHONE "+642568452" ///< Default phone number to send the alert SMS to. - +#define CONFIG_DEFAULT_CONTACT_PHONE "+642568452" ///< Default phone number to send the alert SMS to. -/** - \def ALERTS_ON_SERIAL - Display alerts on serial when connected rather than sending an SMS. - Useful for debugging purpose and avoid costs related to SMS sending. -*/ -#define ALERTS_ON_SERIAL _DEBUG -/** - \def ALERT_SUSPICIOUS_RTC_TEMPERATURE - Temperature at which to consider the RTC module as failling. - When the backup battery is dead or nearly dead, the reading - of the temperature fails and returns 0. -*/ -#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0 \ No newline at end of file +#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0 ///< Temperature at which to consider the RTC module as failling. + ///< When the backup battery is dead or nearly dead, the reading + ///< of the temperature fails and returns 0. \ No newline at end of file diff --git a/src/config/BackupNetwork.h b/src/config/BackupNetwork.h index dd72aef..86c0394 100644 --- a/src/config/BackupNetwork.h +++ b/src/config/BackupNetwork.h @@ -4,17 +4,13 @@ #pragma once -#define POSITIONS_CONFIG_NET_DEFAULT_SAVE_THRESHOLD 30 ///< Determines how many positions will be saved before a network backup is needed (only when not moving though). -#define POSITIONS_CONFIG_NET_DEFAULT_APN "Vodafone" ///< APN used for GPRS context +#define POSITIONS_CONFIG_NET_DEFAULT_SAVE_THRESHOLD 30 ///< Determines how many positions will be saved before a network backup is needed (only when not moving though). +#define POSITIONS_CONFIG_NET_DEFAULT_APN "Vodafone" ///< APN used for GPRS context #define POSITIONS_CONFIG_NET_DEFAULT_URL "http://yourserver.com/endpoint" ///< URL to which positions data will be send through an HTTP POST request -#define POSITIONS_CONFIG_NET_DEFAULT_EXPECTED_RESPONSE 201 ///< Expected response code from the server that indicates that the positions has been successfully backuped. -/** - \def POSITIONS_CONFIG_NET_DEFAULT_UNAVAILABLE_NETWORK_POSTPONE_THRESHOLD - Determines how many times to deal with an unreliable network before postponing the backup. - In an area where cell reception isn't good, this avoid to try to backup the positions - every single time, which would rapidly consumes all the batty. -*/ -#define POSITIONS_CONFIG_NET_DEFAULT_UNAVAILABLE_NETWORK_POSTPONE_THRESHOLD 5 +#define POSITIONS_CONFIG_NET_DEFAULT_EXPECTED_RESPONSE 201 ///< Expected response code from the server that indicates that the positions has been successfully backuped. +#define POSITIONS_CONFIG_NET_DEFAULT_UNAVAILABLE_NETWORK_POSTPONE_THRESHOLD 5 ///< Determines how many times to deal with an unreliable network before postponing the backup. + ///< In an area where cell reception isn't good, this avoid to try to backup the positions + ///< every single time, which would rapidly consumes all the battery. struct networkConfig_t { uint8_t saveThreshold; //sizeof = 1 diff --git a/src/config/Gps.h b/src/config/Gps.h index a1cfee7..18b0ab0 100644 --- a/src/config/Gps.h +++ b/src/config/Gps.h @@ -6,12 +6,7 @@ #define GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS 10000L ///< Time to sleeps between each GPS signal assessment. #define GPS_DEFAULT_TOTAL_TIMEOUT_MS 80000L ///< Timeout after which to stop trying to get a GPS signal. - -/** - \def GPS_DEFAULT_MISSED_POSITION_GAP_KM - Gap between the current and previous position above which to consider - that the tracker has moved. Even if stopped, this will trigger a whole - new "cycle" of positions acquisition, and will avoid missing positions - because while moving, the tracker woke up while stopped at a light traffic for instance. -*/ -#define GPS_DEFAULT_MISSED_POSITION_GAP_KM 2 \ No newline at end of file +#define GPS_DEFAULT_MISSED_POSITION_GAP_KM 2 ///< Gap between the current and previous position above which to consider + ///< that the tracker has moved. Even if stopped, this will trigger a whole + ///< new "cycle" of positions acquisition, and will avoid missing positions + ///< because while moving, the tracker woke up while stopped at a light traffic for instance. \ No newline at end of file diff --git a/src/config/Hardware.h b/src/config/Hardware.h index e3c0d4b..7560219 100644 --- a/src/config/Hardware.h +++ b/src/config/Hardware.h @@ -5,8 +5,8 @@ #include #include -#define E24_ADDRESS E24_DEFAULT_ADDR ///< I2C address of the 24xxx chip -#define E24_SIZE E24Size_t::E24_512K ///< 24xxx chip size +#define E24_ADDRESS E24_DEFAULT_ADDR ///< I2C address of the 24xxx chip +#define E24_SIZE E24Size_t::E24_512K ///< 24xxx chip size #define SIM808_BAUDRATE 4800 ///< Control the baudrate use to communicate with the SIM808 module #define SIM_SERIAL_TYPE SoftwareSerial ///< Type of variable that holds the Serial communication with SIM808 diff --git a/src/config/Main.h b/src/config/Main.h index dc15095..d5fcfc6 100644 --- a/src/config/Main.h +++ b/src/config/Main.h @@ -7,23 +7,15 @@ #include "Sleeps.h" #include "Alerts.h" -/** - \def BACKUP_ENABLE_SDCARD - Enable (1) or disable (0) the backup of positions using an sd card. - Note: This code has never been finished properly because of the lack of space - on the ATMega -*/ -#define BACKUP_ENABLE_SDCARD 0 -/** - \def BACKUP_ENABLE_NETWORK - Enable (1) or disable (0) the backup of positions using the network. -*/ -#define BACKUP_ENABLE_NETWORK 1 +#define BACKUP_ENABLE_SDCARD 0 ///< Enable (1) or disable (0) the backup of positions using an sd card. + ///< Note: This code has never been finished properly because of the lack of space + ///< on the ATMega +#define BACKUP_ENABLE_NETWORK 1 ///< Enable (1) or disable (0) the backup of positions using the network. #if BACKUP_ENABLE_SDCARD -#include "BackupSd.h" + #include "BackupSd.h" #endif #if BACKUP_ENABLE_NETWORK -#include "BackupNetwork.h" + #include "BackupNetwork.h" #endif \ No newline at end of file diff --git a/src/config/System.h b/src/config/System.h index 8538e08..3105d49 100644 --- a/src/config/System.h +++ b/src/config/System.h @@ -1,26 +1,9 @@ #pragma once -/** - \def CONFIG_ADDR - Address of the config block in the I2C EEPROM chip. - */ -#define CONFIG_ADDR 0 -/** - \def CONFIG_RESERVED_SIZE - Reserved size for the config block in the I2C EEPROM chip. - */ -#define CONFIG_RESERVED_SIZE 128 -/** - \def CONFIG_SEED - Seed use to detect invalid or outdate configuration data. - Changing this value will reset the configuration block. - */ -#define CONFIG_SEED 14 -/** - \def VERSION - Version string, only used for indicative purpose - */ -#define VERSION "1.41" +#define CONFIG_ADDR 0 ///< Address of the config block in the I2C EEPROM chip. +#define CONFIG_RESERVED_SIZE 128 ///< Reserved size for the config block in the I2C EEPROM chip. +#define CONFIG_SEED 14 ///< Seed use to detect invalid or outdate configuration data. +#define VERSION "1.41" /// Version string, only used for indicative purpose. /**