pico]OS
1.1.0
|
Data Structures | |
struct | PICOEVENT |
Event info structure. More... | |
struct | PICOTASK |
Task info structure. More... | |
Macros | |
#define | P_ASSERT(text, x) if (!(x)) POSCALL p_pos_assert((const char*)(text), __FILE__, __LINE__) |
pico]OS assertion macro. More... | |
#define | POS_SETTASKNAME(taskhandle, taskname) |
This macro assigns a name to a pico]OS task. More... | |
#define | POS_SETEVENTNAME(eventhandle, name) |
This macro assigns a name to a pico]OS event. More... | |
Typedefs | |
typedef struct PICOEVENT | PICOEVENT |
Event info structure. More... | |
typedef struct PICOTASK | PICOTASK |
Task info structure. More... | |
Enumerations | |
enum | PTASKSTATE { task_notExisting = 0, task_created = 1, task_running = 2, task_suspended = 3, task_sleeping = 4, task_waitingForSemaphore = 5, task_waitingForSemaphoreWithTimeout = 6, task_waitingForMutex = 7, task_waitingForMutexWithTimeout = 8, task_waitingForFlag = 9, task_waitingForFlagWithTimeout = 10, task_waitingForMessage = 11, task_waitingForMessageWithTimeout = 12 } |
Task states (used for debugging when POSCFG_FEATURE_DEBUGHELP is set to 1) More... | |
enum | PEVENTTYPE { event_semaphore = 0, event_mutex = 1, event_flags = 2 } |
Event types (used for debugging when POSCFG_FEATURE_DEBUGHELP is set to 1) More... | |
Variables | |
struct PICOTASK * | picodeb_taskhistory [3] |
This array contains the last 3 tasks that run. More... | |
struct PICOTASK * | picodeb_tasklist |
Pointer to the list of active tasks. More... | |
struct PICOEVENT * | picodeb_eventlist |
Pointer to the list of all system events. More... | |
Sometimes it is really hard to debug multitasking applications. Pico]OS supports you by providing assess to some helpful informations. In conjunction with an incircuit-debugger with the appropriated debugger IDE you will have a powerfull tool to debug your applications.
You need to enable the internal pico]OS debugging support by setting the define POSCFG_FEATURE_DEBUGHELP to 1. It is also required that you compile the code with debug flags set, and the global preprocessor define _DBG must be set.
Pico]OS exports some variables that are helpful for debugging:
#define P_ASSERT | ( | text, | |
x | |||
) | if (!(x)) POSCALL p_pos_assert((const char*)(text), __FILE__, __LINE__) |
pico]OS assertion macro.
For testing and debugging you should enable pico]OS internal assertions. To do so, you must set the define HAVE_PLATFORM_ASSERT in your port.h -file and your platform port must provide this function: void p_pos_assert(const char* text, const char *filename, int linenumber). The function gets called every time pico]OS has failed an assertion.
#define POS_SETEVENTNAME | ( | eventhandle, | |
name | |||
) |
This macro assigns a name to a pico]OS event.
You can use this macro to assign a name to a pico]OS events, such as semaphores, mutextes and flag events. This is usefull when you are debugging your application by using the global eventlist that is referenced by the variable picodeb_eventlist. It is easier to navigate through the list when the events have names. Example:
#define POS_SETTASKNAME | ( | taskhandle, | |
taskname | |||
) |
This macro assigns a name to a pico]OS task.
This is usefull when you are debugging your application by using the global tasklist that is referenced by the variable picodeb_tasklist. It is easier to navigate through the list when the tasks have names. Examples:
Event info structure.
This structure can be used by a debugger IDE to display event status information. (used for debugging when POSCFG_FEATURE_DEBUGHELP is set to 1)
Task info structure.
This structure can be used by a debugger IDE to display task status information. (used for debugging when POSCFG_FEATURE_DEBUGHELP is set to 1)
enum PEVENTTYPE |
Event types (used for debugging when POSCFG_FEATURE_DEBUGHELP is set to 1)
Enumerator | |
---|---|
event_semaphore | 0: The event object is a semaphore. |
event_mutex | 1: The event object is a mutex. |
event_flags | 2: The event object is a flags field. |
enum PTASKSTATE |
Task states (used for debugging when POSCFG_FEATURE_DEBUGHELP is set to 1)
struct PICOEVENT* picodeb_eventlist |
Pointer to the list of all system events.
This variable can be used for debugging. It points to a list of all active events in the system. An event can be a semaphore, a mutex or a flag object. To differentiate the events, there is a type-field in the PICOEVENT structure. The list is double-chained with next- and prev- pointers. See the description of the PICOEVENT structure for details.
struct PICOTASK* picodeb_taskhistory[3] |
This array contains the last 3 tasks that run.
This array can be used for debugging. The array has 3 entries, each is pointing to a task debug structure. This array is a history of the last 3 tasks that has run, and array element 0 is the task that currently runs, element 1 points to the task before, and so on.
struct PICOTASK* picodeb_tasklist |
Pointer to the list of active tasks.
This variable can be used for debugging. It points to a list of all currently active (=created) tasks in the system. The list is double-chained with next- and prev- pointers. See the description of the PICOTASK structure for details.