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
Changes from 1 commit
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
Next Next commit
Initial upload
dhskinner committed Sep 23, 2024
commit 5002139635d336f3c7cf0242582a96322c8bfffd
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
@@ -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
4 changes: 2 additions & 2 deletions src/detect/ScanI2C.cpp
Original file line number Diff line number Diff line change
@@ -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
10 changes: 6 additions & 4 deletions src/detect/ScanI2C.h
Original file line number Diff line number Diff line change
@@ -56,7 +56,8 @@ class ScanI2C
DFROBOT_LARK,
NAU7802,
FT6336U,
STK8BAXX
STK8BAXX,
ICM20948
} DeviceType;

// typedef uint8_t DeviceAddress;
@@ -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();
@@ -119,4 +121,4 @@ class ScanI2C

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