ethersex/ethersex — pull request #105 by owagner (2012-01-12 13:59:21+00:00)
Title: - in i2c_master_stop(), the check condition for the TWSTO bit was revers...

...ed.

According to the Atmega datasheet(*), the bit is _cleared_ when the STOP condition
has been executed, however, the check waited for the TWSTO bit to be set.
As the bit was generally set when entering the loop, the loop exited immediately
and the i2c bus was disabled, often before the STOP condition was actually sent.

The mistake probably stems from the TWINT check, which works
exactly the other way round (TWINT is set on completion)

(*) Atmega 32 datasheet, page 178