您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

61 行
1.1 KiB

  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 SIM808_BAUDRATE 4800
  13. #define SLEEP_DEFAULT_TIME_SECONDS 1800
  14. #define GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS 10000
  15. #define GPS_DEFAULT_TOTAL_TIMEOUT_MS 180000
  16. #define NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS 6000
  17. #define NETWORK_DEFAULT_TOTAL_TIMEOUT_MS 180000
  18. struct sleepTimings_t {
  19. uint8_t speed;
  20. uint16_t seconds;
  21. };
  22. struct config_t {
  23. uint8_t seed;
  24. char version[5];
  25. uint16_t firstEntry;
  26. uint16_t lastEntry;
  27. #if BACKUP_ENABLE_NETWORK
  28. networkConfig_t network;
  29. #endif
  30. };
  31. namespace config {
  32. static const sleepTimings_t defaultSleepTimings[] PROGMEM = {
  33. { 5, SLEEP_DEFAULT_TIME_SECONDS },
  34. { 10, 1200 },
  35. { 20, 600 },
  36. { 30, 540 },
  37. { 50, 480 },
  38. { 80, 240 },
  39. { 100, 210 },
  40. { 180, 180 },
  41. };
  42. namespace main {
  43. config_t get();
  44. void set(const config_t config);
  45. void reset();
  46. }
  47. }