You are here

Global vs Local Variables | Cypress Semiconductor

Global vs Local Variables

Summary: 2 Replies, Latest post by danaaknight on 19 Feb 2013 11:16 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
user_1377889's picture
9292 posts

Having recently discussed the use of global and local variables with Dana, I could not help but writing a bit of explanation for those who are not so experienced in the matter. Have a look at the attached document.


Happy new year for all you forum supporters



rbyn's picture
Cypress Employee
92 posts

 Thank you so much!  -Robyn

user_14586677's picture
7646 posts

Bob and I discussed pros and cons of Globals.


I use in some programs extensively globals, and use pointers

to them. Pariculary in cases where code space is challenged,

or execution speed. You define them once, they do not get pushed/

pulled on stack operations, just the pointers.


Note however this works great in reducing code size where native

machine size is 8 bit, and you have many ints and longs, especially



I think collectively we should do a sticky Globals vs Locals thread,

get everyones input, and put it in an ap note.


Regards, Dana.

Log in to post new comments.