mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-02 05:20:59 +02:00
I2c reset functionality (#678)
* Addition of a i2cReset method and timeout handling for the case where the i2c hardware FSM (state machine) gets stuck in a busy state. * Use newly added i2cReset function within the wire library.
This commit is contained in:
@ -211,4 +211,11 @@ void TwoWire::flush(void)
|
||||
txLength = 0;
|
||||
}
|
||||
|
||||
void TwoWire::reset(void)
|
||||
{
|
||||
i2cReset( i2c );
|
||||
i2c = NULL;
|
||||
begin( sda, scl );
|
||||
}
|
||||
|
||||
TwoWire Wire = TwoWire(0);
|
||||
|
@ -72,6 +72,8 @@ public:
|
||||
int peek(void);
|
||||
void flush(void);
|
||||
|
||||
void reset(void);
|
||||
|
||||
inline size_t write(const char * s)
|
||||
{
|
||||
return write((uint8_t*) s, strlen(s));
|
||||
|
Reference in New Issue
Block a user