Like UART the current I2C mechanism returns control to the caller while the peripheral completes a transfer (for UART the actual TX; for I2C both the TX and the STP). For UART this isn't a concern as vBSP430serialFlush_ni() can be called to wait for completion; for I2C the flush mechanism does not check for pending STP, and in the case of bus errors the STP would not be transmitted.
Refactor the provided I2C single-master protocol to hold up the return until the STP has been transmitted.
Like UART the current I2C mechanism returns control to the caller while the peripheral completes a transfer (for UART the actual TX; for I2C both the TX and the STP). For UART this isn't a concern as vBSP430serialFlush_ni() can be called to wait for completion; for I2C the flush mechanism does not check for pending STP, and in the case of bus errors the STP would not be transmitted.
Refactor the provided I2C single-master protocol to hold up the return until the STP has been transmitted.