beautypg.com

Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 113

background image

112

CHAPTER 10 • MEMORY MANAGEMENT

flashData.messageIdx = 0;
}

switch (flashData.messageIdx)
{
case 0:
tmpPtr = &Message1[0];
break;
case 1:
tmpPtr = &Message2[0];
break;
case 2:
tmpPtr = &Message3[0];
break;
default:
case 3:
tmpPtr = &Message4[0];
break;
}
ClickLedOff(ALL);
ClickLedOn(YELLOW1+flashData.messageIdx);
ClickUtilSetDefaultString(nearBuffer,tmpPtr,10);
printf(“Message in near buffer @ %p is: %s\r\n”,
&nearBuffer, nearBuffer);
_f_memcpy(farBuffer,nearBuffer,10);
printf(“Message in far buffer: @ %lp is: %ls\r\n”,
&farBuffer, farBuffer);
}
}

void Setup1( void )
{
ClickflashRead(&flashData, sizeof(flashData), 0);
if ( (flashData.messageIdx < 0)
|| (flashData.messageIdx > 3)
)
{
flashData.messageIdx = 3;
}
ClickLedOff(ALL);
ClickLedOn(YELLOW1+flashData.messageIdx);
printf(“Message index read from flash is: %d\r\n”,