Added "Hops away" on display (#3934)

* Added "Hops away" on display

Added in logic that displays "hops away" instead of signal strength when the node is more than 0 hops away.

* Added comment

* Update extensions.json to same as master

* attempt 2 at reverting extensions JSON

* Attempt 3 at getting extensions right

* Take 4. should be reverting to before my edits

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
capslockapocalypse 2024-05-24 23:08:21 +10:00 committed by GitHub
parent 9a38a4b024
commit 2233507667
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1459,7 +1459,18 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
const char *username = node->has_user ? node->user.long_name : "Unknown Name"; const char *username = node->has_user ? node->user.long_name : "Unknown Name";
static char signalStr[20]; static char signalStr[20];
snprintf(signalStr, sizeof(signalStr), "Signal: %d%%", clamp((int)((node->snr + 10) * 5), 0, 100));
//section here to choose whether to display hops away rather than signal strength if more than 0 hops away.
if(node->hops_away>0)
{
snprintf(signalStr, sizeof(signalStr), "Hops Away: %d", node->hops_away);
}
else
{
snprintf(signalStr, sizeof(signalStr), "Signal: %d%%", clamp((int)((node->snr + 10) * 5), 0, 100));
}
uint32_t agoSecs = sinceLastSeen(node); uint32_t agoSecs = sinceLastSeen(node);
static char lastStr[20]; static char lastStr[20];