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.

48 lines
775 B

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