target.cpp 550 B

12345678910111213141516171819202122
  1. #include <Arduino.h>
  2. #include "target.h"
  3. Heltec_CT62_Board board;
  4. RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
  5. WRAPPER_CLASS radio_driver(radio, board);
  6. ESP32RTCClock fallback_clock;
  7. AutoDiscoverRTCClock rtc_clock(fallback_clock);
  8. SensorManager sensors;
  9. bool radio_init() {
  10. fallback_clock.begin();
  11. rtc_clock.begin(Wire);
  12. return radio.std_init(&SPI);
  13. }
  14. mesh::LocalIdentity radio_new_identity() {
  15. RadioNoiseListener rng(radio);
  16. return mesh::LocalIdentity(&rng); // create new random identity
  17. }