37 static struct pios_thread *
handles[TASKINFO_RUNNING_NUMELEM];
40 DONT_BUILD_IF(TASKINFO_RUNNING_NUMELEM != TASKINFO_STACKREMAINING_NUMELEM,
42 DONT_BUILD_IF(TASKINFO_RUNNING_NUMELEM != TASKINFO_RUNNINGTIME_NUMELEM,
54 memset(
handles, 0,
sizeof(
struct pios_thread *) * TASKINFO_RUNNING_NUMELEM);
56 #if defined(DIAG_TASKS)
57 #if defined(PIOS_INCLUDE_CHIBIOS)
69 uint32_t task_idx = (uint32_t) task;
73 if (task_idx < TASKINFO_RUNNING_NUMELEM) {
88 uint32_t task_idx = (uint32_t) task;
89 if (task_idx < TASKINFO_RUNNING_NUMELEM)
107 uint32_t task_idx = (uint32_t) task;
108 if (task_idx < TASKINFO_RUNNING_NUMELEM &&
handles[task_idx] != 0)
118 #if defined(DIAG_TASKS)
125 uint32_t currentTime = 0;
133 #if defined(PIOS_INCLUDE_CHIBIOS)
140 for (n = 0; n < TASKINFO_RUNNING_NUMELEM; ++n)
144 data.Running[n] = TASKINFO_RUNNING_TRUE;
151 data.Running[n] = TASKINFO_RUNNING_FALSE;
152 data.StackRemaining[n] = 0;
153 data.RunningTime[n] = 0;
bool TaskMonitorQueryRunning(TaskInfoRunningElem task)
DONT_BUILD_IF(TASKINFO_RUNNING_NUMELEM!=TASKINFO_STACKREMAINING_NUMELEM, taskelems1)
static struct pios_thread * handles[TASKINFO_RUNNING_NUMELEM]
void TaskMonitorUpdateAll(void)
bool PIOS_Mutex_Unlock(struct pios_mutex *mtx)
struct pios_mutex * PIOS_Mutex_Create(void)
int32_t TaskMonitorRemove(TaskInfoRunningElem task)
uint8_t data[XFER_BYTES_PER_PACKET]
static TaskInfoRunningElem task
int32_t TaskMonitorAdd(TaskInfoRunningElem task, struct pios_thread *threadp)
static uint32_t lastMonitorTime
#define hal_lld_get_counter_value()
Returns the current value of the system free running counter.
uint32_t PIOS_Thread_Get_Stack_Usage(struct pios_thread *threadp)
static struct pios_mutex * lock
#define halGetCounterValue()
Returns the current value of the system free running counter.
int32_t TaskMonitorInitialize(void)
Includes PiOS and core architecture components.
uint32_t PIOS_Thread_Get_Runtime(struct pios_thread *threadp)
#define PIOS_Assert(test)
#define PIOS_MUTEX_TIMEOUT_MAX
bool PIOS_Mutex_Lock(struct pios_mutex *mtx, uint32_t timeout_ms)