Update i2c.c

pull/7/head
Sylaina 7 years ago committed by GitHub
parent eee9e5f0c9
commit 441d216ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -46,7 +46,7 @@ void i2c_start(uint8_t i2c_addr){
timeout--; timeout--;
if(timeout == 0){ if(timeout == 0){
I2C_ErrorCode |= (1 << I2C_START); I2C_ErrorCode |= (1 << I2C_START);
return 0; return;
} }
}; };
// send adress // send adress
@ -58,7 +58,7 @@ void i2c_start(uint8_t i2c_addr){
timeout--; timeout--;
if(timeout == 0){ if(timeout == 0){
I2C_ErrorCode |= (1 << I2C_SENDADRESS); I2C_ErrorCode |= (1 << I2C_SENDADRESS);
return 0; return;
} }
}; };
} }
@ -75,7 +75,7 @@ void i2c_byte(uint8_t byte){
timeout--; timeout--;
if(timeout == 0){ if(timeout == 0){
I2C_ErrorCode |= (1 << I2C_BYTE); I2C_ErrorCode |= (1 << I2C_BYTE);
return 0; return;
} }
}; };
} }
@ -100,6 +100,7 @@ uint8_t i2c_readNAck(void){
timeout--; timeout--;
if(timeout == 0){ if(timeout == 0){
I2C_ErrorCode |= (1 << I2C_READNACK); I2C_ErrorCode |= (1 << I2C_READNACK);
return 0;
} }
}; };
return TWDR; return TWDR;

Loading…
Cancel
Save