mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 17:42:48 +00:00
Set pin for RAK-12039 to allow I2C auto-detect (#2555)
* SET pin for RAK-12039 and put back macaddr for now * Guard against epaper RAK variant * Update main.cpp * Add these back
This commit is contained in:
parent
81f80546b4
commit
f71869215d
@ -263,6 +263,12 @@ void setup()
|
|||||||
// We need to enable 3.3V periphery in order to scan it
|
// We need to enable 3.3V periphery in order to scan it
|
||||||
pinMode(PIN_3V3_EN, OUTPUT);
|
pinMode(PIN_3V3_EN, OUTPUT);
|
||||||
digitalWrite(PIN_3V3_EN, HIGH);
|
digitalWrite(PIN_3V3_EN, HIGH);
|
||||||
|
|
||||||
|
#ifndef USE_EINK
|
||||||
|
// RAK-12039 set pin for Air quality sensor
|
||||||
|
pinMode(AQ_SET_PIN, OUTPUT);
|
||||||
|
digitalWrite(AQ_SET_PIN, HIGH);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Currently only the tbeam has a PMU
|
// Currently only the tbeam has a PMU
|
||||||
|
@ -304,10 +304,11 @@ void NodeDB::init()
|
|||||||
int saveWhat = 0;
|
int saveWhat = 0;
|
||||||
|
|
||||||
// likewise - we always want the app requirements to come from the running appload
|
// likewise - we always want the app requirements to come from the running appload
|
||||||
myNodeInfo.min_app_version = 20300; // format is Mmmss (where M is 1+the numeric major number. i.e. 20120 means 1.1.20
|
myNodeInfo.min_app_version = 20300; // format is Mmmss (where M is 1+the numeric major number. i.e. 20120 means 1.1.20
|
||||||
|
myNodeInfo.max_channels = MAX_NUM_CHANNELS; // tell others the max # of channels we can understand
|
||||||
// Note! We do this after loading saved settings, so that if somehow an invalid nodenum was stored in preferences we won't
|
// Note! We do this after loading saved settings, so that if somehow an invalid nodenum was stored in preferences we won't
|
||||||
// keep using that nodenum forever. Crummy guess at our nodenum (but we will check against the nodedb to avoid conflicts)
|
// keep using that nodenum forever. Crummy guess at our nodenum (but we will check against the nodedb to avoid conflicts)
|
||||||
|
strncpy(myNodeInfo.firmware_version, optstr(APP_VERSION), sizeof(myNodeInfo.firmware_version));
|
||||||
pickNewNodeNum();
|
pickNewNodeNum();
|
||||||
|
|
||||||
// Set our board type so we can share it with others
|
// Set our board type so we can share it with others
|
||||||
@ -362,7 +363,7 @@ void NodeDB::pickNewNodeNum()
|
|||||||
r = NUM_RESERVED; // don't pick a reserved node number
|
r = NUM_RESERVED; // don't pick a reserved node number
|
||||||
|
|
||||||
meshtastic_NodeInfo *found;
|
meshtastic_NodeInfo *found;
|
||||||
while ((found = getNode(r))) {
|
while ((found = getNode(r)) && memcmp(found->user.macaddr, owner.macaddr, sizeof(owner.macaddr))) {
|
||||||
NodeNum n = random(NUM_RESERVED, NODENUM_BROADCAST); // try a new random choice
|
NodeNum n = random(NUM_RESERVED, NODENUM_BROADCAST); // try a new random choice
|
||||||
LOG_DEBUG("NOTE! Our desired nodenum 0x%x is in use, so trying for 0x%x\n", r, n);
|
LOG_DEBUG("NOTE! Our desired nodenum 0x%x is in use, so trying for 0x%x\n", r, n);
|
||||||
r = n;
|
r = n;
|
||||||
|
@ -172,6 +172,10 @@ void cpuDeepSleep(uint32_t msecToWake)
|
|||||||
setBluetoothEnable(false);
|
setBluetoothEnable(false);
|
||||||
#ifdef RAK4630
|
#ifdef RAK4630
|
||||||
digitalWrite(PIN_3V3_EN, LOW);
|
digitalWrite(PIN_3V3_EN, LOW);
|
||||||
|
#ifndef USE_EINK
|
||||||
|
// RAK-12039 set pin for Air quality sensor
|
||||||
|
digitalWrite(AQ_SET_PIN, LOW);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
// FIXME, use system off mode with ram retention for key state?
|
// FIXME, use system off mode with ram retention for key state?
|
||||||
// FIXME, use non-init RAM per
|
// FIXME, use non-init RAM per
|
||||||
@ -197,4 +201,4 @@ void clearBonds()
|
|||||||
nrf52Bluetooth->setup();
|
nrf52Bluetooth->setup();
|
||||||
}
|
}
|
||||||
nrf52Bluetooth->clearBonds();
|
nrf52Bluetooth->clearBonds();
|
||||||
}
|
}
|
@ -258,6 +258,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
#define PIN_ETHERNET_RESET 21
|
#define PIN_ETHERNET_RESET 21
|
||||||
#define PIN_ETHERNET_SS PIN_EINK_CS
|
#define PIN_ETHERNET_SS PIN_EINK_CS
|
||||||
#define ETH_SPI_PORT SPI1
|
#define ETH_SPI_PORT SPI1
|
||||||
|
#define AQ_SET_PIN 10
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
@ -267,4 +268,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
* Arduino objects - C++ only
|
* Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user