tp-freeforall / prod

TinyOS (less academic, more industrial, rD, less filling), still a floor wax
BSD 3-Clause "New" or "Revised" License
82 stars 37 forks source link

Fixed a bug in the MSP430 I2C driver #26

Closed azeey closed 3 years ago

azeey commented 10 years ago

If the CPU is slow or running in debug mode, the timing works out in such a way that the interrupt for the very last byte doesn't trigger. This seems to happen because setTxStop is called right before the last byte which causes the hardware to proceed with receiving the last byte instead of waiting until the one-before-last byte is read from the RX buffer. The interrupt flag actually gets set, but the CPU doesn't get interrupted. Thus, we can check the flag and read the last byte, if it's available.

cire831 commented 3 years ago

oops. looks like the code didn't get in. not sure why. I'll take care of it. reopening until I fix it.