Data Fields | |
union { | |
struct cliThr_data_t cliThrData | |
Commandline interpreter structure variant. | |
struct modThr_data_t modThrData | |
Modbus handler variant. | |
char stateA [EXTRA_THR_ST_SZ] | |
Byte / char array (castable) | |
}; | |
The thread's respectively thread functions state data. | |
uint8_t | flag |
A flag byte for the threads specific usage. | |
p2ptFun | fun |
The thread's function (pointer to) | |
pt_t | pt |
The (raw) protothread data structure. | |
uint8_t | retC |
The return code of the last schedule. |
State data for a thread (universal variable type)
It is strongly recommended that threads with states larger than fitting in mThr_data_t should use this structure (extending mThr_data_t) for their state. The thread function's (the behaviour) recommended signature takes (only) a pointer to such structure as parameter.
Software using this schema is supported by some handling functions and macros provided.
uint8_t flag |
A flag byte for the threads specific usage.
This is the same as .flag in mThr_data_t.
uint8_t retC |
The return code of the last schedule.
This is the same as retC
in mThr_data_t.
The thread's function (pointer to)
This is the same as .fun in mThr_data_t. For compatibility with the bequeather even the type is the same, even though in this larger structure the function pointer put here must be of type p2ptFunC.
union { ... } |
The thread's respectively thread functions state data.
It is strongly recommended to use no other external or static data for whatever else thread state data but to keep it here in this union. The char [] variant may be cast to any application defined structure of fitting length.