Fixed frequency of I2C to work with servo controller
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
#define SCL_PIN SCL
|
#define SCL_PIN SCL
|
||||||
#endif
|
#endif
|
||||||
#ifndef I2C_FREQUENCY
|
#ifndef I2C_FREQUENCY
|
||||||
#define I2C_FREQUENCY 1000000UL
|
#define I2C_FREQUENCY 400000UL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class PinConfig {
|
class PinConfig {
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ void Peripherals::updatePins() {
|
|||||||
|
|
||||||
if (state().sda != -1 && state().scl != -1) {
|
if (state().sda != -1 && state().scl != -1) {
|
||||||
Wire.begin(state().sda, state().scl, state().frequency);
|
Wire.begin(state().sda, state().scl, state().frequency);
|
||||||
|
ESP_LOGI("Peripherals", "Starting Wire with SDA=%d, SCL=%d, FREQ=%d", state().sda, state().scl, state().frequency);
|
||||||
i2c_active = true;
|
i2c_active = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user