Multos Forums

   

Resetting session variables during debugging session

RankRankRank

Total Posts: 74

Joined 2012-02-21

PM

I was asked at a recent training session how to do this so that you could simulate the card being removed from the reader.

The answer is to simply use the File->Select menu option to reselect the application. This has the effect of resetting all the session variables but leaves all static variables with their current values.

Please note: Session variables cannot be initialised in your code declaration. All session variables are initialised with NULL (i.e. 0x00). This is because there is no mechanism for passing initial values of session variables in an ALU. If you really need to initialise session variables, you can do it in the body of your code referencing a flag variable (in session).

#pragma melsession
int initialised;
int retryCount;
int retryDelay;

void
main (void)
{
  if ( !initialised ) {
      initialised = 1;
      retryCount = 3;
      retryDelay = 100;
  }

....