Skip to content
Snippets Groups Projects
Commit 909c7cc3 authored by Markus Scheck's avatar Markus Scheck
Browse files

deleted unused programms

parent b5682c64
No related branches found
No related tags found
No related merge requests found
Showing
with 3 additions and 6 deletions
// all functions inline to save execution time // all functions inline to save execution time
inline void init_i2c(void); inline void init_i2c(void);
inline void tp_i2c(void); inline void tp_i2c(void);
...@@ -12,7 +12,7 @@ inline void init_i2c(void) { ...@@ -12,7 +12,7 @@ inline void init_i2c(void) {
uint16_t recv_bytes = 0; uint16_t recv_bytes = 0;
inline void tp_i2c(void) { inline void tp_i2c(void) {
while(1) { while(1) {
// wait for a change to occur on i2c // wait for a change to occur on i2c
while(!(TWCR&(1<<TWINT))); while(!(TWCR&(1<<TWINT)));
...@@ -31,11 +31,11 @@ inline void tp_i2c(void) { ...@@ -31,11 +31,11 @@ inline void tp_i2c(void) {
case 0x90: case 0x90:
Serial.println(TWDR); Serial.println(TWDR);
break; break;
default: default: // if unexcpected state
Serial.print("E"); Serial.print("E");
Serial.println(stat); Serial.println(stat);
} }
// Clear flag on I2C, allow for further data/events // Clear flag on I2C, allow for further data/events
TWCR = (1<<TWEA)|(1<<TWEN)|(1<<TWINT); TWCR = (1<<TWEA)|(1<<TWEN)|(1<<TWINT);
} }
} }
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#define SLA_ADDR 1 #define SLA_ADDR 1
inline void init_i2c(void) { inline void init_i2c(void) {
//Set up prescaler to 16 -> resulting clock is 1Mhz
//TWSR |= (1<<TWPS1)|(1<<TWPS0);// -> is 0
//Set up clock //Set up clock
TWBR = 1; //888.8 kbps TWBR = 1; //888.8 kbps
//TWBR = 8; //500 kbps //TWBR = 8; //500 kbps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment