Browse Source

Remove obsolete cbi/sbi

Yuri D'Elia 4 years ago
parent
commit
384f40956c
1 changed files with 1 additions and 10 deletions
  1. 1 10
      Firmware/twi.c

+ 1 - 10
Firmware/twi.c

@@ -22,14 +22,6 @@
 #include <math.h>
 #include "Arduino.h" // for digitalWrite
 
-#ifndef cbi
-#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
-#endif
-
-#ifndef sbi
-#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
-#endif
-
 #include "twi.h"
 
 
@@ -40,8 +32,7 @@ void twi_init(void)
   digitalWrite(SCL, 1);
 
   // initialize twi prescaler and bit rate
-  cbi(TWSR, TWPS0);
-  cbi(TWSR, TWPS1);
+  TWSR &= ~(_BV(TWPS0) | _BV(TWPS1));
   TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
 
   /* twi bit rate formula from atmega128 manual pg 204