target.cpp 844 B

1234567891011121314151617181920212223242526272829303132
  1. #include <Arduino.h>
  2. #include "target.h"
  3. #include <helpers/ArduinoHelpers.h>
  4. R1NeoBoard board;
  5. DISPLAY_CLASS display;
  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. VolatileRTCClock fallback_clock;
  9. AutoDiscoverRTCClock rtc_clock(fallback_clock);
  10. #if ENV_INCLUDE_GPS
  11. #include <helpers/sensors/MicroNMEALocationProvider.h>
  12. MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock);
  13. EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
  14. #else
  15. EnvironmentSensorManager sensors;
  16. #endif
  17. bool radio_init() {
  18. rtc_clock.begin(Wire);
  19. return radio.std_init(&SPI);
  20. }
  21. mesh::LocalIdentity radio_new_identity() {
  22. RadioNoiseListener rng(radio);
  23. return mesh::LocalIdentity(&rng); // create new random identity
  24. }