Update i2c.c
Dieser Commit ist enthalten in:
		
							Ursprung
							
								
									eee9e5f0c9
								
							
						
					
					
						Commit
						441d216ca5
					
				
							
								
								
									
										7
									
								
								i2c.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								i2c.c
									
									
									
									
									
								
							| @ -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; | ||||||
|  | |||||||
		Laden…
	
	
			
			x
			
			
		
	
		In neuem Issue referenzieren
	
	Einen Benutzer sperren
	 Sylaina
						Sylaina