We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c85a1c commit c4623f4Copy full SHA for c4623f4
libraries/Wire/src/Wire.cpp
@@ -132,7 +132,6 @@ void TwoWire::begin(uint8_t addr) {
132
irq_set_exclusive_handler(irqNo, i2c_hw_index(_i2c) == 0 ? _handler0 : _handler1);
133
irq_set_enabled(irqNo, true);
134
135
-
136
gpio_set_function(_sda, GPIO_FUNC_I2C);
137
gpio_pull_up(_sda);
138
gpio_set_function(_scl, GPIO_FUNC_I2C);
@@ -192,7 +191,15 @@ void TwoWire::end() {
192
191
// ERROR
193
return;
194
}
+
195
+ if (_slave) {
196
+ int irqNo = I2C0_IRQ + i2c_hw_index(_i2c);
197
+ irq_remove_handler(irqNo, i2c_hw_index(_i2c) == 0 ? _handler0 : _handler1);
198
+ irq_set_enabled(irqNo, false);
199
+ }
200
201
i2c_deinit(_i2c);
202
203
pinMode(_sda, INPUT);
204
pinMode(_scl, INPUT);
205
_running = false;
0 commit comments