Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

82 linhas
1.8 KiB

  1. #pragma once
  2. #include <Arduino.h>
  3. #include <ArduinoLog.h>
  4. #include "Config.h"
  5. #include "Hardware.h"
  6. #include "Gps.h"
  7. #include "Rtc.h"
  8. #define LOG(level, f) Log.level(F("[" LOGGER_NAME "::" f "]\n"))
  9. #define LOG_MSG(level, f, msg) Log.level(F("[" LOGGER_NAME "::" f "] " msg "\n"))
  10. #define LOG_FORMAT(level, f, msg, ...) Log.level(F("[" LOGGER_NAME "::" f "] " msg "\n"), __VA_ARGS__)
  11. #ifdef _DEBUG
  12. #define VERBOSE(f) LOG(verbose, f)
  13. #define VERBOSE_MSG(f, msg) LOG_MSG(verbose, f, msg)
  14. #define VERBOSE_FORMAT(f, msg, ...) LOG_FORMAT(verbose, f, msg, __VA_ARGS__)
  15. #else
  16. #define DISABLE_LOGGING 1
  17. #define VERBOSE(f)
  18. #define VERBOSE_MSG(f, msg)
  19. #define VERBOSE_FORMAT(f, msg, ...)
  20. #endif
  21. #define NOTICE(f) LOG(notice, f)
  22. #define NOTICE_MSG(f, msg) LOG_MSG(notice, f, msg)
  23. #define NOTICE_FORMAT(f, msg, ...) LOG_FORMAT(notice, f, msg, __VA_ARGS__)
  24. #define DEBUG_SERIAL_SPEED 115200
  25. namespace debug {
  26. enum class GPSTRACKER_DEBUG_COMMAND : uint8_t {
  27. NONE = 0,
  28. RUN = 1,
  29. ONCE = 2,
  30. RAM = 3,
  31. BATTERY = 4,
  32. GPS_ON = 5,
  33. GPS_OFF = 6,
  34. GPS_GET = 7,
  35. GPS_SET = 8,
  36. RTC_GET = 11,
  37. RTC_SET = 12,
  38. SD_WRITE_TEST = 13,
  39. EEPROM_GET_CONFIG = 14,
  40. EEPROM_RESET_CONFIG = 15,
  41. EEPROM_GET_CONTENT = 16,
  42. EEPROM_GET_LAST_ENTRY = 17,
  43. EEPROM_GET_ENTRIES = 18,
  44. EEPROM_ADD_ENTRY = 19,
  45. SLEEP = 20,
  46. SLEEP_DEEP = 21
  47. };
  48. void waitForSerial();
  49. int freeRam();
  50. GPSTRACKER_DEBUG_COMMAND menu();
  51. void getAndDisplayBattery();
  52. void getAndDisplayGpsPosition();
  53. void setFakeGpsPosition();
  54. void getAndDisplayRtcTime();
  55. void setRtcTime();
  56. void getAndDisplayEepromConfig();
  57. void getAndDisplayEepromContent();
  58. void getAndDisplayEepromPositions();
  59. void getAndDisplayEepromLastPosition();
  60. void addLastPositionToEeprom();
  61. inline void displayFreeRam() { Serial.println(freeRam()); }
  62. }