Merge remote-tracking branch 'origin/dev' into main
58 commitů upstreamu nad v1.17.1. Šest konfliktů, všechny ručně: - `src/helpers/radiolib/RadioLibWrappers.cpp` — OBOJE. Upstream `aa229245` přidává `idle()` před `setOutputPower()` na LR2021 (tam jsou to standby-only příkazy a přijímač se sám nevrátí do Rx); naše část si dál drží návratový status, aby „rádio to odmítlo" a „rádio to změnilo" nevypadaly z konzole stejně. Nezávislé věci, obě zůstávají. - `src/helpers/CommonCLI.cpp` — VERZE UPSTREAMU. Celý blok `radio`, `radio.rxgain` a `radio.fem.*` byl čistě upstreamový kód (diff proti merge base v té oblasti je prázdný) a upstream ho přestěhoval do nového `CommonRadioPrefs`; FEM příkazy zrušil ve prospěch per-variant klíčů `fem_rxgain`/`fem_txgain`. - `examples/simple_repeater/MyMesh.h` — NAŠE + úklid. `static_assert` na 64bajtový wire formát `RepeaterStats` zůstává, `MAX_CLIENTS` odsud mizí: `1a8d860d` ho centralizoval do `helpers/ClientACL.h`, který je tu už includovaný. - `examples/simple_repeater/MyMesh.cpp` — NAŠE. Konflikt byl falešný (upstream ten řádek nemění), jde o naše dva countery `tx_start_fail`/`tx_timeout`. - `examples/companion_radio/ui-new/UITask.cpp` — OBOJE. Upstream přidal větve pro `UI_SHOW_CLOCK`, my podmínku `_task->isBluetoothEnabled()`, aby displej nenabízel PIN k párování, které není jak navázat. - `platformio.ini` — OBOJE. Vedle našeho symlinku na lokální nRF52 framework přibyl upstreamový `toolchain-gccarmnoneeabi@^1.140201.0`. Navíc: `[env:native_asan]` musel dostat `DynamicConfigSerializer.cpp` do `build_src_filter`. Merge ho přidal jen do `[env:native]` a ASAN env pak padal na undefined reference — což vypadá jako nález sanitizeru a je to jen chybějící překladová jednotka. Ty dva envy musí zůstat v zákrytu. Ověřeno: `pio test -e native` i `-e native_asan` 53/53, a čtyři envy, které skutečně flashujeme, se přeloží (Xiao repeater / companion_radio_usb / kiss_modem, t1000e_companion_radio_ble). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
82a74318c4
68 files changed
+2052
-357
No files matched your search
@@ -539,6 +539,8 @@ static void query_bme680_bsec(uint8_t ch, uint8_t, CayenneLPP& lpp) {
|
||||
// are compiled in. The sentinel at the end keeps the array
|
||||
// non-empty regardless of which sensors are enabled.
|
||||
//
|
||||
// Bosch BMP/BME SDO selects 0x76 or 0x77; probe both.
|
||||
//
|
||||
// Ordering here determines channel assignment at runtime:
|
||||
// the first detected+initialized sensor gets channel 2, the
|
||||
// next gets channel 3, and so on.
|
||||
@@ -551,21 +553,27 @@ struct SensorDef {
|
||||
void (*query)(uint8_t channel, uint8_t sub_channel, CayenneLPP& telemetry);
|
||||
};
|
||||
|
||||
#define TELEM_BOSCH_ALT_ADDR(addr) ((uint8_t)((addr) == 0x76 ? 0x77 : 0x76))
|
||||
|
||||
static const SensorDef SENSOR_TABLE[] = {
|
||||
#if ENV_INCLUDE_AHTX0
|
||||
{ TELEM_AHTX_ADDRESS, "AHT10/AHT20", init_ahtx0, query_ahtx0 },
|
||||
#endif
|
||||
#ifdef ENV_INCLUDE_BME680
|
||||
{ TELEM_BME680_ADDRESS, "BME680", init_bme680, query_bme680 },
|
||||
{ TELEM_BME680_ADDRESS, "BME680", init_bme680, query_bme680 },
|
||||
{ TELEM_BOSCH_ALT_ADDR(TELEM_BME680_ADDRESS), "BME680", init_bme680, query_bme680 },
|
||||
#endif
|
||||
#if ENV_INCLUDE_BME680_BSEC
|
||||
{ TELEM_BME680_ADDRESS, "BME680+BSEC", init_bme680_bsec, query_bme680_bsec },
|
||||
{ TELEM_BME680_ADDRESS, "BME680+BSEC", init_bme680_bsec, query_bme680_bsec },
|
||||
{ TELEM_BOSCH_ALT_ADDR(TELEM_BME680_ADDRESS), "BME680+BSEC", init_bme680_bsec, query_bme680_bsec },
|
||||
#endif
|
||||
#if ENV_INCLUDE_BME280
|
||||
{ TELEM_BME280_ADDRESS, "BME280", init_bme280, query_bme280 },
|
||||
{ TELEM_BME280_ADDRESS, "BME280", init_bme280, query_bme280 },
|
||||
{ TELEM_BOSCH_ALT_ADDR(TELEM_BME280_ADDRESS), "BME280", init_bme280, query_bme280 },
|
||||
#endif
|
||||
#if ENV_INCLUDE_BMP280
|
||||
{ TELEM_BMP280_ADDRESS, "BMP280", init_bmp280, query_bmp280 },
|
||||
{ TELEM_BMP280_ADDRESS, "BMP280", init_bmp280, query_bmp280 },
|
||||
{ TELEM_BOSCH_ALT_ADDR(TELEM_BMP280_ADDRESS), "BMP280", init_bmp280, query_bmp280 },
|
||||
#endif
|
||||
#if ENV_INCLUDE_SHTC3
|
||||
{ 0x70, "SHTC3", init_shtc3, query_shtc3 },
|
||||
@@ -603,6 +611,8 @@ static const SensorDef SENSOR_TABLE[] = {
|
||||
{ 0, nullptr, nullptr, nullptr } // sentinel — keeps the array non-empty
|
||||
};
|
||||
|
||||
#undef TELEM_BOSCH_ALT_ADDR
|
||||
|
||||
static const size_t SENSOR_TABLE_SIZE = (sizeof(SENSOR_TABLE) / sizeof(SENSOR_TABLE[0])) - 1;
|
||||
|
||||
// ============================================================
|
||||
@@ -640,6 +650,12 @@ bool EnvironmentSensorManager::begin() {
|
||||
_active_sensor_count = 0;
|
||||
for (size_t i = 0; i < SENSOR_TABLE_SIZE && _active_sensor_count < MAX_ACTIVE_SENSORS; i++) {
|
||||
const SensorDef& def = SENSOR_TABLE[i];
|
||||
// One static driver instance per type: an alternate address is a fallback, not a second device.
|
||||
bool already_active = false;
|
||||
for (int j = 0; j < _active_sensor_count; j++) {
|
||||
if (_active_sensors[j].query == def.query) { already_active = true; break; }
|
||||
}
|
||||
if (already_active) continue;
|
||||
if (!detected[def.address]) {
|
||||
MESH_DEBUG_PRINTLN("%s not detected at I2C address %02X", def.name, def.address);
|
||||
continue;
|
||||
@@ -650,6 +666,7 @@ bool EnvironmentSensorManager::begin() {
|
||||
continue;
|
||||
}
|
||||
MESH_DEBUG_PRINTLN("Found %s at address: %02X", def.name, def.address);
|
||||
detected[def.address] = false; // consumed; later entries must not re-claim this device
|
||||
for (uint8_t sub = 0; sub < n && _active_sensor_count < MAX_ACTIVE_SENSORS; sub++) {
|
||||
_active_sensors[_active_sensor_count++] = { def.query, sub };
|
||||
}
|
||||
@@ -893,11 +910,15 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef RAK_3401
|
||||
//set initial waking state
|
||||
pinMode(ioPin,OUTPUT);
|
||||
digitalWrite(ioPin,LOW);
|
||||
delay(500);
|
||||
digitalWrite(ioPin,HIGH);
|
||||
#endif
|
||||
|
||||
// give gps time to power up
|
||||
delay(500);
|
||||
|
||||
//Try to init RAK12500 on I2C
|
||||
@@ -933,7 +954,9 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef RAK_3401
|
||||
pinMode(ioPin, INPUT);
|
||||
#endif
|
||||
MESH_DEBUG_PRINTLN("GPS did not init with this IO pin... try the next");
|
||||
return false;
|
||||
}
|
||||
@@ -942,8 +965,10 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
|
||||
void EnvironmentSensorManager::start_gps() {
|
||||
gps_active = true;
|
||||
#ifdef RAK_WISBLOCK_GPS
|
||||
#ifndef RAK_3401
|
||||
pinMode(gpsResetPin, OUTPUT);
|
||||
digitalWrite(gpsResetPin, HIGH);
|
||||
#endif
|
||||
return;
|
||||
#endif
|
||||
|
||||
@@ -1001,8 +1026,10 @@ void EnvironmentSensorManager::gpsDutyLoop() {
|
||||
void EnvironmentSensorManager::stop_gps() {
|
||||
gps_active = false;
|
||||
#ifdef RAK_WISBLOCK_GPS
|
||||
#ifndef RAK_3401 // rak3401 shouldn't turn off WB_IO2 as it powers the PA
|
||||
pinMode(gpsResetPin, OUTPUT);
|
||||
digitalWrite(gpsResetPin, LOW);
|
||||
#endif
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user