Fast flight preparing and reboot on failed initialization

This commit is contained in:
2024-03-13 22:37:48 +07:00
parent e27b3ca794
commit 839dbee16e
11 changed files with 27 additions and 22 deletions

View File

@@ -9,13 +9,13 @@
class BoardI2C : public TwoWire {
public:
BoardI2C(volatile bool loop_on_fail = true) : TwoWire(0) {
BoardI2C() : TwoWire(0) {
if (begin(I2C_SDA_PIN, I2C_SCL_PIN, 100000)) {
setTimeOut(10);
ESP_LOGI("I2CBus", "Bus initialized");
} else {
ESP_LOGE("I2CBus", "Failed to initialize the i2c software bus!");
while (loop_on_fail);
assert(false);
}
}
};