Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AccelerometerThread.h #4831

Merged
merged 18 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ lib_deps =
adafruit/Adafruit SHT4x Library@^1.0.4
adafruit/Adafruit TSL2591 Library@^1.4.5
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@^1.0.5
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@^1.2.13
ClosedCube OPT3001@^1.1.2
emotibit/EmotiBit MLX90632@^1.0.8
dfrobot/DFRobot_RTU@^1.0.3
Expand All @@ -161,4 +162,4 @@ lib_deps =


https://github.com/meshtastic/DFRobot_LarkWeatherStation#dee914270dc7cb3e43fbf034edd85a63a16a12ee
https://github.com/gjelsoe/STK8xxx-Accelerometer.git#v0.1.1
https://github.com/gjelsoe/STK8xxx-Accelerometer.git#v0.1.1
319 changes: 0 additions & 319 deletions src/AccelerometerThread.h

This file was deleted.

2 changes: 2 additions & 0 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BMA423_ADDR 0x19
#define LSM6DS3_ADDR 0x6A
#define BMX160_ADDR 0x69
#define ICM20948_ADDR 0x69
#define ICM20948_ADDR_ALT 0x68

// -----------------------------------------------------------------------------
// LED
Expand Down
4 changes: 2 additions & 2 deletions src/detect/ScanI2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ ScanI2C::FoundDevice ScanI2C::firstKeyboard() const

ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const
{
ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX};
return firstOfOrNONE(6, types);
ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX, ICM20948};
return firstOfOrNONE(7, types);
}

ScanI2C::FoundDevice ScanI2C::find(ScanI2C::DeviceType) const
Expand Down
10 changes: 6 additions & 4 deletions src/detect/ScanI2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class ScanI2C
DFROBOT_LARK,
NAU7802,
FT6336U,
STK8BAXX
STK8BAXX,
ICM20948
} DeviceType;

// typedef uint8_t DeviceAddress;
Expand All @@ -67,8 +68,9 @@ class ScanI2C
} I2CPort;

typedef struct DeviceAddress {
I2CPort port;
uint8_t address;
// set default values for ADDRESS_NONE
I2CPort port = I2CPort::NO_I2C;
uint8_t address = 0;

explicit DeviceAddress(I2CPort port, uint8_t address);
DeviceAddress();
Expand Down Expand Up @@ -119,4 +121,4 @@ class ScanI2C

private:
bool shouldSuppressScreen = false;
};
};
Loading
Loading