feat(nav): standalone Compass in Tools

Tools › Compass shows the device's course over ground (from the GPS COG
ring — no magnetometer) as a rotating arrow in a ring with a north tick,
plus a large degrees + cardinal readout. "No GPS fix" without a fix;
"move to set heading" when stationary (course undefined). Reuses
UITask::currentCourse, so it works without recording a trail.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-03 14:07:53 +02:00
co-authored by Claude Opus 4.8
parent ed984e437b
commit 8bf050ddb4
4 changed files with 118 additions and 2 deletions
@@ -118,6 +118,7 @@ static const int QUICK_MSGS_MAX = 10;
#include "DashboardConfigScreen.h"
#include "AutoAdvertScreen.h"
#include "TrailScreen.h"
#include "CompassScreen.h"
#include "ToolsScreen.h"
#ifndef BATT_MIN_MILLIVOLTS
@@ -1189,6 +1190,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
dashboard_config = new DashboardConfigScreen(this, node_prefs);
auto_advert_screen = new AutoAdvertScreen(this, node_prefs);
trail_screen = new TrailScreen(this, &_trail);
compass_screen = new CompassScreen(this);
applyBrightness();
applyFont();
applyRotation();
@@ -1230,6 +1232,11 @@ void UITask::gotoTrailScreen() {
setCurrScreen(trail_screen);
}
void UITask::gotoCompassScreen() {
((CompassScreen*)compass_screen)->enter();
setCurrScreen(compass_screen);
}
void UITask::gotoAutoAdvertScreen() {
((AutoAdvertScreen*)auto_advert_screen)->enter();
setCurrScreen(auto_advert_screen);