fix: missing returns, BIT macro clash, longer tile source URLs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-10-12 19:53:53 +02:00
co-authored by Claude Opus 5.5
parent 18f5627b2a
commit b9735b089e
5 changed files with 14 additions and 13 deletions
@@ -217,7 +217,7 @@ static void applyRxGain(UiCore& c) { if (c.prefs()) radio_driver.setRxBoos
#define SW(label, hint, sec, f, chg) { label, hint, sec, NP_OFF(f), 2, nullptr, chg, nullptr, 1 }
#define MAP(label, hint, sec, f, vals, opt, chg) { label, hint, sec, NP_OFF(f), COUNT_OF(vals), opt, chg, vals, NP_SIZE(f) }
#define MAPF(label, hint, sec, f, vals, opt) { label, hint, sec, NP_OFF(f), COUNT_OF(vals), opt, nullptr, vals, FLOAT_X100 }
#define BIT(label, hint, sec, f, mask) { label, hint, sec, NP_OFF(f), 2, nullptr, nullptr, nullptr, 1, mask }
#define FLAGBIT(label, hint, sec, f, mask) { label, hint, sec, NP_OFF(f), 2, nullptr, nullptr, nullptr, 1, mask }
static const Setting ALL[] = {
#ifndef TRAIL_FIXED_MIN_DELTA_M // else every sample past a fixed jitter gate is kept
IDX("Point spacing", "Between trail points", SEC_TRAIL, trail_min_delta_idx,
@@ -284,12 +284,12 @@ static const Setting ALL[] = {
// manual_add_contacts bit 0: 0 adds every node heard, 1 only the types below.
IDX("Add heard nodes", "Every node, or only these types", SEC_AUTO_ADD, manual_add_contacts, 2, optAutoAdd, nullptr),
BIT("Companions", nullptr, SEC_AUTO_ADD, autoadd_config, 0x02),
BIT("Repeaters", nullptr, SEC_AUTO_ADD, autoadd_config, 0x04),
BIT("Rooms", nullptr, SEC_AUTO_ADD, autoadd_config, 0x08),
BIT("Sensors", nullptr, SEC_AUTO_ADD, autoadd_config, 0x10),
FLAGBIT("Companions", nullptr, SEC_AUTO_ADD, autoadd_config, 0x02),
FLAGBIT("Repeaters", nullptr, SEC_AUTO_ADD, autoadd_config, 0x04),
FLAGBIT("Rooms", nullptr, SEC_AUTO_ADD, autoadd_config, 0x08),
FLAGBIT("Sensors", nullptr, SEC_AUTO_ADD, autoadd_config, 0x10),
MAP("Up to", "How far away a node may be", SEC_AUTO_ADD, autoadd_max_hops, MAX_HOPS, optMaxHops, nullptr),
BIT("Replace oldest", "When the list is full; not favourites", SEC_AUTO_ADD, autoadd_config, 0x01),
FLAGBIT("Replace oldest", "When the list is full; not favourites", SEC_AUTO_ADD, autoadd_config, 0x01),
// On / Off / Auto spans two fields (soundctl::setMode): the frontend's own row.
IDX("Volume", nullptr, SEC_SOUND, buzzer_volume, 5, optVolume, applySound),
@@ -363,7 +363,7 @@ static int indexOf(uint16_t offset) {
#undef SW
#undef MAP
#undef MAPF
#undef BIT
#undef FLAGBIT
#undef COUNT_OF
#undef NP_SIZE
#undef NP_OFF
+1 -1
View File
@@ -649,7 +649,7 @@ static int scanResults(char names[][33], int max) {
enum { F_IDLE, F_REQUESTED, F_BUSY, F_DONE, F_FAILED };
static volatile int s_fstate = F_IDLE;
static volatile int s_fcode = 0;
static char s_furl[200];
static char s_furl[320];
static uint8_t* s_fbuf = nullptr;
static size_t s_fcap = 0;
static volatile size_t s_flen = 0;
@@ -306,7 +306,7 @@ public:
struct stat st;
if (!_force && stat(path, &st) == 0 && (st.st_size > 0 || _layer == 1)) { _skipped++; advance(); continue; } // an empty trails file counts
if ((int32_t)(millis() - _last_start) < (int32_t)_gap_ms) return; // be gentle with the server (a retry waits longer)
char url[200];
char url[320];
buildUrl(url, sizeof(url), _z, _x, _y, _layer);
int r = lvport::fetchStart(url);
if (r > 0) { _fetching = true; _last_start = millis(); }
@@ -346,7 +346,7 @@ private:
uint32_t _last_start = 0, _connect_started = 0;
uint32_t _placeholder_hash = 0;
uint8_t _placeholder_hits = 0;
char _url_tpl[160] = "";
char _url_tpl[256] = ""; // source.txt line 1: long enough for an API key
char _attr[96] = "";
char _host[48] = "";
int _src_zmax = 17;
@@ -442,7 +442,7 @@ private:
_lv_cur = _lv_q[0];
for (int i = 1; i < _lv_n; i++) _lv_q[i - 1] = _lv_q[i];
_lv_n--;
char url[200];
char url[320];
buildUrl(url, sizeof(url), _lv_cur.z, _lv_cur.x, _lv_cur.y, _lv_cur.layer);
if (lvport::fetchStart(url) > 0) { _lv_fetching = true; _last_start = millis(); }
else _lv_q[_lv_n++] = _lv_cur; // fetcher busy: back in the queue
@@ -566,7 +566,7 @@ private:
char path[64];
snprintf(path, sizeof(path), "%s/source.txt", _root);
if (FILE* f = fopen(path, "r")) {
char line[160];
char line[256];
if (fgets(line, sizeof(line), f)) { trim(line); if (strstr(line, "{z}")) snprintf(_url_tpl, sizeof(_url_tpl), "%s", line); }
if (fgets(line, sizeof(line), f)) { trim(line); if (line[0]) snprintf(_attr, sizeof(_attr), "%s", line); }
if (fgets(line, sizeof(line), f)) { int z = atoi(line); if (z >= 1 && z <= 22) _src_zmax = z; }
+1 -1
View File
@@ -38,7 +38,7 @@ public:
* These two functions do nothing for ESP-NOW, but are needed for the
* Radio interface.
*/
virtual bool setRxBoostedGainMode(bool) { }
virtual bool setRxBoostedGainMode(bool) { return false; }
virtual bool getRxBoostedGainMode() const { return false; }
uint32_t intID();
@@ -442,6 +442,7 @@ bool RAK12035_SoilMoisture::sensor_on()
delay(10); //delay 10mS
}
}
return true;
}
bool RAK12035_SoilMoisture::reset()