Dieser Commit ist enthalten in:
Sylaina 2018-02-12 05:55:16 +01:00 committet von GitHub
Ursprung eee9e5f0c9
Commit 441d216ca5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

7
i2c.c
Datei anzeigen

@ -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;