View previous topic :: View next topic |
Author |
Message |
pebbert9
Joined: 31 Dec 2010 Posts: 39
|
Changing the value of a passed variable |
Posted: Wed Oct 05, 2011 11:33 am |
|
|
I've used the following in another system but it's not working in CCS. Why isn't max_counter changed to 10?
Code: | #include <18F4550.h>
#device ICD=TRUE
#fuses HSPLL,PLL4,NOLVP,NOWDT,PUT,ICSP1
#use delay (clock=20000000)
#use RS232(DEBUGGER)
int max_counter;
void foo(int *num)
{
*num = 10;
}
void main()
{
max_counter = 1;
foo( max_counter );
printf("MAX COUNTER = %d",max_counter);
while (TRUE)
{
}
} |
|
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
Re: Changing the value of a passed variable |
Posted: Wed Oct 05, 2011 11:46 am |
|
|
pebbert9 wrote: | I've used the following in another system but it's not working in CCS. Why isn't max_counter changed to 10?
Code: | #include <18F4550.h>
#device ICD=TRUE
#fuses HSPLL,PLL4,NOLVP,NOWDT,PUT,ICSP1
#use delay (clock=20000000)
#use RS232(DEBUGGER)
int max_counter;
void foo(int *num)
{
*num = 10;
}
void main()
{
max_counter = 1;
foo( max_counter );
printf("MAX COUNTER = %d",max_counter);
while (TRUE)
{
}
} |
|
Try:
|
|
|
pebbert9
Joined: 31 Dec 2010 Posts: 39
|
|
Posted: Wed Oct 05, 2011 12:10 pm |
|
|
thank you |
|
|
|