|
|
View previous topic :: View next topic |
Author |
Message |
RT Guest
|
Also ? about write_bank |
Posted: Wed Nov 14, 2001 4:37 pm |
|
|
If you write a value to ram using the write_bank function from a function outside of main():
a) Is that value preserved by the PIC, or can it be overwritten?
ie:
main()
{
write_funtion(); //Will this print 65
)
void write_funtion()
{
write_bank(3,0,0x65);
printf("\%u",read_function());
}
void read_function()
{
int hex_sixty_five;
hex_sixty_five = read_bank(3,0);
return hex_sixty_five;
)
b) Does this save RAM because it seems to not increase my RAM usage if I use it instead of an array?
___________________________
This message was ported from CCS's old forum
Original Post ID: 1107 |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
Re: Also ? about write_bank |
Posted: Wed Nov 14, 2001 5:55 pm |
|
|
Local variables are not perserved between function calls but your not talking about variables your talking about RAM locations. I would guess that your RAM usage report is based on RAM assigned to variables and does not account for directly addressed RAM.
:=If you write a value to ram using the write_bank function from a function outside of main():
:=
:= a) Is that value preserved by the PIC, or can it be overwritten?
:=
:=ie:
:=
:=main()
:={
:= write_funtion(); //Will this print 65
:=)
:=
:=void write_funtion()
:={
:= write_bank(3,0,0x65);
:= printf("\%u",read_function());
:=}
:=
:=void read_function()
:={
:= int hex_sixty_five;
:= hex_sixty_five = read_bank(3,0);
:= return hex_sixty_five;
:=)
:=
:= b) Does this save RAM because it seems to not increase my RAM usage if I use it instead of an array?
___________________________
This message was ported from CCS's old forum
Original Post ID: 1111 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|