mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-14 14:31:24 +00:00
Fix build on RAK4631_eth_gw
- exclude all compass heading updates on variant without screen
This commit is contained in:
parent
8db96c17ea
commit
686f569540
@ -25,6 +25,7 @@ bool BMX160Sensor::init()
|
|||||||
|
|
||||||
int32_t BMX160Sensor::runOnce()
|
int32_t BMX160Sensor::runOnce()
|
||||||
{
|
{
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
||||||
sBmx160SensorData_t magAccel;
|
sBmx160SensorData_t magAccel;
|
||||||
sBmx160SensorData_t gAccel;
|
sBmx160SensorData_t gAccel;
|
||||||
|
|
||||||
@ -33,13 +34,11 @@ int32_t BMX160Sensor::runOnce()
|
|||||||
|
|
||||||
if (doCalibration) {
|
if (doCalibration) {
|
||||||
|
|
||||||
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
|
||||||
if (!showingScreen) {
|
if (!showingScreen) {
|
||||||
powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration
|
powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration
|
||||||
showingScreen = true;
|
showingScreen = true;
|
||||||
screen->startAlert((FrameCallback)drawFrameCalibration);
|
screen->startAlert((FrameCallback)drawFrameCalibration);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (magAccel.x > highestX)
|
if (magAccel.x > highestX)
|
||||||
highestX = magAccel.x;
|
highestX = magAccel.x;
|
||||||
@ -66,7 +65,6 @@ int32_t BMX160Sensor::runOnce()
|
|||||||
// lowestY, highestY, lowestZ, highestZ);
|
// lowestY, highestY, lowestZ, highestZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
|
||||||
int highestRealX = highestX - (highestX + lowestX) / 2;
|
int highestRealX = highestX - (highestX + lowestX) / 2;
|
||||||
|
|
||||||
magAccel.x -= (highestX + lowestX) / 2;
|
magAccel.x -= (highestX + lowestX) / 2;
|
||||||
@ -114,13 +112,12 @@ int32_t BMX160Sensor::runOnce()
|
|||||||
|
|
||||||
void BMX160Sensor::calibrate(uint16_t forSeconds)
|
void BMX160Sensor::calibrate(uint16_t forSeconds)
|
||||||
{
|
{
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
||||||
LOG_DEBUG("BMX160 calibration started for %is", forSeconds);
|
LOG_DEBUG("BMX160 calibration started for %is", forSeconds);
|
||||||
|
|
||||||
doCalibration = true;
|
doCalibration = true;
|
||||||
uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided
|
uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided
|
||||||
endCalibrationAt = millis() + calibrateFor;
|
endCalibrationAt = millis() + calibrateFor;
|
||||||
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
|
||||||
screen->setEndCalibration(endCalibrationAt);
|
screen->setEndCalibration(endCalibrationAt);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user