]> git.zerfleddert.de Git - rsbs2/commitdiff
TWI inetrrupts aren't asserted when interrupts are disabled, strange...
authorMichael Gernoth <michael@gernoth.net>
Mon, 23 Aug 2010 16:46:58 +0000 (18:46 +0200)
committerMichael Gernoth <michael@gernoth.net>
Mon, 23 Aug 2010 16:46:58 +0000 (18:46 +0200)
bmc/i2c.c

index f0816f0021cefb1e6a514508e9ec169e501455de..d7bb95136d3a2bd34f0ae79b22f3f53e09840dea 100644 (file)
--- a/bmc/i2c.c
+++ b/bmc/i2c.c
@@ -78,10 +78,9 @@ out2:
        TWCR = ((1<<TWINT) | (1<<TWEN) | (1<<TWSTO));
        while(TWCR & (1<<TWSTO)) {}
 
-       TWCR = (1<<TWINT) | (1<<TWEN);
 out:   
-       TWCR = old_TWCR;
        SREG = old_SREG;
+       TWCR = old_TWCR | (1<<TWINT);
 }
 
 ISR (TWI_vect, ISR_BLOCK)
Impressum, Datenschutz