RTC: PCF85063 support, port to SensorLib 0.3.1 (#8061)

* RTC: PCF85063 support, port to SensorLib 0.3.1

* Tidy up defines

* Remove RTC/PCF8563 mentions from unrelated variants

* Bump SensorLib 0.3.2

* Use SensorRtcHelper

* Consistent warning message

* Fix oversight

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
WillyJL
2025-12-21 02:10:21 +01:00
committed by GitHub
parent db64a5b51e
commit 8fdba1f1e2
38 changed files with 68 additions and 140 deletions

View File

@@ -2,16 +2,14 @@
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_BMA423) && __has_include(<SensorBMA423.hpp>)
using namespace MotionSensorI2C;
BMA423Sensor::BMA423Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {}
bool BMA423Sensor::init()
{
if (sensor.begin(deviceAddress(), &MotionSensorI2C::readRegister, &MotionSensorI2C::writeRegister)) {
if (sensor.begin(Wire, deviceAddress())) {
sensor.configAccelerometer(sensor.RANGE_2G, sensor.ODR_100HZ, sensor.BW_NORMAL_AVG4, sensor.PERF_CONTINUOUS_MODE);
sensor.enableAccelerometer();
sensor.configInterrupt(BMA4_LEVEL_TRIGGER, BMA4_ACTIVE_HIGH, BMA4_PUSH_PULL, BMA4_OUTPUT_ENABLE, BMA4_INPUT_DISABLE);
sensor.configInterrupt();
#ifdef BMA423_INT
pinMode(BMA4XX_INT, INPUT);
@@ -26,9 +24,9 @@ bool BMA423Sensor::init()
#ifdef T_WATCH_S3
// Need to raise the wrist function, need to set the correct axis
sensor.setReampAxes(sensor.REMAP_TOP_LAYER_RIGHT_CORNER);
sensor.setRemapAxes(sensor.REMAP_TOP_LAYER_RIGHT_CORNER);
#else
sensor.setReampAxes(sensor.REMAP_BOTTOM_LAYER_BOTTOM_LEFT_CORNER);
sensor.setRemapAxes(sensor.REMAP_BOTTOM_LAYER_BOTTOM_LEFT_CORNER);
#endif
// sensor.enableFeature(sensor.FEATURE_STEP_CNTR, true);
sensor.enableFeature(sensor.FEATURE_TILT, true);
@@ -50,7 +48,7 @@ bool BMA423Sensor::init()
int32_t BMA423Sensor::runOnce()
{
if (sensor.readIrqStatus() != DEV_WIRE_NONE) {
if (sensor.readIrqStatus()) {
if (sensor.isTilt() || sensor.isDoubleTap()) {
wakeScreen();
return 500;