Skip to content

Commit 1f53ed1

Browse files
authored
Merge branch 'master' into esp-idf5
2 parents ad81ecc + 1e41c99 commit 1f53ed1

11 files changed

+33
-752
lines changed

.github/pull_request_template.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
### ❌ (Please delete all these tips and replace them with your text) ❌
2-
3-
## Thank you for sending in a pull request, here's some tips to get started!
1+
## 🙏 Thank you for sending in a pull request, here's some tips to get started!
42

3+
### ❌ (Please delete all these tips and replace them with your text) ❌
54
- Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
65
to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
76
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
@@ -12,4 +11,17 @@
1211
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
1312
- If your other co-developers have comments on your PR please tweak as needed.
1413
- Please also enable "Allow edits by maintainers".
14+
- Please do not submit untested code.
15+
- If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and commnunity members can help test your changes.
1516
- If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord
17+
18+
19+
## 🤝 Attestations
20+
- [ ] I have tested that my proposed changes behave as described.
21+
- [ ] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
22+
- [ ] Heltec (Lora32) V3
23+
- [ ] LilyGo T-Deck
24+
- [ ] LilyGo T-Beam
25+
- [ ] RAK WisBlock 4631
26+
- [ ] Seeed Studio T-1000E tracker card
27+
- [ ] Other (please specify below)

src/configuration.h

-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
152152
#define MLX90614_ADDR_DEF 0x5A
153153
#define CGRADSENS_ADDR 0x66
154154
#define LTR390UV_ADDR 0x53
155-
#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 // same adress as TCA8418
156155

157156
// -----------------------------------------------------------------------------
158157
// ACCELEROMETER

src/detect/ScanI2C.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ ScanI2C::FoundDevice ScanI2C::firstRTC() const
3131

3232
ScanI2C::FoundDevice ScanI2C::firstKeyboard() const
3333
{
34-
ScanI2C::DeviceType types[] = {CARDKB, TDECKKB, BBQ10KB, RAK14004, MPR121KB, TCA8418KB};
35-
return firstOfOrNONE(6, types);
34+
ScanI2C::DeviceType types[] = {CARDKB, TDECKKB, BBQ10KB, RAK14004, MPR121KB};
35+
return firstOfOrNONE(5, types);
3636
}
3737

3838
ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const
@@ -74,4 +74,4 @@ bool ScanI2C::DeviceAddress::operator<(const ScanI2C::DeviceAddress &other) cons
7474
|| (port != NO_I2C && other.port != NO_I2C && (address < other.address));
7575
}
7676

77-
ScanI2C::FoundDevice::FoundDevice(ScanI2C::DeviceType type, ScanI2C::DeviceAddress address) : type(type), address(address) {}
77+
ScanI2C::FoundDevice::FoundDevice(ScanI2C::DeviceType type, ScanI2C::DeviceAddress address) : type(type), address(address) {}

src/detect/ScanI2C.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ScanI2C
1818
TDECKKB,
1919
BBQ10KB,
2020
RAK14004,
21-
PMU_AXP192_AXP2101, // has the same address as the TCA8418KB
21+
PMU_AXP192_AXP2101,
2222
BME_680,
2323
BME_280,
2424
BMP_280,
@@ -69,7 +69,6 @@ class ScanI2C
6969
DFROBOT_RAIN,
7070
DPS310,
7171
LTR390UV,
72-
TCA8418KB,
7372
} DeviceType;
7473

7574
// typedef uint8_t DeviceAddress;
@@ -133,4 +132,4 @@ class ScanI2C
133132

134133
private:
135134
bool shouldSuppressScreen = false;
136-
};
135+
};

src/detect/ScanI2CTwoWire.cpp

+9-14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include "meshUtils.h" // vformat
1111
#endif
1212

13+
// AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp
14+
#ifndef XPOWERS_AXP192_AXP2101_ADDRESS
15+
#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34
16+
#endif
17+
1318
bool in_array(uint8_t *array, int size, uint8_t lookfor)
1419
{
1520
int i;
@@ -206,26 +211,16 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
206211
}
207212
break;
208213

209-
case XPOWERS_AXP192_AXP2101_ADDRESS:
210-
// Do we have the TCA8418 instead?
211-
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x02), 1);
212-
if ((registerValue & 0b11100000) == 0) {
213-
logFoundDevice("TCA8418", (uint8_t)addr.address);
214-
type = TCA8418KB;
215-
} else {
216-
logFoundDevice("AXP192/AXP2101", (uint8_t)addr.address);
217-
type = PMU_AXP192_AXP2101;
218-
}
219-
break;
220-
221214
SCAN_SIMPLE_CASE(TDECK_KB_ADDR, TDECKKB, "T-Deck keyboard", (uint8_t)addr.address);
222215
SCAN_SIMPLE_CASE(BBQ10_KB_ADDR, BBQ10KB, "BB Q10", (uint8_t)addr.address);
223216

224217
SCAN_SIMPLE_CASE(ST7567_ADDRESS, SCREEN_ST7567, "ST7567", (uint8_t)addr.address);
225218
#ifdef HAS_NCP5623
226219
SCAN_SIMPLE_CASE(NCP5623_ADDR, NCP5623, "NCP5623", (uint8_t)addr.address);
227220
#endif
228-
221+
#ifdef HAS_PMU
222+
SCAN_SIMPLE_CASE(XPOWERS_AXP192_AXP2101_ADDRESS, PMU_AXP192_AXP2101, "AXP192/AXP2101", (uint8_t)addr.address)
223+
#endif
229224
case BME_ADDR:
230225
case BME_ADDR_ALTERNATE:
231226
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xD0), 1); // GET_ID
@@ -541,4 +536,4 @@ void ScanI2CTwoWire::logFoundDevice(const char *device, uint8_t address)
541536
{
542537
LOG_INFO("%s found at address 0x%x", device, address);
543538
}
544-
#endif
539+
#endif

0 commit comments

Comments
 (0)