target.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #define RADIOLIB_STATIC_ONLY 1
  3. #include <RadioLib.h>
  4. #include <helpers/radiolib/RadioLibWrappers.h>
  5. #include <ThinkNodeM1Board.h>
  6. #include <helpers/radiolib/CustomSX1262Wrapper.h>
  7. #include <helpers/AutoDiscoverRTCClock.h>
  8. #include <helpers/SensorManager.h>
  9. #include <helpers/sensors/LocationProvider.h>
  10. #ifdef DISPLAY_CLASS
  11. #include <helpers/ui/GxEPDDisplay.h>
  12. #include <helpers/ui/MomentaryButton.h>
  13. #endif
  14. class ThinkNodeM1SensorManager : public SensorManager {
  15. bool gps_active = false;
  16. bool last_gps_switch_state = false;
  17. LocationProvider* _location;
  18. void start_gps();
  19. void stop_gps();
  20. public:
  21. ThinkNodeM1SensorManager(LocationProvider &location): _location(&location) { }
  22. LocationProvider* getLocationProvider() override { return _location; }
  23. bool begin() override;
  24. bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override;
  25. void loop() override;
  26. int getNumSettings() const override;
  27. const char* getSettingName(int i) const override;
  28. const char* getSettingValue(int i) const override;
  29. bool setSettingValue(const char* name, const char* value) override;
  30. };
  31. extern ThinkNodeM1Board board;
  32. extern WRAPPER_CLASS radio_driver;
  33. extern AutoDiscoverRTCClock rtc_clock;
  34. extern ThinkNodeM1SensorManager sensors;
  35. #ifdef DISPLAY_CLASS
  36. extern DISPLAY_CLASS display;
  37. extern MomentaryButton user_btn;
  38. #endif
  39. bool radio_init();
  40. mesh::LocalIdentity radio_new_identity();