I'm trying to enable the watchdog timer in my software, I've decided to use the core watchdog.
I've setted at 1 the define MQX_USE_SW_WATCHDOGS, and I've installed the watchdog isr with this two function:
_int_install_isr(MCF5225_INT_SWT,(void (_CODE_PTR_)(pointer))Core_WatchDog_Expire_Handle, NULL);
_mcf5225_int_init(MCF5225_INT_SWT, BSP_WATCHDOG_INTERRUPT+1, BSP_WATCHDOG_INTERRUPT, TRUE);
And than I've create the watchdog isr routine that is this function:
VMCF5225_STRUCT_PTR reg_ptr = _PSP_GET_IPSBAR();
reg_ptr->CCM.RCR = 0x80;
And the watchdog it's working well.
Now my question is: why the MQX manage the watchdog refresh into the PIT0 isr routine?
I think it's better to refresh the watchdog timer into the main of the software, because if the main is blocked the watchdog timer reaches the underflow and the interrupt is generated and if the interrupt is blocked the main is not running(because the interrupt as an higher priority) and the watchdog is reached too.
Instead if the watchdog timer is refreshed into the PIT0 isr and if the main is blocked but the interrupt it's running the watchdog will never reached.