Is there anyway to access an entire group of variables in one statement? I was thinking maybe it would be possible with arrays, but how can you set all of the elements at once? Using a structure maybe?
The reason I’m asking is that I want to access all of the OI’s LEDs at one time instead of wasting valuable time on all 8 seperately. In assembly, accessing a full port is a snap, and I would think it would be easy enough in C.
Yes, the typical way is to use a structure (often with variant records).
Since you’re specifically asking about the OI LEDs, take a look through the definition files in the default code from IFI. The individual LED bits are already part of a structure that you ought to be able to set directly.
Specifically for the OI LEDs, if you look in the default code you’ll see where all the 8 OI LED bits are addressed at once in user_routines.c at the very end. Ypu should backtrack as Alan suggested to understand why this is so.
User_Mode_byte = backup_voltage*10;