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.

46 regels
735 B

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