Thanks for the pointer. I just checked the datasheet and realized that they are using the sequence purposefully.
To elaborate more on my example request:
I'm using USART to communicate between two MCUs. I'm using getchar() to receive the data. sometimes one unit hangs, so the other keeps waiting indefinitely for the data.
I want to use the watchdog timer to ensure if the communication is not received within x ms, I reset the units. and start over.
I'm expecting the code flow as:
//start the timer
enable_wdt();
get_char()
disable_wdt()
so if disable_wdt is reached this means getchar() received the byte and then the watchdog timer is disabled and the code continue the execution normally. but if get_char() hangs then I restart the unit.
thanks