mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-10 21:19:07 +00:00
fix functions that were defined outside of RAK4631 to build on other variants
This commit is contained in:
parent
459bf65648
commit
962ca6d524
@ -31,6 +31,29 @@ ScanI2C::I2CPort MotionSensor::devicePort()
|
|||||||
return device.address.port;
|
return device.address.port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_POWER_FSM
|
||||||
|
void MotionSensor::wakeScreen()
|
||||||
|
{
|
||||||
|
if (powerFSM.getState() == &stateDARK) {
|
||||||
|
LOG_DEBUG("Motion wakeScreen detected");
|
||||||
|
powerFSM.trigger(EVENT_INPUT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MotionSensor::buttonPress()
|
||||||
|
{
|
||||||
|
LOG_DEBUG("Motion buttonPress detected");
|
||||||
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void MotionSensor::wakeScreen() {}
|
||||||
|
|
||||||
|
void MotionSensor::buttonPress() {}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN
|
#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN
|
||||||
void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
@ -86,30 +109,6 @@ void MotionSensor::drawFrameGyroCalibration(OLEDDisplay *display, OLEDDisplayUiS
|
|||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
display->drawString(x, y + 40, timeRemainingBuffer);
|
display->drawString(x, y + 40, timeRemainingBuffer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_POWER_FSM
|
|
||||||
void MotionSensor::wakeScreen()
|
|
||||||
{
|
|
||||||
if (powerFSM.getState() == &stateDARK) {
|
|
||||||
LOG_DEBUG("Motion wakeScreen detected");
|
|
||||||
powerFSM.trigger(EVENT_INPUT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MotionSensor::buttonPress()
|
|
||||||
{
|
|
||||||
LOG_DEBUG("Motion buttonPress detected");
|
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
void MotionSensor::wakeScreen() {}
|
|
||||||
|
|
||||||
void MotionSensor::buttonPress() {}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void MotionSensor::getMagCalibrationData(float x, float y, float z)
|
void MotionSensor::getMagCalibrationData(float x, float y, float z)
|
||||||
{
|
{
|
||||||
@ -336,4 +335,6 @@ void MotionSensor::saveState()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -73,13 +73,6 @@ class MotionSensor
|
|||||||
// Register a button press when a double-tap is detected
|
// Register a button press when a double-tap is detected
|
||||||
virtual void buttonPress();
|
virtual void buttonPress();
|
||||||
|
|
||||||
#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN
|
|
||||||
// draw an OLED frame (currently only used by the RAK4631 BMX160 sensor)
|
|
||||||
static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
|
||||||
static void drawFrameGyroWarning(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
|
||||||
static void drawFrameGyroCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ScanI2C::FoundDevice device;
|
ScanI2C::FoundDevice device;
|
||||||
|
|
||||||
SensorConfig sensorConfig;
|
SensorConfig sensorConfig;
|
||||||
@ -96,14 +89,21 @@ class MotionSensor
|
|||||||
minMaxXYZ magCalibrationMinMax;
|
minMaxXYZ magCalibrationMinMax;
|
||||||
uint16_t calibrationCount = 0;
|
uint16_t calibrationCount = 0;
|
||||||
|
|
||||||
|
const char *configFileName = "/prefs/motionSensor.dat";
|
||||||
|
uint8_t sensorState[MAX_STATE_BLOB_SIZE] = {0};
|
||||||
|
|
||||||
|
#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN
|
||||||
|
// draw an OLED frame (currently only used by the RAK4631 BMX160 sensor)
|
||||||
|
static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
|
static void drawFrameGyroWarning(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
|
static void drawFrameGyroCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
|
|
||||||
void getMagCalibrationData(float x, float y, float z);
|
void getMagCalibrationData(float x, float y, float z);
|
||||||
void gyroCalibrationWarning();
|
void gyroCalibrationWarning();
|
||||||
void getGyroCalibrationData(float g_x, float g_y, float g_z, float a_x, float a_y, float a_z);
|
void getGyroCalibrationData(float g_x, float g_y, float g_z, float a_x, float a_y, float a_z);
|
||||||
|
|
||||||
const char *configFileName = "/prefs/motionSensor.dat";
|
|
||||||
uint8_t sensorState[MAX_STATE_BLOB_SIZE] = {0};
|
|
||||||
void loadState();
|
void loadState();
|
||||||
void saveState();
|
void saveState();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace MotionSensorI2C
|
namespace MotionSensorI2C
|
||||||
|
Loading…
Reference in New Issue
Block a user