I am using CCS v12.2.0, TI v21.6.1.LTS compiler.
The firmware needs to decide on when to issue a software restart. There are some project configurations that don’t need to use this restart and I have a project predefine for this choice. One project library decides on the restart:
#if !defined (WDtoBMS_MFG_BOARD_TEST)
if (fault){
setVMBBRestart(1);
}
#endif
There is a header file with this inline function definition in one of the project libraries:
inline void setVMBBRestart(uint8_t input){
VMBB_doRestart = (input == 1) ? 1:0;
return;
}
In the main loop:
while (1)
{
if ((isVMBBRestart() == 1)){
WDTCTL = 0xDEAD;
}
…..
}
Without the check on the predefine, this restart works as expected. But I cannot get the restart to take effect with the predefine check. Is there a better way to issue a software reset? Or a better way to not compile sections of firmware for certain project configurations?
Priya