mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
Fix I2C recovery ESP32 esp-idf (#2438)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
This commit is contained in:
@@ -9,6 +9,12 @@
|
||||
namespace esphome {
|
||||
namespace i2c {
|
||||
|
||||
enum RecoveryCode {
|
||||
RECOVERY_FAILED_SCL_LOW,
|
||||
RECOVERY_FAILED_SDA_LOW,
|
||||
RECOVERY_COMPLETED,
|
||||
};
|
||||
|
||||
class IDFI2CBus : public I2CBus, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
@@ -26,6 +32,7 @@ class IDFI2CBus : public I2CBus, public Component {
|
||||
|
||||
private:
|
||||
void recover_();
|
||||
RecoveryCode recovery_result_;
|
||||
|
||||
protected:
|
||||
i2c_port_t port_;
|
||||
|
||||
Reference in New Issue
Block a user