> [email protected] wrote:
>
> > Thanks for this suggestion. It certainly works:
>
> You're welcome. I'm pretty sure that I learned this myself from
> discussion
> on this list so it only makes sense to pass the knowledge on.
>
> > Is there any way make it tidier ( without declaring identifiers like
> > _PC6)?
>
> I don't think so, but maybe someone else knows how to do this. I am as
> interested in the answer as you.
>
> Graham.
This may not be exactly what you want, but it does show you do not need the
identifiers.
typedef struct
{
struct
{
uint8 x:4;
uint8 y:4;
} v;
char name[4];
} PIN;
PIN Pin[] PROGMEM =
{
{ { 1, 2 }, "PC6" },
{ { 3, 4 }, "PD0" }
};
int main(void)
{
PIN local;
uint8 a;
memcpy_P(&local, &Pin[0], sizeof(PIN));
a = local.v.x;
memcpy_P(&local, &Pin[1], sizeof(PIN));
a = local.v.y;
Ron.
_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat