Skip to content

Commit 3812fb3

Browse files
committed
fix(i2c): transmission freezes
We forgot to look at the command FIFO in `completeStop()`. This cause the transmission to freeze if the sequence of I2C commands contained a STOP in the middle.
1 parent de57f35 commit 3812fb3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/peripherals/i2c.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,11 @@ export class RPI2C extends BasePeripheral implements Peripheral {
317317
this.setInterrupts(R_STOP_DET);
318318
this.busy = false;
319319
this.pendingRestart = false;
320-
this.enable &= ~ABORT; // Clean the abort bit, in case user aborted
320+
if (this.enable & ABORT) {
321+
this.enable &= ~ABORT;
322+
} else {
323+
this.nextCommand();
324+
}
321325
}
322326

323327
arbitrationLost() {

0 commit comments

Comments
 (0)