mirror of
https://github.com/EFeru/hoverboard-sideboard-hack-GD.git
synced 2025-08-18 01:26:11 +00:00
Added i2c timeout
- i2c timeout to avoid getting stuck in while loop
This commit is contained in:
@@ -198,6 +198,7 @@ void I2C0_ErrorIRQ_Handler(void)
|
||||
if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_PECERR)){
|
||||
i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_PECERR);
|
||||
}
|
||||
|
||||
/* disable the error interrupt */
|
||||
i2c_interrupt_disable(I2C0,I2C_INT_ERR | I2C_INT_BUF | I2C_INT_EV);
|
||||
}
|
||||
@@ -365,6 +366,7 @@ void I2C1_ErrorIRQ_Handler(void)
|
||||
if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_PECERR)){
|
||||
i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_PECERR);
|
||||
}
|
||||
|
||||
/* disable the error interrupt */
|
||||
i2c_interrupt_disable(I2C1,I2C_INT_ERR | I2C_INT_BUF | I2C_INT_EV);
|
||||
}
|
||||
|
Reference in New Issue
Block a user