Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded C - board gets reset by a constant getting changed

Status
Not open for further replies.

MS123

Programmer
Oct 3, 2002
1
GB
Hi!

The code has C & C++ on a proprietory OS. The problem is:

When a

#define VAR1 40

is changed to

#define VAR1 32,

the board resets repeatedly after power-on.

VAR1 is used

1)to declare an array, Array1[(VAR1 * VAR2) + VAR1]

and

2)in a &quot;for&quot; loop, char1 < char_num
where char_num = VAR1 -2.

I have tried commenting various init functions in the startup code, with no success. Has anyone had a similar problem and what could be a possible reason?

Thanks a lot for any help/suggestions.

Regards,
ms
 
Your bespoke OS may be having that limitation or may be your program is not getting saved completely, skipping the top few lines. Try inserting some commented lines before it.

Also try using some other defines for other types like string values and floats.

If Still this doesn’t work, u may use[red]
Code:
const int VAR1=40;
[/red] instead! :-V

Chow!
user.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top