Skip to content
Snippets Groups Projects
Commit 5949cef9 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

MSP430 I2C: Enable interrupts for RX mode

parent 9eb10668
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,13 @@ signed char I2C::xmit(unsigned char address,
for (i = 0; i < rx_len; i++) {
if (i == rx_len - 1)
UCB0CTL1 |= UCTXSTP;
while (!(UCB0IFG & (UCRXIFG0 | UCNACKIFG | UCCLTOIFG)));
UCB0IFG = 0;
old_ifg = 0;
UCB0IE = UCRXIE | UCNACKIE | UCCLTOIE;
while (!(old_ifg & (UCRXIFG0 | UCNACKIFG | UCCLTOIFG))) {
arch.idle();
}
UCB0IE = 0;
rx_buf[i] = UCB0RXBUF;
UCB0IFG &= ~UCRXIFG0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment