twsi: fix handling of consecuitve write messages in transaction

Make sure to reset 'message_done' flag when jumping from a message to the
next one within the same interrupt handler call.  This happens only when
a write with no-stop flag message is followed by a write with no-start
flag message.
Without this fix the second message would be prematurely "completed"
without waiting for an ACK (or NACK) for its first byte and without
sending subsequent bytes (if any).

Fixes:		ff1e8581 twsi: support more message combinations in transfers
MFC after:	4 days
This commit is contained in:
Andriy Gapon 2021-12-19 11:26:40 +02:00
parent 9a8cf950b2
commit e5268c3d43

View File

@ -563,7 +563,6 @@ twsi_intr(void *arg)
bool send_start;
sc = arg;
message_done = false;
send_start = false;
mtx_lock(&sc->mutex);
@ -582,6 +581,8 @@ twsi_intr(void *arg)
}
restart:
message_done = false;
switch (status) {
case TWSI_STATUS_START:
case TWSI_STATUS_RPTD_START: