fix: ping RTT 0ms, degree symbol, clock page dots overlap

- Ping: add _ping_ack_seen flag; RTT is measured only after ACK entry
  was first confirmed present in the table, preventing false 0ms when
  isAckPending() returns false before the entry is registered
- NearbyScreen: replace unsupported degree symbol \xb0 with 'd'
  in bearing format ("Dist:1.5km 45d")
- Clock page: hide page indicator dots (already hides node name/battery);
  eliminates overlap with size-2 clock text drawn at y=0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-14 13:28:52 +02:00
co-authored by Claude Sonnet 4.6
parent 85de0b02be
commit 10307d3a03
2 changed files with 14 additions and 8 deletions
@@ -49,6 +49,7 @@ class NearbyScreen : public UIScreen {
uint32_t _ping_expected_ack; uint32_t _ping_expected_ack;
unsigned long _ping_start_ms; unsigned long _ping_start_ms;
unsigned long _ping_rtt_ms; unsigned long _ping_rtt_ms;
bool _ping_ack_seen; // true once ACK entry confirmed in table
static const unsigned long PING_TIMEOUT_MS = 30000UL; static const unsigned long PING_TIMEOUT_MS = 30000UL;
static float haversineKm(int32_t lat1, int32_t lon1, int32_t lat2, int32_t lon2) { static float haversineKm(int32_t lat1, int32_t lon1, int32_t lat2, int32_t lon2) {
@@ -153,6 +154,7 @@ public:
_scanning = false; _scanning = false;
_ctx_menu.active = false; _ctx_menu.active = false;
_ping_state = PING_IDLE; _ping_state = PING_IDLE;
_ping_ack_seen = false;
refresh(); refresh();
} }
@@ -167,7 +169,10 @@ public:
// poll ping ack // poll ping ack
if (_ping_state == PING_WAIT) { if (_ping_state == PING_WAIT) {
if (!the_mesh.isAckPending(_ping_expected_ack)) { bool pending = the_mesh.isAckPending(_ping_expected_ack);
if (pending) {
_ping_ack_seen = true;
} else if (_ping_ack_seen) {
_ping_rtt_ms = millis() - _ping_start_ms; _ping_rtt_ms = millis() - _ping_start_ms;
_ping_state = PING_OK; _ping_state = PING_OK;
} else if (millis() - _ping_start_ms >= PING_TIMEOUT_MS) { } else if (millis() - _ping_start_ms >= PING_TIMEOUT_MS) {
@@ -197,7 +202,7 @@ public:
if (e.dist_km >= 0.0f) { if (e.dist_km >= 0.0f) {
char dist[12]; char dist[12];
fmtDist(dist, sizeof(dist), e.dist_km); fmtDist(dist, sizeof(dist), e.dist_km);
snprintf(buf, sizeof(buf), "Dist:%s %d\xb0", dist, bearingDeg(_own_lat, _own_lon, e.lat_e6, e.lon_e6)); snprintf(buf, sizeof(buf), "Dist:%s %dd", dist, bearingDeg(_own_lat, _own_lon, e.lat_e6, e.lon_e6));
display.setCursor(2, 31); display.print(buf); display.setCursor(2, 31); display.print(buf);
} else { } else {
display.setCursor(2, 31); display.print("Dist: no own GPS"); display.setCursor(2, 31); display.print("Dist: no own GPS");
@@ -291,6 +296,7 @@ public:
if (res != MSG_SEND_FAILED && expected_ack != 0) { if (res != MSG_SEND_FAILED && expected_ack != 0) {
_ping_expected_ack = expected_ack; _ping_expected_ack = expected_ack;
_ping_start_ms = millis(); _ping_start_ms = millis();
_ping_ack_seen = false;
_ping_state = PING_WAIT; _ping_state = PING_WAIT;
} }
} }
+2 -2
View File
@@ -1803,8 +1803,8 @@ public:
// ensure current page is visible (e.g. after settings change) // ensure current page is visible (e.g. after settings change)
if (!isPageVisible(_page)) _page = navPage(_page, +1); if (!isPageVisible(_page)) _page = navPage(_page, +1);
// curr page indicator — only visible pages get a dot // curr page indicator — hidden on CLOCK page (full screen used for dashboard)
{ if (_page != CLOCK) {
int vis_count = 0, curr_vis = 0; int vis_count = 0, curr_vis = 0;
for (int i = 0; i < (int)Count; i++) { for (int i = 0; i < (int)Count; i++) {
if (!isPageVisible(i)) continue; if (!isPageVisible(i)) continue;