fixed: added back pin inits when SDA and SCL are set.

This commit is contained in:
recrof
2025-03-16 10:17:04 +01:00
parent d525680b71
commit 882377e4d6
6 changed files with 99 additions and 86 deletions

View File

@@ -24,6 +24,10 @@ void RAK4631Board::begin() {
pinMode(PIN_VBAT_READ, INPUT); pinMode(PIN_VBAT_READ, INPUT);
pinMode(PIN_USER_BTN, INPUT_PULLUP); pinMode(PIN_USER_BTN, INPUT_PULLUP);
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL)
#endif
Wire.begin(); Wire.begin();
pinMode(SX126X_POWER_EN, OUTPUT); pinMode(SX126X_POWER_EN, OUTPUT);

View File

@@ -4,8 +4,7 @@
#include <bluefruit.h> #include <bluefruit.h>
void T1000eBoard::begin() void T1000eBoard::begin() {
{
// for future use, sub-classes SHOULD call this from their begin() // for future use, sub-classes SHOULD call this from their begin()
startup_reason = BD_STARTUP_NORMAL; startup_reason = BD_STARTUP_NORMAL;
btn_prev_state = HIGH; btn_prev_state = HIGH;
@@ -16,6 +15,10 @@ void T1000eBoard::begin()
pinMode(LED_PIN, OUTPUT); pinMode(LED_PIN, OUTPUT);
#endif #endif
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL)
#endif
Wire.begin(); Wire.begin();
delay(10); // give sx1262 some time to power up delay(10); // give sx1262 some time to power up
@@ -24,14 +27,12 @@ void T1000eBoard::begin()
#if 0 #if 0
static BLEDfu bledfu; static BLEDfu bledfu;
static void connect_callback(uint16_t conn_handle) static void connect_callback(uint16_t conn_handle) {
{
(void)conn_handle; (void)conn_handle;
MESH_DEBUG_PRINTLN("BLE client connected"); MESH_DEBUG_PRINTLN("BLE client connected");
} }
static void disconnect_callback(uint16_t conn_handle, uint8_t reason) static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
{
(void)conn_handle; (void)conn_handle;
(void)reason; (void)reason;

View File

@@ -26,6 +26,10 @@ void T114Board::begin() {
pinMode(PIN_VBAT_READ, INPUT); pinMode(PIN_VBAT_READ, INPUT);
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL)
#endif
Wire.begin(); Wire.begin();
#ifdef P_LORA_TX_LED #ifdef P_LORA_TX_LED

View File

@@ -6,14 +6,12 @@
static BLEDfu bledfu; static BLEDfu bledfu;
static void connect_callback(uint16_t conn_handle) static void connect_callback(uint16_t conn_handle) {
{
(void)conn_handle; (void)conn_handle;
MESH_DEBUG_PRINTLN("BLE client connected"); MESH_DEBUG_PRINTLN("BLE client connected");
} }
static void disconnect_callback(uint16_t conn_handle, uint8_t reason) static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
{
(void)conn_handle; (void)conn_handle;
(void)reason; (void)reason;
@@ -26,6 +24,10 @@ void TechoBoard::begin() {
pinMode(PIN_VBAT_READ, INPUT); pinMode(PIN_VBAT_READ, INPUT);
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL)
#endif
Wire.begin(); Wire.begin();
pinMode(SX126X_POWER_EN, OUTPUT); pinMode(SX126X_POWER_EN, OUTPUT);

View File

@@ -6,14 +6,12 @@
static BLEDfu bledfu; static BLEDfu bledfu;
static void connect_callback(uint16_t conn_handle) static void connect_callback(uint16_t conn_handle) {
{
(void)conn_handle; (void)conn_handle;
MESH_DEBUG_PRINTLN("BLE client connected"); MESH_DEBUG_PRINTLN("BLE client connected");
} }
static void disconnect_callback(uint16_t conn_handle, uint8_t reason) static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
{
(void)conn_handle; (void)conn_handle;
(void)reason; (void)reason;

View File

@@ -31,6 +31,10 @@ public:
pinMode(PIN_VBAT_READ, INPUT); pinMode(PIN_VBAT_READ, INPUT);
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL)
#endif
Wire.begin(); Wire.begin();
pinMode(SX126X_POWER_EN, OUTPUT); pinMode(SX126X_POWER_EN, OUTPUT);