Start implementing watchdog timer

This commit is contained in:
2024-09-05 15:19:36 +02:00
parent 14e12cdd03
commit d1a25c4bd3
5 changed files with 162 additions and 0 deletions

View File

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