Tiny changes
0.14.0-b1.14 - 2301080
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// force the compiler to show a warning to confirm that this file is included
|
||||
#warning **** Included USERMOD_BH1750 ****
|
||||
// force the compiler to show a warning to confirm that this file is included WLEDMM: commented this warning as we want serious warnings ;-)
|
||||
// #warning **** Included USERMOD_BH1750 ****
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// force the compiler to show a warning to confirm that this file is included
|
||||
#warning **** Included USERMOD_BME280 version 2.0 ****
|
||||
// force the compiler to show a warning to confirm that this file is included WLEDMM: commented this warning as we want serious warnings ;-)
|
||||
// #warning **** Included USERMOD_BME280 version 2.0 ****
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -119,13 +119,10 @@ class MPU6050Driver : public Usermod {
|
||||
void setup() {
|
||||
// WLEDMM begin
|
||||
USER_PRINTLN(F("mpu setup"));
|
||||
int8_t hw_scl = i2c_scl;
|
||||
int8_t hw_sda = i2c_sda;
|
||||
|
||||
PinManagerPinType pins[2] = { { hw_scl, true }, { hw_sda, true } };
|
||||
if ((hw_scl < 0) || (hw_sda < 0)) {
|
||||
PinManagerPinType pins[2] = { { i2c_scl, true }, { i2c_sda, true } };
|
||||
if ((i2c_scl < 0) || (i2c_sda < 0)) {
|
||||
//enabled = false;
|
||||
USER_PRINTF("mpu6050: warning - ivalid I2C pins: sda=%d scl=%d\n", hw_sda, hw_scl);
|
||||
USER_PRINTF("mpu6050: warning - ivalid I2C pins: sda=%d scl=%d\n", i2c_sda, i2c_scl);
|
||||
//return;
|
||||
}
|
||||
|
||||
@@ -133,7 +130,7 @@ class MPU6050Driver : public Usermod {
|
||||
|
||||
if (!pinManager.allocateMultiplePins(pins, 2, PinOwner::HW_I2C)) {
|
||||
enabled = false;
|
||||
USER_PRINTF("mpu6050: failed to allocate I2C sda=%d scl=%d\n", hw_sda, hw_scl);
|
||||
USER_PRINTF("mpu6050: failed to allocate I2C sda=%d scl=%d\n", i2c_sda, i2c_scl);
|
||||
return;
|
||||
}
|
||||
// WLEDMM end
|
||||
|
||||
@@ -1186,9 +1186,7 @@ class FourLineDisplayUsermod : public Usermod {
|
||||
bool isHW = (oldPin[0]==spi_sclk && oldPin[1]==spi_mosi);
|
||||
if (isHW) po = PinOwner::HW_SPI;
|
||||
} else {
|
||||
uint8_t hw_scl = i2c_scl;
|
||||
uint8_t hw_sda = i2c_sda;
|
||||
bool isHW = (oldPin[0]==hw_scl && oldPin[1]==hw_sda);
|
||||
bool isHW = (oldPin[0]==i2c_scl && oldPin[1]==i2c_sda);
|
||||
if (isHW) po = PinOwner::HW_I2C;
|
||||
}
|
||||
pinManager.deallocateMultiplePins((const uint8_t *)oldPin, 2, po);
|
||||
|
||||
Reference in New Issue
Block a user