target.cpp 629 B

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