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.

56 rivejä
947 B

  1. #pragma once
  2. #include <Arduino.h>
  3. #define BACKUP_ENABLE_SDCARD 0
  4. #define BACKUP_ENABLE_NETWORK 1
  5. #if BACKUP_ENABLE_NETWORK
  6. #include "NetworkPositionsConfig.h"
  7. #endif
  8. #define CONFIG_ADDR 0
  9. #define CONFIG_RESERVED_SIZE 128
  10. #define CONFIG_SEED 13
  11. #define VERSION "1.00"
  12. #define SLEEP_DEFAULT_TIME_SECONDS 1800
  13. #define GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS 10000
  14. #define GPS_DEFAULT_TOTAL_TIMEOUT_MS 180000
  15. struct sleepTimings_t {
  16. uint8_t speed;
  17. uint16_t seconds;
  18. };
  19. struct config_t {
  20. uint8_t seed;
  21. char version[5];
  22. uint16_t firstEntry;
  23. uint16_t lastEntry;
  24. #if BACKUP_ENABLE_NETWORK
  25. networkConfig_t network;
  26. #endif
  27. };
  28. namespace config {
  29. static const sleepTimings_t defaultSleepTimings[] PROGMEM = {
  30. { 5, SLEEP_DEFAULT_TIME_SECONDS },
  31. { 10, 1200 },
  32. { 20, 600 },
  33. { 30, 540 },
  34. { 50, 480 },
  35. { 80, 240 },
  36. { 100, 210 },
  37. { 180, 180 },
  38. };
  39. namespace main {
  40. config_t get();
  41. void set(const config_t config);
  42. void reset();
  43. }
  44. }