mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-15 14:27:19 +00:00
WIP
This commit is contained in:
17
src/main.cpp
17
src/main.cpp
@@ -24,6 +24,7 @@
|
||||
|
||||
#ifdef SENSECAP_INDICATOR // on the indicator run the additional serial port for the RP2040
|
||||
#include "IndicatorSerial.h"
|
||||
#include "mesh/comms/FakeI2C.h"
|
||||
#endif
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_I2C
|
||||
@@ -461,7 +462,11 @@ void setup()
|
||||
fsInit();
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_I2C
|
||||
#if defined(I2C_SDA1) && defined(ARCH_RP2040)
|
||||
// The Sensecap Indicator hast I2C on the secondary MCU. Tunnel this as wire1
|
||||
#if defined(SENSECAP_INDICATOR)
|
||||
FakeI2C Wire1 = *FakeWire;
|
||||
Wire1.begin();
|
||||
#elif defined(I2C_SDA1) && defined(ARCH_RP2040)
|
||||
Wire1.setSDA(I2C_SDA1);
|
||||
Wire1.setSCL(I2C_SCL1);
|
||||
Wire1.begin();
|
||||
@@ -519,7 +524,9 @@ void setup()
|
||||
LOG_INFO("Scan for i2c devices");
|
||||
#endif
|
||||
|
||||
#if defined(I2C_SDA1) && defined(ARCH_RP2040)
|
||||
#if defined(SENSECAP_INDICATOR)
|
||||
i2cScanner->scanPort(ScanI2C::I2CPort::WIRE1);
|
||||
#elif defined(I2C_SDA1) && defined(ARCH_RP2040)
|
||||
Wire1.setSDA(I2C_SDA1);
|
||||
Wire1.setSCL(I2C_SCL1);
|
||||
Wire1.begin();
|
||||
@@ -754,7 +761,11 @@ void setup()
|
||||
|
||||
// If we have an indicator, start process to service secondary port
|
||||
#ifdef SENSECAP_INDICATOR
|
||||
sensecapIndicator.begin(Serial2);
|
||||
#if SENSOR_PORT_NUM == 2
|
||||
sensecapIndicator = new SensecapIndicator(Serial2);
|
||||
#elif SENSOR_PORT_NUM == 1
|
||||
sensecapIndicator = new SensecapIndicator(Serial1);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// only play start melody when role is not tracker or sensor
|
||||
|
||||
Reference in New Issue
Block a user