Fix text running off screen in Sub-GHz and GATT Server screens

Sub-GHz Scanner: shorten the peak readout and the hint line. Sub-GHz Spectrum:
shorten the centre/span header and show only peak dBm on the right so the two
no longer overlap. GATT Server: put the service state on its own line (was
overlapping the title), shorten "Serial GATT service (RX/TX)", and cap the
last-received text so none of it exceeds 128 px.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEaD4ZeAfvWLBUxXp8G11r
This commit is contained in:
2026-09-10 23:48:11 +01:00
co-authored by Claude Fable 5.1
parent 02f799cf9c
commit 99d65f674d
3 changed files with 13 additions and 15 deletions
+9 -9
View File
@@ -65,20 +65,20 @@ static void draw_cb(Canvas* c, void* ctx) {
canvas_set_font(c, FontPrimary);
canvas_draw_str(c, 2, 9, "GATT Server");
canvas_set_font(c, FontSecondary);
canvas_draw_line(c, 0, 11, 127, 11);
const char* st = app->status == BtStatusConnected ? "connected" :
app->status == BtStatusAdvertising ? "advertising" :
app->status == BtStatusOff ? "off" :
"unavailable";
canvas_draw_str_aligned(c, 126, 9, AlignRight, AlignBottom, st);
canvas_draw_line(c, 0, 11, 127, 11);
canvas_draw_str(c, 2, 22, "Serial GATT service (RX/TX)");
snprintf(buf, sizeof(buf), "RX %lu B TX %lu B", (unsigned long)app->rx_bytes, (unsigned long)app->tx_bytes);
canvas_draw_str(c, 2, 34, buf);
snprintf(buf, sizeof(buf), "Echo: %s (OK toggles)", app->echo ? "on" : "off");
canvas_draw_str(c, 2, 45, buf);
snprintf(buf, sizeof(buf), "Serial: %s", st);
canvas_draw_str(c, 2, 22, buf);
snprintf(buf, sizeof(buf), "RX %lu B TX %lu B", (unsigned long)app->rx_bytes, (unsigned long)app->tx_bytes);
canvas_draw_str(c, 2, 33, buf);
snprintf(buf, sizeof(buf), "Echo %s OK=toggle", app->echo ? "on" : "off");
canvas_draw_str(c, 2, 44, buf);
if(app->last[0]) {
snprintf(buf, sizeof(buf), "last: %s", app->last);
canvas_draw_str(c, 2, 57, buf);
snprintf(buf, sizeof(buf), "last: %.14s", app->last);
canvas_draw_str(c, 2, 58, buf);
}
furi_mutex_release(app->mutex);
}
+2 -2
View File
@@ -146,7 +146,7 @@ static void draw_cb(Canvas* c, void* ctx) {
(unsigned long)(m->range_end / 1000 % 1000));
canvas_draw_str(c, 2, 20, buf);
snprintf(
buf, sizeof(buf), "peak %lu.%03lu MHz %d dBm", (unsigned long)(m->peak_freq / 1000000),
buf, sizeof(buf), "pk %lu.%03luM %ddBm", (unsigned long)(m->peak_freq / 1000000),
(unsigned long)(m->peak_freq / 1000 % 1000), (int)m->peak_rssi);
canvas_draw_str(c, 2, 29, buf);
@@ -159,7 +159,7 @@ static void draw_cb(Canvas* c, void* ctx) {
int h = (int)((r + 110) / 70.0f * gh);
canvas_draw_line(c, i, gy + gh - h, i, gy + gh);
}
canvas_draw_str(c, 2, 63, "OK pause <>band Back exit");
canvas_draw_str(c, 2, 63, "OK:pause <>:band");
furi_mutex_release(app->mutex);
}
+2 -4
View File
@@ -95,12 +95,10 @@ static void draw_cb(Canvas* c, void* ctx) {
canvas_clear(c);
canvas_set_font(c, FontSecondary);
snprintf(
buf, sizeof(buf), "%lu.%03lu MHz +-%lu kHz", (unsigned long)(m->center / 1000000),
buf, sizeof(buf), "%lu.%03lu +-%luk", (unsigned long)(m->center / 1000000),
(unsigned long)(m->center / 1000 % 1000), (unsigned long)(m->span / 2000));
canvas_draw_str(c, 1, 8, buf);
snprintf(
buf, sizeof(buf), "pk %lu.%03lu %d", (unsigned long)(m->peak_freq / 1000000),
(unsigned long)(m->peak_freq / 1000 % 1000), (int)m->peak_rssi);
snprintf(buf, sizeof(buf), "%ddBm", (int)m->peak_rssi);
canvas_draw_str_aligned(c, 127, 8, AlignRight, AlignBottom, buf);
// spectrum, top band 10..30