Commit 5949cef9 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

MSP430 I2C: Enable interrupts for RX mode

parent 9eb10668
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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;
		}