File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ void TwoWire::begin(uint8_t addr) {
126
126
i2c_set_slave_mode (_i2c, true , addr);
127
127
128
128
// Our callback IRQ
129
- _i2c->hw ->intr_mask = (1 << 10 ) | (1 << 9 ) | (1 << 6 ) | (1 << 5 ) | (1 << 2 );
129
+ _i2c->hw ->intr_mask = (1 << 12 ) | ( 1 << 10 ) | (1 << 9 ) | (1 << 6 ) | (1 << 5 ) | (1 << 2 );
130
130
131
131
int irqNo = I2C0_IRQ + i2c_hw_index (_i2c);
132
132
irq_set_exclusive_handler (irqNo, i2c_hw_index (_i2c) == 0 ? _handler0 : _handler1);
@@ -142,6 +142,15 @@ void TwoWire::begin(uint8_t addr) {
142
142
}
143
143
144
144
void TwoWire::onIRQ () {
145
+ if (_i2c->hw ->intr_stat & (1 << 12 )) {
146
+ if (_onReceiveCallback && _buffLen) {
147
+ _onReceiveCallback (_buffLen);
148
+ }
149
+ _buffLen = 0 ;
150
+ _buffOff = 0 ;
151
+ _slaveStartDet = false ;
152
+ _i2c->hw ->clr_restart_det ;
153
+ }
145
154
if (_i2c->hw ->intr_stat & (1 << 10 )) {
146
155
_buffLen = 0 ;
147
156
_buffOff = 0 ;
You can’t perform that action at this time.
0 commit comments