PicoWBoard.cpp 974 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include <Arduino.h>
  2. #include "PicoWBoard.h"
  3. //#include <bluefruit.h>
  4. #include <Wire.h>
  5. //static BLEDfu bledfu;
  6. static void connect_callback(uint16_t conn_handle) {
  7. (void)conn_handle;
  8. MESH_DEBUG_PRINTLN("BLE client connected");
  9. }
  10. static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
  11. (void)conn_handle;
  12. (void)reason;
  13. MESH_DEBUG_PRINTLN("BLE client disconnected");
  14. }
  15. void PicoWBoard::begin() {
  16. // for future use, sub-classes SHOULD call this from their begin()
  17. startup_reason = BD_STARTUP_NORMAL;
  18. pinMode(PIN_VBAT_READ, INPUT);
  19. #ifdef PIN_USER_BTN
  20. pinMode(PIN_USER_BTN, INPUT_PULLUP);
  21. #endif
  22. #if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
  23. Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL);
  24. #endif
  25. Wire.begin();
  26. //pinMode(SX126X_POWER_EN, OUTPUT);
  27. //digitalWrite(SX126X_POWER_EN, HIGH);
  28. delay(10); // give sx1262 some time to power up
  29. }
  30. bool PicoWBoard::startOTAUpdate(const char* id, char reply[]) {
  31. return false;
  32. }