mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-07 15:12:45 +00:00
Compare commits
4 Commits
b657ba1abb
...
981ecfdb61
Author | SHA1 | Date | |
---|---|---|---|
![]() |
981ecfdb61 | ||
![]() |
ca9bf6b31a | ||
![]() |
ff2a12d579 | ||
![]() |
3a6fc668d8 |
@ -122,7 +122,7 @@ lib_deps =
|
|||||||
# renovate: datasource=custom.pio depName=Adafruit BMP085 packageName=adafruit/library/Adafruit BMP085 Library
|
# renovate: datasource=custom.pio depName=Adafruit BMP085 packageName=adafruit/library/Adafruit BMP085 Library
|
||||||
adafruit/Adafruit BMP085 Library@1.2.4
|
adafruit/Adafruit BMP085 Library@1.2.4
|
||||||
# renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library
|
# renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library
|
||||||
adafruit/Adafruit BME280 Library@2.2.4
|
adafruit/Adafruit BME280 Library@2.3.0
|
||||||
# renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310
|
# renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310
|
||||||
adafruit/Adafruit DPS310@1.1.5
|
adafruit/Adafruit DPS310@1.1.5
|
||||||
# renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library
|
# renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library
|
||||||
@ -161,6 +161,8 @@ lib_deps =
|
|||||||
robtillaart/INA226@0.6.4
|
robtillaart/INA226@0.6.4
|
||||||
# renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library
|
# renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library
|
||||||
sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2
|
sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2
|
||||||
|
# renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library
|
||||||
|
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2
|
||||||
|
|
||||||
; (not included in native / portduino)
|
; (not included in native / portduino)
|
||||||
[environmental_extra]
|
[environmental_extra]
|
||||||
@ -181,8 +183,6 @@ lib_deps =
|
|||||||
adafruit/Adafruit SHT4x Library@1.0.5
|
adafruit/Adafruit SHT4x Library@1.0.5
|
||||||
# renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library
|
# renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library
|
||||||
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
||||||
# renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library
|
|
||||||
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2
|
|
||||||
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
||||||
ClosedCube OPT3001@1.1.2
|
ClosedCube OPT3001@1.1.2
|
||||||
# renovate: datasource=git-refs depName=Bosch BSEC2 packageName=https://github.com/meshtastic/Bosch-BSEC2-Library gitBranch=extra_script
|
# renovate: datasource=git-refs depName=Bosch BSEC2 packageName=https://github.com/meshtastic/Bosch-BSEC2-Library gitBranch=extra_script
|
||||||
|
@ -255,7 +255,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(RAK_4631)
|
#if !MESHTASTIC_EXCLUDE_SCREEN && HAS_SCREEN
|
||||||
// 5 clicks: start accelerometer/magenetometer calibration for 30 seconds
|
// 5 clicks: start accelerometer/magenetometer calibration for 30 seconds
|
||||||
case 5:
|
case 5:
|
||||||
if (accelerometerThread) {
|
if (accelerometerThread) {
|
||||||
|
11
src/main.cpp
11
src/main.cpp
@ -105,7 +105,7 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr;
|
|||||||
#include "AmbientLightingThread.h"
|
#include "AmbientLightingThread.h"
|
||||||
#include "PowerFSMThread.h"
|
#include "PowerFSMThread.h"
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
#include "motion/AccelerometerThread.h"
|
#include "motion/AccelerometerThread.h"
|
||||||
AccelerometerThread *accelerometerThread = nullptr;
|
AccelerometerThread *accelerometerThread = nullptr;
|
||||||
#endif
|
#endif
|
||||||
@ -692,7 +692,7 @@ void setup()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
#if !defined(ARCH_STM32WL)
|
||||||
auto acc_info = i2cScanner->firstAccelerometer();
|
auto acc_info = i2cScanner->firstAccelerometer();
|
||||||
accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found;
|
accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found;
|
||||||
LOG_DEBUG("acc_info = %i", acc_info.type);
|
LOG_DEBUG("acc_info = %i", acc_info.type);
|
||||||
@ -807,7 +807,7 @@ void setup()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_I2C
|
#if !MESHTASTIC_EXCLUDE_I2C
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
#if !defined(ARCH_STM32WL)
|
||||||
if (acc_info.type != ScanI2C::DeviceType::NONE) {
|
if (acc_info.type != ScanI2C::DeviceType::NONE) {
|
||||||
accelerometerThread = new AccelerometerThread(acc_info.type);
|
accelerometerThread = new AccelerometerThread(acc_info.type);
|
||||||
}
|
}
|
||||||
@ -1300,7 +1300,12 @@ void setup()
|
|||||||
LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap());
|
LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap());
|
||||||
LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram());
|
LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram());
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(ARCH_STM32WL)
|
||||||
|
if (accelerometerThread)
|
||||||
|
accelerometerThread->calibrate(30);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
|
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
|
||||||
uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client)
|
uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client)
|
||||||
|
@ -58,7 +58,7 @@ extern UdpMulticastHandler *udpHandler;
|
|||||||
// Global Screen singleton.
|
// Global Screen singleton.
|
||||||
extern graphics::Screen *screen;
|
extern graphics::Screen *screen;
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
#include "motion/AccelerometerThread.h"
|
#include "motion/AccelerometerThread.h"
|
||||||
extern AccelerometerThread *accelerometerThread;
|
extern AccelerometerThread *accelerometerThread;
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "modules/PositionModule.h"
|
#include "modules/PositionModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
#include "motion/AccelerometerThread.h"
|
#include "motion/AccelerometerThread.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -370,9 +370,16 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha
|
|||||||
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER,
|
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER,
|
||||||
meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) &&
|
meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) &&
|
||||||
config.power.is_power_saving) {
|
config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Start next execution in 5s, then sleep");
|
meshtastic_ClientNotification *notification = clientNotificationPool.allocZeroed();
|
||||||
|
notification->level = meshtastic_LogRecord_Level_INFO;
|
||||||
|
notification->time = getValidTime(RTCQualityFromNet);
|
||||||
|
sprintf(notification->message, "Sending position and sleeping for %us interval in a moment",
|
||||||
|
Default::getConfiguredOrDefaultMs(config.position.position_broadcast_secs, default_broadcast_interval_secs) /
|
||||||
|
1000U);
|
||||||
|
service->sendClientNotification(notification);
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
LOG_DEBUG("Start next execution in 5s, then sleep");
|
||||||
|
setIntervalFromNow(FIVE_SECONDS_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,9 +675,17 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
|||||||
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
|
|
||||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Start next execution in 5s, then sleep");
|
meshtastic_ClientNotification *notification = clientNotificationPool.allocZeroed();
|
||||||
|
notification->level = meshtastic_LogRecord_Level_INFO;
|
||||||
|
notification->time = getValidTime(RTCQualityFromNet);
|
||||||
|
sprintf(notification->message, "Sending telemetry and sleeping for %us interval in a moment",
|
||||||
|
Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.environment_update_interval,
|
||||||
|
default_telemetry_broadcast_interval_secs) /
|
||||||
|
1000U);
|
||||||
|
service->sendClientNotification(notification);
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
LOG_DEBUG("Start next execution in 5s, then sleep");
|
||||||
|
setIntervalFromNow(FIVE_SECONDS_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
|
|
||||||
#include "../concurrency/OSThread.h"
|
#include "../concurrency/OSThread.h"
|
||||||
#ifdef HAS_BMA423
|
#ifdef HAS_BMA423
|
||||||
@ -81,14 +81,6 @@ class AccelerometerThread : public concurrency::OSThread
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef RAK_4631
|
|
||||||
if (!config.display.wake_on_tap_or_motion && !config.device.double_tap_as_button_press) {
|
|
||||||
LOG_DEBUG("AccelerometerThread Disable due to no interested configurations");
|
|
||||||
disable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (device.type) {
|
switch (device.type) {
|
||||||
#ifdef HAS_BMA423
|
#ifdef HAS_BMA423
|
||||||
case ScanI2C::DeviceType::BMA423:
|
case ScanI2C::DeviceType::BMA423:
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
BMX160Sensor::BMX160Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {}
|
BMX160Sensor::BMX160Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {}
|
||||||
|
|
||||||
#if defined(RAK_4631) && !defined(RAK2560) && __has_include(<Rak_BMX160.h>)
|
#if !defined(RAK2560) && __has_include(<Rak_BMX160.h>)
|
||||||
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
||||||
|
|
||||||
// screen is defined in main.cpp
|
// screen is defined in main.cpp
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
#include "ICM20948Sensor.h"
|
#include "ICM20948Sensor.h"
|
||||||
|
|
||||||
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
||||||
|
|
||||||
|
// screen is defined in main.cpp
|
||||||
|
extern graphics::Screen *screen;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Flag when an interrupt has been detected
|
// Flag when an interrupt has been detected
|
||||||
volatile static bool ICM20948_IRQ = false;
|
volatile static bool ICM20948_IRQ = false;
|
||||||
@ -41,6 +46,88 @@ int32_t ICM20948Sensor::runOnce()
|
|||||||
|
|
||||||
int32_t ICM20948Sensor::runOnce()
|
int32_t ICM20948Sensor::runOnce()
|
||||||
{
|
{
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
|
float magX = 0, magY = 0, magZ = 0;
|
||||||
|
if (sensor->dataReady()) {
|
||||||
|
sensor->getAGMT();
|
||||||
|
magX = sensor->agmt.mag.axes.x;
|
||||||
|
magY = sensor->agmt.mag.axes.y;
|
||||||
|
magZ = sensor->agmt.mag.axes.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doCalibration) {
|
||||||
|
|
||||||
|
if (!showingScreen) {
|
||||||
|
powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration
|
||||||
|
showingScreen = true;
|
||||||
|
screen->startAlert((FrameCallback)drawFrameCalibration);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (magX > highestX)
|
||||||
|
highestX = magX;
|
||||||
|
if (magX < lowestX)
|
||||||
|
lowestX = magX;
|
||||||
|
if (magY > highestY)
|
||||||
|
highestY = magY;
|
||||||
|
if (magY < lowestY)
|
||||||
|
lowestY = magY;
|
||||||
|
if (magZ > highestZ)
|
||||||
|
highestZ = magZ;
|
||||||
|
if (magZ < lowestZ)
|
||||||
|
lowestZ = magZ;
|
||||||
|
|
||||||
|
uint32_t now = millis();
|
||||||
|
if (now > endCalibrationAt) {
|
||||||
|
doCalibration = false;
|
||||||
|
endCalibrationAt = 0;
|
||||||
|
showingScreen = false;
|
||||||
|
screen->endAlert();
|
||||||
|
}
|
||||||
|
|
||||||
|
// LOG_DEBUG("ICM20948 min_x: %.4f, max_X: %.4f, min_Y: %.4f, max_Y: %.4f, min_Z: %.4f, max_Z: %.4f", lowestX, highestX,
|
||||||
|
// lowestY, highestY, lowestZ, highestZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
magX -= (highestX + lowestX) / 2;
|
||||||
|
magY -= (highestY + lowestY) / 2;
|
||||||
|
magZ -= (highestZ + lowestZ) / 2;
|
||||||
|
FusionVector ga, ma;
|
||||||
|
ga.axis.x = (sensor->agmt.acc.axes.x);
|
||||||
|
ga.axis.y = -(sensor->agmt.acc.axes.y);
|
||||||
|
ga.axis.z = -(sensor->agmt.acc.axes.z);
|
||||||
|
ma.axis.x = magX;
|
||||||
|
ma.axis.y = magY;
|
||||||
|
ma.axis.z = magZ;
|
||||||
|
|
||||||
|
// If we're set to one of the inverted positions
|
||||||
|
if (config.display.compass_orientation > meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270) {
|
||||||
|
ma = FusionAxesSwap(ma, FusionAxesAlignmentNXNYPZ);
|
||||||
|
ga = FusionAxesSwap(ga, FusionAxesAlignmentNXNYPZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
float heading = FusionCompassCalculateHeading(FusionConventionNed, ga, ma);
|
||||||
|
|
||||||
|
switch (config.display.compass_orientation) {
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0_INVERTED:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0:
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90_INVERTED:
|
||||||
|
heading += 90;
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180_INVERTED:
|
||||||
|
heading += 180;
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED:
|
||||||
|
heading += 270;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
screen->setHeading(heading);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Wake on motion using polling - this is not as efficient as using hardware interrupt pin (see above)
|
// Wake on motion using polling - this is not as efficient as using hardware interrupt pin (see above)
|
||||||
auto status = sensor->setBank(0);
|
auto status = sensor->setBank(0);
|
||||||
if (sensor->status != ICM_20948_Stat_Ok) {
|
if (sensor->status != ICM_20948_Stat_Ok) {
|
||||||
@ -64,6 +151,17 @@ int32_t ICM20948Sensor::runOnce()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void ICM20948Sensor::calibrate(uint16_t forSeconds)
|
||||||
|
{
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
|
LOG_DEBUG("BMX160 calibration started for %is", forSeconds);
|
||||||
|
|
||||||
|
doCalibration = true;
|
||||||
|
uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided
|
||||||
|
endCalibrationAt = millis() + calibrateFor;
|
||||||
|
screen->setEndCalibration(endCalibrationAt);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// ICM20948Singleton
|
// ICM20948Singleton
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
@ -121,6 +219,11 @@ bool ICM20948Singleton::init(ScanI2C::FoundDevice device)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (startupMagnetometer(false) != ICM_20948_Stat_Ok) {
|
||||||
|
LOG_DEBUG("ICM20948 init magnetometer - %s", statusString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ICM_20948_INT_PIN
|
#ifdef ICM_20948_INT_PIN
|
||||||
|
|
||||||
// Active low
|
// Active low
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
||||||
|
|
||||||
|
#include "Fusion/Fusion.h"
|
||||||
#include <ICM_20948.h>
|
#include <ICM_20948.h>
|
||||||
|
|
||||||
// Set the default gyro scale - dps250, dps500, dps1000, dps2000
|
// Set the default gyro scale - dps250, dps500, dps1000, dps2000
|
||||||
@ -80,6 +81,8 @@ class ICM20948Sensor : public MotionSensor
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
ICM20948Singleton *sensor = nullptr;
|
ICM20948Singleton *sensor = nullptr;
|
||||||
|
bool showingScreen = false;
|
||||||
|
float highestX = 0, lowestX = 0, highestY = 0, lowestY = 0, highestZ = 0, lowestZ = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ICM20948Sensor(ScanI2C::FoundDevice foundDevice);
|
explicit ICM20948Sensor(ScanI2C::FoundDevice foundDevice);
|
||||||
@ -89,6 +92,7 @@ class ICM20948Sensor : public MotionSensor
|
|||||||
|
|
||||||
// Called each time our sensor gets a chance to run
|
// Called each time our sensor gets a chance to run
|
||||||
virtual int32_t runOnce() override;
|
virtual int32_t runOnce() override;
|
||||||
|
virtual void calibrate(uint16_t forSeconds) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,7 +31,7 @@ ScanI2C::I2CPort MotionSensor::devicePort()
|
|||||||
return device.address.port;
|
return device.address.port;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_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)
|
||||||
{
|
{
|
||||||
// int x_offset = display->width() / 2;
|
// int x_offset = display->width() / 2;
|
||||||
|
@ -49,7 +49,7 @@ 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
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
// draw an OLED frame (currently only used by the RAK4631 BMX160 sensor)
|
// 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 drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
#endif
|
#endif
|
||||||
|
@ -114,8 +114,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
|||||||
|
|
||||||
#define SX126X_TXEN RADIOLIB_NC
|
#define SX126X_TXEN RADIOLIB_NC
|
||||||
|
|
||||||
#define SX126X_RXEN D4
|
#define SX126X_RXEN D5 // This is used to control the RX side of the RF switch
|
||||||
#define SX126X_DIO2_AS_RF_SWITCH // DIO2 is used to control the RF switch really necessary!!!
|
#define SX126X_DIO2_AS_RF_SWITCH // DIO2 is used to control the TX side of the RF switch
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user