This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Global & Static initialization problem

Hi,
I am developing a firmware for EZUSB FX based board. I am facing a small problem. I am not able to initialize a Global variable in my firmware. Even though I assign the global variable with 0 initial value, But the variable does not take that value. I am using SMALL memory model for my development.

my declerations looks like this :-
BYTE GlobalCount = 0;

and in my sof() I am using this variable and updating it and reusing it again in next sof().
Please advise ..

Rahul Gupta

Parents
  • The code you have posted #includes files I don't have, calls functions that aren't defined and runs on hardware I don't have.

    You need to strip the program right down to a main function, ISR and variable declarations. If that still doesn't work, post it. If it does work, add your other code back in bit by bit until the problem reappears. You will then have a pretty good idea where the problem lies.

Reply
  • The code you have posted #includes files I don't have, calls functions that aren't defined and runs on hardware I don't have.

    You need to strip the program right down to a main function, ISR and variable declarations. If that still doesn't work, post it. If it does work, add your other code back in bit by bit until the problem reappears. You will then have a pretty good idea where the problem lies.

Children