target.cpp 724 B

123456789101112131415161718192021222324252627282930
  1. #include <Arduino.h>
  2. #include "target.h"
  3. #include <helpers/ArduinoHelpers.h>
  4. #include <helpers/sensors/MicroNMEALocationProvider.h>
  5. HeltecMeshPocket board;
  6. RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
  7. WRAPPER_CLASS radio_driver(radio, board);
  8. SensorManager sensors = SensorManager();
  9. VolatileRTCClock fallback_clock;
  10. AutoDiscoverRTCClock rtc_clock(fallback_clock);
  11. #ifdef DISPLAY_CLASS
  12. DISPLAY_CLASS display;
  13. MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
  14. #endif
  15. bool radio_init() {
  16. return radio.std_init(&SPI);
  17. }
  18. mesh::LocalIdentity radio_new_identity() {
  19. RadioNoiseListener rng(radio);
  20. return mesh::LocalIdentity(&rng); // create new random identity
  21. }