After some testing in gcc, I figured it out. The more descriptive errors helped. The page I was reading was incorrect about the ordering of the type name versus the variable name. I'm actually passing a bitmask value that I #defined as a bitmask, but I just did it this way so it's easier for people to understand the pointer stuff that's going on. It's so nice having full ansi C.
Code:
struct relay_type { int fwd; int rev};
struct relay_type ball_arm_lower;
void set_relay (struct relay_type *relay, int fwd, int rev)
{
relay->fwd = fwd;
relay->rev = rev;
}
main()
{
update_inputs ();
set_relay (&ball_arm_lower, 1, 0);
update_outputs ();
}
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL:
mccune@ling.ohio-state.edu
...And all you touch and all you see
Is all your life will ever be...