mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-22 03:02:08 +10:00
Compass improvements/refactoring (#10166)
* Infinite calibration loop fix * Save calibration * Screen refresh * reduce repeated code * reduce repeated code to reduce flash * fix Waypoint compass size and no fix no heading labels * Don't show compass unless we have a heading and location * If no calculated heading from moving, we should have no heading * Slow walking calculated heading and auto stale heading when not moving * Triming flash space * cleanup * show "?" when no location or heading for distance and heading screen * cleanup * Stale heading logic * final trim * Compass Calibration screen redesign * Trunk Fix * Compile fix * patch * Update src/motion/MotionSensor.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update WaypointModule.cpp --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
Ben Meadors
co-authored by
Copilot
parent
747fc01669
commit
7ddecd1dd7
@@ -2,7 +2,7 @@
|
||||
#ifndef _MOTION_SENSOR_H_
|
||||
#define _MOTION_SENSOR_H_
|
||||
|
||||
#define MOTION_SENSOR_CHECK_INTERVAL_MS 100
|
||||
#define MOTION_SENSOR_CHECK_INTERVAL_MS 50
|
||||
#define MOTION_SENSOR_CLICK_THRESHOLD 40
|
||||
|
||||
#include "../configuration.h"
|
||||
@@ -54,6 +54,20 @@ class MotionSensor
|
||||
static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||
#endif
|
||||
|
||||
bool saveMagnetometerCalibration(const char *filePath, float highestX, float lowestX, float highestY, float lowestY,
|
||||
float highestZ, float lowestZ);
|
||||
bool loadMagnetometerCalibration(const char *filePath, float &highestX, float &lowestX, float &highestY, float &lowestY,
|
||||
float &highestZ, float &lowestZ);
|
||||
void beginCalibrationDisplay(bool &showingScreen);
|
||||
void finishCalibrationIfExpired(bool &showingScreen, const char *filePath, float highestX, float lowestX, float highestY,
|
||||
float lowestY, float highestZ, float lowestZ);
|
||||
void startCalibrationWindow(uint16_t forSeconds);
|
||||
static void seedCalibrationExtrema(float x, float y, float z, float &highestX, float &lowestX, float &highestY,
|
||||
float &lowestY, float &highestZ, float &lowestZ);
|
||||
static void updateCalibrationExtrema(float x, float y, float z, float &highestX, float &lowestX, float &highestY,
|
||||
float &lowestY, float &highestZ, float &lowestZ);
|
||||
static float applyCompassOrientation(float heading);
|
||||
|
||||
ScanI2C::FoundDevice device;
|
||||
|
||||
// Do calibration if true
|
||||
@@ -63,4 +77,4 @@ class MotionSensor
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user