Remove obsolete cbi/sbi
This commit is contained in:
parent
6d476d7144
commit
384f40956c
1 changed files with 1 additions and 10 deletions
|
@ -22,14 +22,6 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "Arduino.h" // for digitalWrite
|
#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"
|
#include "twi.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,8 +32,7 @@ void twi_init(void)
|
||||||
digitalWrite(SCL, 1);
|
digitalWrite(SCL, 1);
|
||||||
|
|
||||||
// initialize twi prescaler and bit rate
|
// initialize twi prescaler and bit rate
|
||||||
cbi(TWSR, TWPS0);
|
TWSR &= ~(_BV(TWPS0) | _BV(TWPS1));
|
||||||
cbi(TWSR, TWPS1);
|
|
||||||
TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
|
TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
|
||||||
|
|
||||||
/* twi bit rate formula from atmega128 manual pg 204
|
/* twi bit rate formula from atmega128 manual pg 204
|
||||||
|
|
Loading…
Reference in a new issue