Hi, I'm implementing an I2C multimaster driver. Eventually it gets stuck in one of the many while loops that are required and my watchdog resets it.
I would like to avoid that and implement like a kind of timeout to reset only the driver and not the whole micro.
It gets stuck in those 2 cases.
Case 1
For switching it from controller to master, I have this sequence:
It gets stuck in that while.
Case 2:
When sending in controller mode, it gets stuck in either one of these whiles.
NOTE: Currently I'm testing collisions ( and I've never seen that interruption happen ) while activating 3 microcontrollers at the same time, so the "getting stuck issue" happens every 150-200 activations approx.
So the thing is, I would like to create a timeout or something that would catch an error, restart the peripheral and break those whiles.
This is my current configuration: