[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Linked lists.

From: Daniel Williamson
Subject: [avr-gcc-list] Linked lists.
Date: Mon, 9 Dec 2002 16:57:00 -0000


I'm implementing a linked list of structures as part of a re-configurable
state machine.  I can declare a pointer to the structures and it works fine.
However If I increment the pointer as in pointer++; Then I start going off
track.  I was rather hoping that incrementing the pointer in this way would
jump to the next defined structure in my list.

Maybe I've missed something glaringly obvious.
Anyway does anyone have any thoughts, and also can anyone think of a better
way to do a state machine.
In the past I've used switch and case,  and also pointers to functions with
each function being a state and it setting the next state to call.

This time I'd like something a little more abstract and configurable so that
I can change the state machine depending on the mode I'm in.

I'm using atmega 128 and gcc 3.2


avr-gcc-list at http://avr1.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]