conditional run time settings

Status
Not open for further replies.

userx51

Junior Member level 2
Joined
Apr 21, 2013
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,432
In my keil program, during the run time I like in my code to check a value and come up with the following:

depending on a variable, var1 , bypass one of the settings[] in below.like if var1 = 1, the settings would be the first one and if var = 2,the settings would be the second one.

Code:
struct SS
{
	int a,b,c,d;
};

static SS code settings[] =
{
	{1,2,3,4},
	{5,6,7,8}
};

static SS code settings[] =
{
	{1,2,3,4},
	{5,6,7,8},
	{9,10,11,12}
};

and also,

#define arrsz 10

if var = 2, arrsz for xbuf change to 20.

Code:
unsigned char xdata xbuf[arrsz];
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…