Hi,
I am working with the TS-7300 and doing some work with it for a
school project. I am using the GPIO to read from a keypad and I have
a little question. I am able to successfully read from the keypad but
I am trying to make my code a little bit cleaner by having the
functions I use in a separate file. I use two functions, port_B_Init
and port_F_Init, to initialize the ports and get the pointers to the
registers. If I create a new file that holds these functions and put
an include line in the main file I get a segmentation fault when
trying to set these pointers. What is the proper way to do this? If
I only need one pointer( like only the data reg) then I just return
the pointer and everything is fine. But what if I need a pointer to
both the data and direction register? I have tried creating the
pointers in the main program and passing them as arguments to the
functions and have the function modify the address they point to but
thats where I get the segmentation fault. It's not a big deal if the
functions are in the same file, I would just like to know how you guys
would handle this.
Thanks,
Brandon
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|