Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

83 righe
1.4 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. { 5, 600 },
  52. { 10, 600 },
  53. { 20, 600 },
  54. { 30, 540 },
  55. { 50, 480 },
  56. { 80, 240 },
  57. { 100, 210 },
  58. { 180, 180 },
  59. };
  60. namespace main {
  61. extern config_t value;
  62. void setup();
  63. void save();
  64. void reset();
  65. }
  66. }