The sample code below shows how a protected variable is defined and how its value can be restored.

main() {

 

protected int state1,

state2, state3;

...

 

_sysIsSoftReset();

// restore any protected variables

The bbram keyword may also be used instead if there is a need to store a variable in battery-backed SRAM without affecting the performance of the application program. Data integrity is not assured when a reset or power failure occurs during the update process.

Additional information on bbram and protected variables is available in the Dynamic C User’s Manual.

44

RabbitCore RCM4000

Page 50
Image 50
Digi user manual RabbitCore RCM4000