Author |
Message |
Topic: passing structures to functions by reference |
Rich_Man
Replies: 4
Views: 8992
|
Forum: General CCS C Discussion Posted: Tue Jan 07, 2014 9:50 am Subject: passing structures to functions by reference |
Thanks for all the good information and help. |
Topic: passing structures to functions by reference |
Rich_Man
Replies: 4
Views: 8992
|
Forum: General CCS C Discussion Posted: Tue Dec 31, 2013 1:12 pm Subject: passing structures to functions by reference |
OK, this works, but I'm not sure why. I've not done it this way before.
void test_function([struc_data* s_temp)
{
s_temp->a = 1;
s_temp->b = 2;
return;
}
... |
Topic: passing structures to functions by reference |
Rich_Man
Replies: 4
Views: 8992
|
Forum: General CCS C Discussion Posted: Tue Dec 31, 2013 12:53 pm Subject: passing structures to functions by reference |
I am trying to pass a structure to a function by reference to be able to return several variables. It is not working. I feel like I have done this many times in other compilers, but I don't know why ... |
Topic: ISR problems on 18F8722 -- SOLVED -- BUT NEED SECOND LOOK |
Rich_Man
Replies: 4
Views: 8393
|
Forum: General CCS C Discussion Posted: Thu Dec 05, 2013 2:02 pm Subject: ISR problems on 18F8722 -- SOLVED -- BUT NEED SECOND LOOK |
I think I have it fixed. couldn't figure it out after hours of trying, and 15min after posting the question I got it.
I set the interrupt to trigger on a button down. While handling the button do ... |
Topic: ISR problems on 18F8722 -- SOLVED -- BUT NEED SECOND LOOK |
Rich_Man
Replies: 4
Views: 8393
|
Forum: General CCS C Discussion Posted: Thu Dec 05, 2013 1:42 pm Subject: ISR problems on 18F8722 -- SOLVED -- BUT NEED SECOND LOOK |
I added a delay_ms(10) before the read pin statement:
if(button1)
{
// read pin to see if up or down
delay_ms(10);
result = input(PIN_B1) ... |
Topic: ISR problems on 18F8722 -- SOLVED -- BUT NEED SECOND LOOK |
Rich_Man
Replies: 4
Views: 8393
|
Forum: General CCS C Discussion Posted: Thu Dec 05, 2013 12:50 pm Subject: ISR problems on 18F8722 -- SOLVED -- BUT NEED SECOND LOOK |
I'm writing a test program to register button pushes. I'm using the INT_EXT interrupts on the PIC18F8722. My problem is that I don't always see a button push or a button release, and when I do it doe ... |
|