Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (push) Has been cancelled
PR Build Check / build (Heltec_v3_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (Heltec_v3_repeater) (push) Has been cancelled
PR Build Check / build (Heltec_v3_room_server) (push) Has been cancelled
PR Build Check / build (LilyGo_Tlora_C6_repeater_) (push) Has been cancelled
PR Build Check / build (PicoW_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (RAK_4631_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_room_server) (push) Has been cancelled
PR Build Check / build (wio-e5-mini_repeater) (push) Has been cancelled
- MeshCore-based Simple Sensor firmware - Heltec T114 without display - BME280 sensor support (temp/humidity/pressure) - Radio: 868.856018 MHz, SF7, BW62.5 kHz, CR4/7 - 2-byte path hash - PlatformIO project
45 lines
979 B
C++
45 lines
979 B
C++
#include "MeshtinyBoard.h"
|
|
|
|
#include <Arduino.h>
|
|
#include <Wire.h>
|
|
#include <bluefruit.h>
|
|
|
|
static BLEDfu bledfu;
|
|
|
|
static void connect_callback(uint16_t conn_handle) {
|
|
(void)conn_handle;
|
|
MESH_DEBUG_PRINTLN("BLE client connected");
|
|
}
|
|
|
|
static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
|
|
(void)conn_handle;
|
|
(void)reason;
|
|
|
|
MESH_DEBUG_PRINTLN("BLE client disconnected");
|
|
}
|
|
|
|
void MeshtinyBoard::begin() {
|
|
NRF52BoardDCDC::begin();
|
|
btn_prev_state = HIGH;
|
|
|
|
pinMode(PIN_VBAT_READ, INPUT); // VBAT ADC input
|
|
|
|
// Set all button pins to INPUT_PULLUP
|
|
pinMode(PIN_BUTTON1, INPUT_PULLUP);
|
|
pinMode(PIN_BUTTON2, INPUT_PULLUP);
|
|
pinMode(PIN_BUTTON3, INPUT_PULLUP);
|
|
pinMode(PIN_BUTTON4, INPUT_PULLUP);
|
|
|
|
#if defined(PIN_WIRE_SDA) && defined(PIN_WIRE_SCL)
|
|
Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL);
|
|
#endif
|
|
|
|
Wire.begin();
|
|
|
|
pinMode(SX126X_POWER_EN, OUTPUT);
|
|
digitalWrite(SX126X_POWER_EN, HIGH);
|
|
delay(10); // give sx1262 some time to power up
|
|
}
|
|
|
|
|