You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 rivejä
1.3 KiB

  1. #pragma once
  2. #include <Arduino.h>
  3. #define BACKUP_ENABLE_SDCARD 0
  4. #define BACKUP_ENABLE_NETWORK 0
  5. #if BACKUP_ENABLE_NETWORK
  6. #include "NetworkPositionsConfig.h"
  7. #endif
  8. #define SIM808_BAUDRATE 4800
  9. #define CONFIG_ADDR 0
  10. #define CONFIG_RESERVED_SIZE 128
  11. #define CONFIG_SEED 13
  12. #define VERSION "1.00"
  13. #pragma region Default configuration values
  14. #define MENU_TIMEOUT 10000
  15. /**
  16. \def SLEEP_DEFAULT_TIME_SECONDS
  17. Hard coded value for default sleep time between position acquisitions.
  18. Exprimed in seconds
  19. */
  20. #define SLEEP_DEFAULT_TIME_SECONDS 1800
  21. #define SLEEP_DEFAULT_INCREASE_THRESHOLD 3
  22. #define GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS 10000
  23. #define GPS_DEFAULT_TOTAL_TIMEOUT_MS 180000
  24. #define NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS 6000
  25. #define NETWORK_DEFAULT_TOTAL_TIMEOUT_MS 180000
  26. #pragma endregion
  27. struct sleepTimings_t {
  28. uint8_t speed;
  29. uint16_t seconds;
  30. };
  31. struct config_t {
  32. uint8_t seed;
  33. char version[5];
  34. uint16_t firstEntry;
  35. uint16_t lastEntry;
  36. #if BACKUP_ENABLE_NETWORK
  37. networkConfig_t network;
  38. #endif
  39. };
  40. namespace config {
  41. static const sleepTimings_t defaultSleepTimings[] PROGMEM = {
  42. { 5, SLEEP_DEFAULT_TIME_SECONDS },
  43. { 10, 1200 },
  44. { 20, 600 },
  45. { 30, 540 },
  46. { 50, 480 },
  47. { 80, 240 },
  48. { 100, 210 },
  49. { 180, 180 },
  50. };
  51. namespace main {
  52. extern config_t value;
  53. void setup();
  54. void save();
  55. void reset();
  56. }
  57. }