- Adapted indenation to new agreed upon system

- Fixed bad status in poldi zug driver
This commit is contained in:
koennecke
2009-02-13 09:01:03 +00:00
parent 6c7bb14fad
commit eb72d5c486
151 changed files with 38234 additions and 38208 deletions

16
fsm.h
View File

@ -11,7 +11,7 @@ M. Zolliker, Aug 2004
typedef struct Fsm Fsm;
typedef long (*FsmFunc)(long pc, void *obj);
typedef long (*FsmFunc) (long pc, void *obj);
/* the prototype for a task function
a task function body has the following form:
@ -41,31 +41,31 @@ typedef long (*FsmFunc)(long pc, void *obj);
#define FSM_CALL(FUNC) return FsmCallOld(__LINE__, (FsmFunc)FUNC); case __LINE__:
/* call a task subfunction */
typedef int (*FsmHandler)(void *obj);
typedef int (*FsmHandler) (void *obj);
/* the prototype for the handler. Should return 0 when waiting for an answer
or 1 when result is o.k. */
Fsm *FsmStartTask(void *obj, FsmHandler handler, FsmFunc func, char *name);
/* start a task and return a pointer to it */
void FsmRestartTask(Fsm *task, FsmFunc func);
void FsmRestartTask(Fsm * task, FsmFunc func);
/* restart a stopped task */
int FsmTaskHandler(Fsm *task);
int FsmTaskHandler(Fsm * task);
/* this is the task handler.
the argument should be the pointer obtained from FsmStartTask
returns 0 when finished, 1 when still running */
int FsmStop(Fsm *task, FsmFunc func);
int FsmStop(Fsm * task, FsmFunc func);
/* stop a function. returns to the caller next time */
void FsmStopTask(Fsm *task);
void FsmStopTask(Fsm * task);
/* stops the task, it will be killed after next execution */
void FsmKill(void *task);
/* kill the task */
void FsmPause(Fsm *task, int pause);
void FsmPause(Fsm * task, int pause);
/* pause=1: pause task, pause=0: continue task */
long FsmCallOld(long pc, FsmFunc func);
@ -75,6 +75,6 @@ void FsmCall(FsmFunc func);
void FsmWait(long delay);
void FsmSpeed(Fsm *task);
void FsmSpeed(Fsm * task);
#endif