Added PAJ7620U2 defs, set mag for ICM20948 temp
This commit is contained in:
@@ -44,7 +44,7 @@ class IMU : public SensorBase<IMUAnglesMsg> {
|
||||
#if USE_ICM20948_SPIMODE > 0
|
||||
_imu.begin(CS_PIN, SPI_PORT);
|
||||
#else
|
||||
_imu.begin(Wire, 1);
|
||||
_imu.begin(Wire, 1, 0xFF);
|
||||
#endif
|
||||
if (_imu.status != ICM_20948_Stat_Ok){ return false; }
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
|
||||
#if FT_ENABLED(USE_MPU6050 || USE_BNO055 || USE_ICM20948)
|
||||
IMU _imu;
|
||||
#endif
|
||||
#if FT_ENABLED(USE_HMC5883 || USE_ICM20948)
|
||||
#if FT_ENABLED(USE_HMC5883) // TODO: Add USE_ICM20948
|
||||
Magnetometer _mag;
|
||||
#endif
|
||||
#if FT_ENABLED(USE_BMP180)
|
||||
|
||||
@@ -16,6 +16,8 @@ void printFeatureConfiguration() {
|
||||
ESP_LOGI("Features", "USE_HMC5883: %s", USE_HMC5883 ? "enabled" : "disabled");
|
||||
ESP_LOGI("Features", "USE_BMP180: %s", USE_BMP180 ? "enabled" : "disabled");
|
||||
ESP_LOGI("Features", "USE_USS: %s", USE_USS ? "enabled" : "disabled");
|
||||
ESP_LOGI("Features", "USE_PAJ7620U2: %s", USE_PAJ7620U2 ? "enabled" : "disabled");
|
||||
|
||||
|
||||
ESP_LOGI("Features", "USE_PCA9685: %s", USE_PCA9685 ? "enabled" : "disabled");
|
||||
ESP_LOGI("Features", "USE_WS2812: %s", USE_WS2812 ? "enabled" : "disabled");
|
||||
|
||||
@@ -19,7 +19,7 @@ void Peripherals::begin() {
|
||||
#if FT_ENABLED(USE_MPU6050 || USE_BNO055 || USE_ICM20948)
|
||||
if (!_imu.initialize()) ESP_LOGE("IMUService", "IMU initialize failed");
|
||||
#endif
|
||||
#if FT_ENABLED(USE_HMC5883 || USE_ICM20948)
|
||||
#if FT_ENABLED(USE_HMC5883) // TODO: Add USE_ICM20948
|
||||
if (!_mag.initialize()) ESP_LOGE("IMUService", "MAG initialize failed");
|
||||
#endif
|
||||
#if FT_ENABLED(USE_BMP180)
|
||||
@@ -111,7 +111,7 @@ bool Peripherals::readImu() {
|
||||
|
||||
bool Peripherals::readMag() {
|
||||
bool updated = false;
|
||||
#if FT_ENABLED(USE_HMC5883)
|
||||
#if FT_ENABLED(USE_HMC5883) // TODO: Add USE_ICM20948
|
||||
beginTransaction();
|
||||
updated = _mag.update();
|
||||
endTransaction();
|
||||
|
||||
Reference in New Issue
Block a user