Start implementing watchdog timer
This commit is contained in:
@@ -140,6 +140,22 @@ int I2C_Stop(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I2C_Reset(void)
|
||||
{
|
||||
unsigned char TWBRold = TWBR;
|
||||
unsigned char TWARold = TWAR;
|
||||
|
||||
// TODO: Handle timeouts and reset TWI if necessary,
|
||||
// fatal error after multiple attempts and then bring
|
||||
// system to a safe stop.
|
||||
|
||||
// TWI_Disable();
|
||||
// TWI_Init();
|
||||
|
||||
TWAR = TWARold;
|
||||
TWBR = TWBRold;;
|
||||
}
|
||||
|
||||
int I2C_SetChannel(int channel)
|
||||
{
|
||||
unsigned char crb;
|
||||
|
||||
Reference in New Issue
Block a user