diff --git a/flight/modules/AltitudeHold/altitudehold.c b/flight/modules/AltitudeHold/altitudehold.c index bf996d0d1..ce7c556c8 100644 --- a/flight/modules/AltitudeHold/altitudehold.c +++ b/flight/modules/AltitudeHold/altitudehold.c @@ -45,6 +45,8 @@ #include +#include + #include #include #include @@ -84,7 +86,7 @@ int32_t AltitudeHoldStart() { // Start main task SettingsUpdatedCb(NULL); - DelayedCallbackDispatch(altitudeHoldCBInfo); + PIOS_CALLBACKSCHEDULER_Dispatch(altitudeHoldCBInfo); return 0; } @@ -101,7 +103,7 @@ int32_t AltitudeHoldInitialize() // Create object queue - altitudeHoldCBInfo = DelayedCallbackCreate(&altitudeHoldTask, CALLBACK_PRIORITY, CBTASK_PRIORITY, STACK_SIZE_BYTES); + altitudeHoldCBInfo = PIOS_CALLBACKSCHEDULER_Create(&altitudeHoldTask, CALLBACK_PRIORITY, CBTASK_PRIORITY, CALLBACKINFO_RUNNING_ALTITUDEHOLD, STACK_SIZE_BYTES); AltitudeHoldSettingsConnectCallback(&SettingsUpdatedCb); return 0; @@ -128,7 +130,7 @@ static void altitudeHoldTask(void) pid_zero(&pid0); pid_zero(&pid1); StabilizationDesiredThrottleGet(&startThrottle); - DelayedCallbackSchedule(altitudeHoldCBInfo, DESIRED_UPDATE_RATE_MS, CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(altitudeHoldCBInfo, DESIRED_UPDATE_RATE_MS, CALLBACK_UPDATEMODE_SOONER); return; break; @@ -190,7 +192,7 @@ static void altitudeHoldTask(void) StabilizationDesiredSet(&stab); - DelayedCallbackSchedule(altitudeHoldCBInfo, DESIRED_UPDATE_RATE_MS, CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(altitudeHoldCBInfo, DESIRED_UPDATE_RATE_MS, CALLBACK_UPDATEMODE_SOONER); } static void SettingsUpdatedCb(__attribute__((unused)) UAVObjEvent *ev) diff --git a/flight/modules/CallbackTest/callbacktest.c b/flight/modules/CallbackTest/callbacktest.c index 0b4ccf474..d5be343de 100644 --- a/flight/modules/CallbackTest/callbacktest.c +++ b/flight/modules/CallbackTest/callbacktest.c @@ -65,13 +65,13 @@ int32_t CallbackTestInitialize() { mutex = xSemaphoreCreateRecursiveMutex(); - cbinfo[0] = DelayedCallbackCreate(&DelayedCb0, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, STACK_SIZE); - cbinfo[1] = DelayedCallbackCreate(&DelayedCb1, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, STACK_SIZE); - cbinfo[2] = DelayedCallbackCreate(&DelayedCb2, CALLBACK_PRIORITY_CRITICAL, tskIDLE_PRIORITY + 2, STACK_SIZE); - cbinfo[3] = DelayedCallbackCreate(&DelayedCb3, CALLBACK_PRIORITY_CRITICAL, tskIDLE_PRIORITY + 2, STACK_SIZE); - cbinfo[4] = DelayedCallbackCreate(&DelayedCb4, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, STACK_SIZE); - cbinfo[5] = DelayedCallbackCreate(&DelayedCb5, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, STACK_SIZE); - cbinfo[6] = DelayedCallbackCreate(&DelayedCb6, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 20, STACK_SIZE); + cbinfo[0] = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb0, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, -1, STACK_SIZE); + cbinfo[1] = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb1, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, -1, STACK_SIZE); + cbinfo[2] = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb2, CALLBACK_PRIORITY_CRITICAL, tskIDLE_PRIORITY + 2, -1, STACK_SIZE); + cbinfo[3] = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb3, CALLBACK_PRIORITY_CRITICAL, tskIDLE_PRIORITY + 2, -1, STACK_SIZE); + cbinfo[4] = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb4, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, -1, STACK_SIZE); + cbinfo[5] = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb5, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 2, -1, STACK_SIZE); + cbinfo[6] = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb6, CALLBACK_PRIORITY_LOW, tskIDLE_PRIORITY + 20, -1, STACK_SIZE); return 0; @@ -79,22 +79,22 @@ int32_t CallbackTestInitialize() int32_t CallbackTestStart() { xSemaphoreTakeRecursive(mutex, portMAX_DELAY); - DelayedCallbackDispatch(cbinfo[3]); - DelayedCallbackDispatch(cbinfo[2]); - DelayedCallbackDispatch(cbinfo[1]); - DelayedCallbackDispatch(cbinfo[0]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[3]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[2]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[1]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[0]); // different callback priorities within a taskpriority - DelayedCallbackSchedule(cbinfo[4], 30000, CALLBACK_UPDATEMODE_NONE); - DelayedCallbackSchedule(cbinfo[4], 5000, CALLBACK_UPDATEMODE_OVERRIDE); - DelayedCallbackSchedule(cbinfo[4], 4000, CALLBACK_UPDATEMODE_SOONER); - DelayedCallbackSchedule(cbinfo[4], 10000, CALLBACK_UPDATEMODE_SOONER); - DelayedCallbackSchedule(cbinfo[4], 1000, CALLBACK_UPDATEMODE_LATER); - DelayedCallbackSchedule(cbinfo[4], 4800, CALLBACK_UPDATEMODE_LATER); - DelayedCallbackSchedule(cbinfo[4], 48000, CALLBACK_UPDATEMODE_NONE); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[4], 30000, CALLBACK_UPDATEMODE_NONE); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[4], 5000, CALLBACK_UPDATEMODE_OVERRIDE); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[4], 4000, CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[4], 10000, CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[4], 1000, CALLBACK_UPDATEMODE_LATER); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[4], 4800, CALLBACK_UPDATEMODE_LATER); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[4], 48000, CALLBACK_UPDATEMODE_NONE); // should be at 4.8 seconds after this, allowing for exactly 9 prints of the following - DelayedCallbackSchedule(cbinfo[5], 500, CALLBACK_UPDATEMODE_NONE); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[5], 500, CALLBACK_UPDATEMODE_NONE); // delayed counter with 500 ms - DelayedCallbackDispatch(cbinfo[6]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[6]); // high task prio xSemaphoreGiveRecursive(mutex); return 0; @@ -104,28 +104,28 @@ static void DelayedCb0() { DEBUGPRINT("delayed counter low prio 0 updated: %i\n", counter[0]); if (++counter[0] < 10) { - DelayedCallbackDispatch(cbinfo[0]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[0]); } } static void DelayedCb1() { DEBUGPRINT("delayed counter low prio 1 updated: %i\n", counter[1]); if (++counter[1] < 10) { - DelayedCallbackDispatch(cbinfo[1]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[1]); } } static void DelayedCb2() { DEBUGPRINT("delayed counter high prio 2 updated: %i\n", counter[2]); if (++counter[2] < 10) { - DelayedCallbackDispatch(cbinfo[2]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[2]); } } static void DelayedCb3() { DEBUGPRINT("delayed counter high prio 3 updated: %i\n", counter[3]); if (++counter[3] < 10) { - DelayedCallbackDispatch(cbinfo[3]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[3]); } } static void DelayedCb4() @@ -137,7 +137,7 @@ static void DelayedCb5() { DEBUGPRINT("delayed scheduled counter 5 updated: %i\n", counter[5]); if (++counter[5] < 10) { - DelayedCallbackSchedule(cbinfo[5], 500, CALLBACK_UPDATEMODE_NONE); + PIOS_CALLBACKSCHEDULER_Schedule(cbinfo[5], 500, CALLBACK_UPDATEMODE_NONE); } // it will likely only reach 8 due to cb4 aborting the run } @@ -145,6 +145,6 @@ static void DelayedCb6() { DEBUGPRINT("delayed counter 6 (high task prio) updated: %i\n", counter[6]); if (++counter[6] < 10) { - DelayedCallbackDispatch(cbinfo[6]); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo[6]); } } diff --git a/flight/modules/Example/examplemodcallback.c b/flight/modules/Example/examplemodcallback.c index 349b80934..7c63475fc 100644 --- a/flight/modules/Example/examplemodcallback.c +++ b/flight/modules/Example/examplemodcallback.c @@ -45,6 +45,7 @@ */ #include "openpilot.h" +#include "callbackinfo.h" // object needed for callback id macro CALLBACKINFO_RUNNING_ #include "exampleobject1.h" // object the module will listen for updates (input) #include "exampleobject2.h" // object the module will update (output) #include "examplesettings.h" // object holding module settings (input) @@ -71,7 +72,7 @@ int32_t ExampleModCallbackInitialize() // Listen for ExampleObject1 updates, connect a callback function ExampleObject1ConnectCallback(&ObjectUpdatedCb); - cbinfo = DelayedCallbackCreate(&DelayedCb, CALLBACK_PRIORITY, CBTASK_PRIORITY, STACK_SIZE); + cbinfo = PIOS_CALLBACKSCHEDULER_Create(&DelayedCb, CALLBACK_PRIORITY, CBTASK_PRIORITY, CALLBACKINFO_RUNNING_EXAMPLE, STACK_SIZE); return 0; } @@ -85,11 +86,11 @@ int32_t ExampleModCallbackInitialize() */ static void ObjectUpdatedCb(__attribute__((unused)) UAVObjEvent *ev) { - DelayedCallbackDispatch(cbinfo); + PIOS_CALLBACKSCHEDULER_Dispatch(cbinfo); } /** - * This function is called by the DelayedCallbackScheduler when its execution + * This function is called by the PIOS_CALLBACKSCHEDULER_Scheduler when its execution * has been requested. Callbacks scheduled for execution are executed in the * same thread in a round robin fashion. The Dispatch function to reschedule * execution can be called from within the Callback itself, in which case the @@ -135,5 +136,5 @@ ExampleObject2Set(&data2); // call the module again 10 seconds later, // even if the exampleobject has not been updated -DelayedCallbackSchedule(cbinfo, 10 * 1000, CALLBACK_UPDATEMODE_NONE); +PIOS_CALLBACKSCHEDULER_Schedule(cbinfo, 10 * 1000, CALLBACK_UPDATEMODE_NONE); } diff --git a/flight/modules/OPLink/oplinkmod.c b/flight/modules/OPLink/oplinkmod.c index 994e0d5d9..2ac5e6d74 100644 --- a/flight/modules/OPLink/oplinkmod.c +++ b/flight/modules/OPLink/oplinkmod.c @@ -119,7 +119,7 @@ static void systemTask(__attribute__((unused)) void *parameters) MODULE_TASKCREATE_ALL; /* start the delayed callback scheduler */ - CallbackSchedulerStart(); + PIOS_CALLBACKSCHEDULER_Start(); if (mallocFailed) { /* We failed to malloc during task creation, diff --git a/flight/modules/PathPlanner/pathplanner.c b/flight/modules/PathPlanner/pathplanner.c index 6c548b6b7..632f4a8e9 100644 --- a/flight/modules/PathPlanner/pathplanner.c +++ b/flight/modules/PathPlanner/pathplanner.c @@ -31,6 +31,7 @@ #include "openpilot.h" +#include "callbackinfo.h" #include "pathplan.h" #include "flightstatus.h" #include "airspeedstate.h" @@ -95,7 +96,7 @@ int32_t PathPlannerStart() PathStatusConnectCallback(statusUpdated); // Start main task callback - DelayedCallbackDispatch(pathPlannerHandle); + PIOS_CALLBACKSCHEDULER_Dispatch(pathPlannerHandle); return 0; } @@ -115,8 +116,8 @@ int32_t PathPlannerInitialize() WaypointInitialize(); WaypointActiveInitialize(); - pathPlannerHandle = DelayedCallbackCreate(&pathPlannerTask, CALLBACK_PRIORITY_REGULAR, TASK_PRIORITY, STACK_SIZE_BYTES); - pathDesiredUpdaterHandle = DelayedCallbackCreate(&updatePathDesired, CALLBACK_PRIORITY_CRITICAL, TASK_PRIORITY, STACK_SIZE_BYTES); + pathPlannerHandle = PIOS_CALLBACKSCHEDULER_Create(&pathPlannerTask, CALLBACK_PRIORITY_REGULAR, TASK_PRIORITY, CALLBACKINFO_RUNNING_PATHPLANNER0, STACK_SIZE_BYTES); + pathDesiredUpdaterHandle = PIOS_CALLBACKSCHEDULER_Create(&updatePathDesired, CALLBACK_PRIORITY_CRITICAL, TASK_PRIORITY, CALLBACKINFO_RUNNING_PATHPLANNER1, STACK_SIZE_BYTES); return 0; } @@ -128,7 +129,7 @@ MODULE_INITCALL(PathPlannerInitialize, PathPlannerStart); */ static void pathPlannerTask() { - DelayedCallbackSchedule(pathPlannerHandle, PATH_PLANNER_UPDATE_RATE_MS, CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(pathPlannerHandle, PATH_PLANNER_UPDATE_RATE_MS, CALLBACK_UPDATEMODE_SOONER); bool endCondition = false; @@ -332,13 +333,13 @@ static uint8_t checkPathPlan() // callback function when status changed, issue execution of state machine void commandUpdated(__attribute__((unused)) UAVObjEvent *ev) { - DelayedCallbackDispatch(pathDesiredUpdaterHandle); + PIOS_CALLBACKSCHEDULER_Dispatch(pathDesiredUpdaterHandle); } // callback function when waypoints changed in any way, update pathDesired void statusUpdated(__attribute__((unused)) UAVObjEvent *ev) { - DelayedCallbackDispatch(pathPlannerHandle); + PIOS_CALLBACKSCHEDULER_Dispatch(pathPlannerHandle); } diff --git a/flight/modules/StateEstimation/stateestimation.c b/flight/modules/StateEstimation/stateestimation.c index 3c142cdf5..bff326c87 100644 --- a/flight/modules/StateEstimation/stateestimation.c +++ b/flight/modules/StateEstimation/stateestimation.c @@ -31,6 +31,8 @@ #include "inc/stateestimation.h" +#include + #include #include #include @@ -266,7 +268,7 @@ int32_t StateEstimationInitialize(void) stack_required = maxint32_t(stack_required, filterEKF13iInitialize(&ekf13iFilter)); stack_required = maxint32_t(stack_required, filterEKF13Initialize(&ekf13Filter)); - stateEstimationCallback = DelayedCallbackCreate(&StateEstimationCb, CALLBACK_PRIORITY, TASK_PRIORITY, stack_required); + stateEstimationCallback = PIOS_CALLBACKSCHEDULER_Create(&StateEstimationCb, CALLBACK_PRIORITY, TASK_PRIORITY, CALLBACKINFO_RUNNING_STATEESTIMATION, stack_required); return 0; } @@ -305,7 +307,7 @@ static void StateEstimationCb(void) // after system startup, first few sensor readings might be messed up, delay until everything has settled if (bootDelay) { bootDelay--; - DelayedCallbackSchedule(stateEstimationCallback, TIMEOUT_MS, CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(stateEstimationCallback, TIMEOUT_MS, CALLBACK_UPDATEMODE_SOONER); return; } @@ -388,7 +390,7 @@ static void StateEstimationCb(void) // we are not done, re-dispatch self execution runState = RUNSTATE_FILTER; - DelayedCallbackDispatch(stateEstimationCallback); + PIOS_CALLBACKSCHEDULER_Dispatch(stateEstimationCallback); break; case RUNSTATE_FILTER: @@ -405,7 +407,7 @@ static void StateEstimationCb(void) if (!current) { runState = RUNSTATE_SAVE; } - DelayedCallbackDispatch(stateEstimationCallback); + PIOS_CALLBACKSCHEDULER_Dispatch(stateEstimationCallback); break; case RUNSTATE_SAVE: @@ -458,9 +460,9 @@ static void StateEstimationCb(void) // we are done, re-schedule next self execution runState = RUNSTATE_LOAD; if (updatedSensors) { - DelayedCallbackDispatch(stateEstimationCallback); + PIOS_CALLBACKSCHEDULER_Dispatch(stateEstimationCallback); } else { - DelayedCallbackSchedule(stateEstimationCallback, TIMEOUT_MS, CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(stateEstimationCallback, TIMEOUT_MS, CALLBACK_UPDATEMODE_SOONER); } break; } @@ -513,7 +515,7 @@ static void sensorUpdatedCb(UAVObjEvent *ev) updatedSensors |= SENSORUPDATES_airspeed; } - DelayedCallbackDispatch(stateEstimationCallback); + PIOS_CALLBACKSCHEDULER_Dispatch(stateEstimationCallback); } diff --git a/flight/modules/System/systemmod.c b/flight/modules/System/systemmod.c index df2bf7e15..7849211cd 100644 --- a/flight/modules/System/systemmod.c +++ b/flight/modules/System/systemmod.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #if defined(PIOS_INCLUDE_RFM22B) @@ -96,7 +96,7 @@ static uint32_t idleCounter; static uint32_t idleCounterClear; static xTaskHandle systemTaskHandle; static xQueueHandle objectPersistenceQueue; -static bool stackOverflow; +static enum { STACKOVERFLOW_NONE = 0, STACKOVERFLOW_WARNING = 1, STACKOVERFLOW_CRITICAL = 3 } stackOverflow; static bool mallocFailed; static HwSettingsData bootHwSettings; static struct PIOS_FLASHFS_Stats fsStats; @@ -105,6 +105,7 @@ static void objectUpdatedCb(UAVObjEvent *ev); static void hwSettingsUpdatedCb(UAVObjEvent *ev); #ifdef DIAG_TASKS static void taskMonitorForEachCallback(uint16_t task_id, const struct pios_task_info *task_info, void *context); +static void callbackSchedulerForEachCallback(int16_t callback_id, const struct pios_callback_info *callback_info, void *context); #endif static void updateStats(); static void updateSystemAlarms(); @@ -124,7 +125,7 @@ extern uintptr_t pios_user_fs_id; int32_t SystemModStart(void) { // Initialize vars - stackOverflow = false; + stackOverflow = STACKOVERFLOW_NONE; mallocFailed = false; // Create system task xTaskCreate(systemTask, (signed char *)"System", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &systemTaskHandle); @@ -147,6 +148,7 @@ int32_t SystemModInitialize(void) ObjectPersistenceInitialize(); #ifdef DIAG_TASKS TaskInfoInitialize(); + CallbackInfoInitialize(); #endif #ifdef DIAG_I2C_WDG_STATS I2CStatsInitialize(); @@ -175,7 +177,7 @@ static void systemTask(__attribute__((unused)) void *parameters) MODULE_TASKCREATE_ALL; /* start the delayed callback scheduler */ - CallbackSchedulerStart(); + PIOS_CALLBACKSCHEDULER_Start(); if (mallocFailed) { /* We failed to malloc during task creation, @@ -204,6 +206,7 @@ static void systemTask(__attribute__((unused)) void *parameters) #ifdef DIAG_TASKS TaskInfoData taskInfoData; + CallbackInfoData callbackInfoData; #endif // Main system loop @@ -223,6 +226,9 @@ static void systemTask(__attribute__((unused)) void *parameters) // Update the task status object PIOS_TASK_MONITOR_ForEachTask(taskMonitorForEachCallback, &taskInfoData); TaskInfoSet(&taskInfoData); + // Update the callback status object + PIOS_CALLBACKSCHEDULER_ForEachCallback(callbackSchedulerForEachCallback, &callbackInfoData); + CallbackInfoSet(&callbackInfoData); #endif // Flash the heartbeat LED @@ -440,7 +446,26 @@ static void taskMonitorForEachCallback(uint16_t task_id, const struct pios_task_ ((uint16_t *)&taskData->StackRemaining)[task_id] = task_info->stack_remaining; ((uint8_t *)&taskData->RunningTime)[task_id] = task_info->running_time_percentage; } -#endif + +static void callbackSchedulerForEachCallback(int16_t callback_id, const struct pios_callback_info *callback_info, void *context) +{ + CallbackInfoData *callbackData = (CallbackInfoData *)context; + + if (callback_id < 0) { + return; + } + // delayed callback scheduler reports callback stack overflows as remaininng: -1 + if (callback_info->stack_remaining < 0 && stackOverflow == STACKOVERFLOW_NONE) { + stackOverflow = STACKOVERFLOW_WARNING; + } + // By convention, there is a direct mapping between (not negative) callback scheduler callback_id's and members + // of the CallbackInfoXXXXElem enums + PIOS_DEBUG_Assert(callback_id < CALLBACKINFO_RUNNING_NUMELEM); + ((uint8_t *)&callbackData->Running)[callback_id] = callback_info->is_running; + ((uint32_t *)&callbackData->RunningTime)[callback_id] = callback_info->running_time_count; + ((int16_t *)&callbackData->StackRemaining)[callback_id] = callback_info->stack_remaining; +} +#endif /* ifdef DIAG_TASKS */ /** * Called periodically to update the I2C statistics @@ -602,10 +627,15 @@ static void updateSystemAlarms() } // Check for stack overflow - if (stackOverflow) { - AlarmsSet(SYSTEMALARMS_ALARM_STACKOVERFLOW, SYSTEMALARMS_ALARM_CRITICAL); - } else { + switch (stackOverflow) { + case STACKOVERFLOW_NONE: AlarmsClear(SYSTEMALARMS_ALARM_STACKOVERFLOW); + break; + case STACKOVERFLOW_WARNING: + AlarmsSet(SYSTEMALARMS_ALARM_STACKOVERFLOW, SYSTEMALARMS_ALARM_WARNING); + break; + default: + AlarmsSet(SYSTEMALARMS_ALARM_STACKOVERFLOW, SYSTEMALARMS_ALARM_CRITICAL); } // Check for event errors @@ -650,7 +680,7 @@ void vApplicationIdleHook(void) void vApplicationStackOverflowHook(__attribute__((unused)) xTaskHandle *pxTask, __attribute__((unused)) signed portCHAR *pcTaskName) { - stackOverflow = true; + stackOverflow = STACKOVERFLOW_CRITICAL; #if DEBUG_STACK_OVERFLOW static volatile bool wait_here = true; while (wait_here) { diff --git a/flight/uavobjects/callbackscheduler.c b/flight/pios/common/pios_callbackscheduler.c similarity index 71% rename from flight/uavobjects/callbackscheduler.c rename to flight/pios/common/pios_callbackscheduler.c index f0f666a15..9c13138c8 100644 --- a/flight/uavobjects/callbackscheduler.c +++ b/flight/pios/common/pios_callbackscheduler.c @@ -1,7 +1,7 @@ /** ****************************************************************************** * - * @file callbackscheduler.c + * @file pios_callbackscheduler.c * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013. * @brief Scheduler to run callback functions from a shared context with given priorities. * @@ -24,13 +24,18 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include +#ifdef PIOS_INCLUDE_CALLBACKSCHEDULER +#include +#include #include // Private constants -#define STACK_SIZE 128 -#define MAX_SLEEP 1000 +#define STACK_SAFETYCOUNT 16 +#define STACK_SIZE (384 + STACK_SAFETYSIZE) +#define STACK_SAFETYSIZE 8 +#define MAX_SLEEP 1000 // Private types /** @@ -52,8 +57,15 @@ struct DelayedCallbackTaskStruct { */ struct DelayedCallbackInfoStruct { DelayedCallback cb; + int16_t callbackID; bool volatile waiting; uint32_t volatile scheduletime; + uint32_t stackSize; + int32_t stackFree; + int32_t stackNotFree; + uint16_t stackSafetyCount; + uint16_t currentSafetyCount; + uint32_t runCount; struct DelayedCallbackTaskStruct *task; struct DelayedCallbackInfoStruct *next; }; @@ -73,7 +85,7 @@ static int32_t runNextCallback(struct DelayedCallbackTaskStruct *task, DelayedCa * must be called before any other functions are called * \return Success (0), failure (-1) */ -int32_t CallbackSchedulerInitialize() +int32_t PIOS_CALLBACKSCHEDULER_Initialize() { // Initialize variables schedulerTasks = NULL; @@ -99,7 +111,7 @@ int32_t CallbackSchedulerInitialize() * they can be marked for later execution by executing the dispatch function. * \return Success (0), failure (-1) */ -int32_t CallbackSchedulerStart() +int32_t PIOS_CALLBACKSCHEDULER_Start() { xSemaphoreTakeRecursive(mutex, portMAX_DELAY); @@ -113,7 +125,7 @@ int32_t CallbackSchedulerStart() xTaskCreate( CallbackSchedulerTask, cursor->name, - cursor->stackSize / 4, + 1 + (cursor->stackSize / 4), cursor, cursor->priorityTask, &cursor->callbackSchedulerTaskHandle @@ -143,7 +155,7 @@ int32_t CallbackSchedulerStart() * UPDATEMODE_OVERRIDE: The callback will be rescheduled in any case, effectively overriding any previous schedule. (sooner+later=override) * \return 0: not scheduled, previous schedule takes precedence, 1: new schedule, 2: previous schedule overridden */ -int32_t DelayedCallbackSchedule( +int32_t PIOS_CALLBACKSCHEDULER_Schedule( DelayedCallbackInfo *cbinfo, int32_t milliseconds, DelayedCallbackUpdateMode updatemode) @@ -191,7 +203,7 @@ int32_t DelayedCallbackSchedule( * \param[in] cbinfo the callback handle * \return Success (-1), failure (0) */ -int32_t DelayedCallbackDispatch(DelayedCallbackInfo *cbinfo) +int32_t PIOS_CALLBACKSCHEDULER_Dispatch(DelayedCallbackInfo *cbinfo) { PIOS_Assert(cbinfo); @@ -215,7 +227,7 @@ int32_t DelayedCallbackDispatch(DelayedCallbackInfo *cbinfo) * Check the demo task for your port to find the syntax required. * \return Success (-1), failure (0) */ -int32_t DelayedCallbackDispatchFromISR(DelayedCallbackInfo *cbinfo, long *pxHigherPriorityTaskWoken) +int32_t PIOS_CALLBACKSCHEDULER_DispatchFromISR(DelayedCallbackInfo *cbinfo, long *pxHigherPriorityTaskWoken) { PIOS_Assert(cbinfo); @@ -237,14 +249,18 @@ int32_t DelayedCallbackDispatchFromISR(DelayedCallbackInfo *cbinfo, long *pxHigh * \param[in] stacksize The stack requirements of the callback when called by the scheduler. * \return CallbackInfo Pointer on success, NULL if failed. */ -DelayedCallbackInfo *DelayedCallbackCreate( +DelayedCallbackInfo *PIOS_CALLBACKSCHEDULER_Create( DelayedCallback cb, DelayedCallbackPriority priority, DelayedCallbackPriorityTask priorityTask, + int16_t callbackID, uint32_t stacksize) { xSemaphoreTakeRecursive(mutex, portMAX_DELAY); + // add callback schedulers own stack requirements + stacksize += STACK_SIZE; + // find appropriate scheduler task matching priorityTask struct DelayedCallbackTaskStruct *task = NULL; int t = 0; @@ -271,7 +287,7 @@ DelayedCallbackInfo *DelayedCallbackCreate( task->name[0] = 'C'; task->name[1] = 'a' + t; task->name[2] = 0; - task->stackSize = ((STACK_SIZE > stacksize) ? STACK_SIZE : stacksize); + task->stackSize = stacksize; task->priorityTask = priorityTask; task->next = NULL; @@ -285,13 +301,13 @@ DelayedCallbackInfo *DelayedCallbackCreate( // add to list of scheduler tasks LL_APPEND(schedulerTasks, task); - // Previously registered tasks are spawned when CallbackSchedulerStart() is called. + // Previously registered tasks are spawned when PIOS_CALLBACKSCHEDULER_Start() is called. // Tasks registered afterwards need to spawn upon creation. if (schedulerStarted) { xTaskCreate( CallbackSchedulerTask, task->name, - task->stackSize / 4, + 1 + (task->stackSize / 4), task, task->priorityTask, &task->callbackSchedulerTaskHandle @@ -318,11 +334,18 @@ DelayedCallbackInfo *DelayedCallbackCreate( xSemaphoreGiveRecursive(mutex); return NULL; // error - not enough memory } - info->next = NULL; - info->waiting = false; - info->scheduletime = 0; - info->task = task; + info->next = NULL; + info->waiting = false; + info->scheduletime = 0; + info->task = task; info->cb = cb; + info->callbackID = callbackID; + info->runCount = 0; + info->stackSize = stacksize - STACK_SIZE; + info->stackNotFree = info->stackSize; + info->stackFree = 0; + info->stackSafetyCount = STACK_SAFETYCOUNT; + info->currentSafetyCount = 0; // add to scheduling queue LL_APPEND(task->callbackQueue[priority], info); @@ -332,6 +355,108 @@ DelayedCallbackInfo *DelayedCallbackCreate( return info; } +/** + * Iterator. Iterates over all callbacks and all scheduler tasks and retrieves information + * + * @param[in] callback Callback function to receive the data - will be called in same task context as the callerThe id of the task the task_info refers to. + * @param context Context information optionally provided to the callback. + */ +void PIOS_CALLBACKSCHEDULER_ForEachCallback(CallbackSchedulerCallbackInfoCallback callback, void *context) +{ + if (!callback) { + return; + } + + struct pios_callback_info info; + + struct DelayedCallbackTaskStruct *task = NULL; + LL_FOREACH(schedulerTasks, task) { + int prio; + + for (prio = 0; prio < (CALLBACK_PRIORITY_LOW + 1); prio++) { + struct DelayedCallbackInfoStruct *cbinfo; + LL_FOREACH(task->callbackQueue[prio], cbinfo) { + xSemaphoreTakeRecursive(mutex, portMAX_DELAY); + info.is_running = true; + info.stack_remaining = cbinfo->stackNotFree; + info.running_time_count = cbinfo->runCount; + xSemaphoreGiveRecursive(mutex); + callback(cbinfo->callbackID, &info, context); + } + } + } +} + +/** + * Stack magic, find how much stack is being used without affecting performance + */ +static void markStack(DelayedCallbackInfo *current) +{ + register int8_t t; + register int32_t halfWayMark; + volatile unsigned char *marker; + + if (current->stackNotFree < 0) { + return; + } + + // end of stack watermark + marker = (unsigned char *)(((size_t)&marker) - (size_t)current->stackSize); + for (t = -STACK_SAFETYSIZE; t < 0; t++) { + *(marker + t) = '#'; + } + // shifted watermarks + halfWayMark = current->stackFree + (current->stackNotFree - current->stackFree) / 2; + marker = (unsigned char *)((size_t)marker + halfWayMark); + for (t = -STACK_SAFETYSIZE; t < 0; t++) { + *(marker + t) = '#'; + } +} +static void checkStack(DelayedCallbackInfo *current) +{ + register int8_t t; + register int32_t halfWayMark; + volatile unsigned char *marker; + + if (current->stackNotFree < 0) { + return; + } + + // end of stack watermark + marker = (unsigned char *)(((size_t)&marker) - (size_t)current->stackSize); + for (t = -STACK_SAFETYSIZE; t < 0; t++) { + if (*(marker + t) != '#') { + current->stackNotFree = -1; // stack overflow, disable all further checks + return; + } + } + // shifted watermarks + halfWayMark = current->stackFree + (current->stackNotFree - current->stackFree) / 2; + marker = (unsigned char *)((size_t)marker + halfWayMark); + for (t = -STACK_SAFETYSIZE; t < 0; t++) { + if (*(marker + t) != '#') { + current->stackNotFree = halfWayMark; // tainted mark, this place is definitely used stack + current->currentSafetyCount = 0; + if (current->stackNotFree <= current->stackFree) { + current->stackFree = 0; // if it was supposed to be free, restart search between here and bottom of stack + } + return; + } + } + + if (current->currentSafetyCount < 0xffff) { + current->currentSafetyCount++; // mark has not been tainted, increase safety counter + } + if (current->currentSafetyCount >= current->stackSafetyCount) { // if the safety counter is above the limit, then + if (halfWayMark == current->stackFree) { // check if search already converged, if so increase the limit to find very rare stack usage incidents + current->stackSafetyCount = current->currentSafetyCount; + } else { + current->stackFree = halfWayMark; // otherwise just mark this position as free stack to narrow search + current->currentSafetyCount = 0; + } + } +} + /** * Scheduler subtask * \param[in] task The scheduler task in question @@ -384,7 +509,16 @@ static int32_t runNextCallback(struct DelayedCallbackTaskStruct *task, DelayedCa current->scheduletime = 0; // any schedules are reset current->waiting = false; // the flag is reset just before execution. xSemaphoreGiveRecursive(mutex); + + /* callback gets invoked here - check stack sizes */ + markStack(current); + current->cb(); // call the callback + + checkStack(current); + + current->runCount++; + return 0; } xSemaphoreGiveRecursive(mutex); @@ -411,3 +545,5 @@ static void CallbackSchedulerTask(void *task) } } } + +#endif // ifdef PIOS_INCLUDE_CALLBACKSCHEDULER diff --git a/flight/uavobjects/inc/callbackscheduler.h b/flight/pios/inc/pios_callbackscheduler.h similarity index 79% rename from flight/uavobjects/inc/callbackscheduler.h rename to flight/pios/inc/pios_callbackscheduler.h index 8dfd7b682..7fc883cad 100644 --- a/flight/uavobjects/inc/callbackscheduler.h +++ b/flight/pios/inc/pios_callbackscheduler.h @@ -1,9 +1,9 @@ /** ****************************************************************************** * - * @file callbackscheduler.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Include files of the uavobjectlist library + * @file pios_callbackscheduler.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014. + * @brief Include files of the PIOS_CALLBACKSCHEDULER * @see The GNU Public License (GPL) Version 3 * *****************************************************************************/ @@ -23,8 +23,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef CALLBACKSCHEDULER_H -#define CALLBACKSCHEDULER_H +#ifndef PIOS_CALLBACKSCHEDULER_H +#define PIOS_CALLBACKSCHEDULER_H // Public types typedef enum { @@ -48,7 +48,7 @@ typedef enum { // ...ABcABdABxABcABdAByABcABdABxABcABdABy... // However if only the 3 callbacks, A, c and x want to execute, you will get: // ...AcAxAcAxAcAxAcAxAcAxAcAxAcAxAcAxAcAx... -// And if onlz A and y need execution it will be: +// And if only A and y need execution it will be: // ...AyAyAyAyAyAyAyAyAyAyAyAyAyAyAyAyAyAy... // despite their different priority they would get treated equally in this case. // @@ -113,7 +113,7 @@ typedef struct DelayedCallbackInfoStruct DelayedCallbackInfo; * must be called before any other functions are called * \return Success (0), failure (-1) */ -int32_t CallbackSchedulerInitialize(); +int32_t PIOS_CALLBACKSCHEDULER_Initialize(); /** * Start all scheduler tasks @@ -125,7 +125,7 @@ int32_t CallbackSchedulerInitialize(); * they can be marked for later execution by executing the dispatch function. * \return Success (0), failure (-1) */ -int32_t CallbackSchedulerStart(); +int32_t PIOS_CALLBACKSCHEDULER_Start(); /** * Register a new callback to be called by a delayed callback scheduler task. @@ -135,12 +135,14 @@ int32_t CallbackSchedulerStart(); * \param[in] priority Priority of the callback compared to other callbacks scheduled by the same delayed callback scheduler task. * \param[in] priorityTask Task priority of the scheduler task. One scheduler task will be spawned for each distinct value specified, further callbacks created with the same priorityTask will all be handled by the same delayed callback scheduler task and scheduled according to their individual callback priorities * \param[in] stacksize The stack requirements of the callback when called by the scheduler. + * \param[in] callbackID - CallbackInfoRunningElem from CallbackInfo UAVObject, unique identified to collect stats for the callback, -1 to ignore! * \return CallbackInfo Pointer on success, NULL if failed. */ -DelayedCallbackInfo *DelayedCallbackCreate( +DelayedCallbackInfo *PIOS_CALLBACKSCHEDULER_Create( DelayedCallback cb, DelayedCallbackPriority priority, DelayedCallbackPriorityTask priorityTask, + int16_t callbackID, uint32_t stacksize); /** @@ -155,7 +157,7 @@ DelayedCallbackInfo *DelayedCallbackCreate( * UPDATEMODE_OVERRIDE: The callback will be rescheduled in any case, effectively overriding any previous schedule. (sooner+later=override) * \return 0: not scheduled, previous schedule takes precedence, 1: new schedule, 2: previous schedule overridden */ -int32_t DelayedCallbackSchedule( +int32_t PIOS_CALLBACKSCHEDULER_Schedule( DelayedCallbackInfo *cbinfo, int32_t milliseconds, DelayedCallbackUpdateMode updatemode); @@ -166,7 +168,7 @@ int32_t DelayedCallbackSchedule( * \param[in] *cbinfo the callback handle * \return Success (-1), failure (0) */ -int32_t DelayedCallbackDispatch(DelayedCallbackInfo *cbinfo); +int32_t PIOS_CALLBACKSCHEDULER_Dispatch(DelayedCallbackInfo *cbinfo); /** * Dispatch an event by invoking the supplied callback. The function @@ -182,6 +184,36 @@ int32_t DelayedCallbackDispatch(DelayedCallbackInfo *cbinfo); * Check the demo task for your port to find the syntax required. * \return Success (-1), failure (0) */ -int32_t DelayedCallbackDispatchFromISR(DelayedCallbackInfo *cbinfo, long *pxHigherPriorityTaskWoken); +int32_t PIOS_CALLBACKSCHEDULER_DispatchFromISR(DelayedCallbackInfo *cbinfo, long *pxHigherPriorityTaskWoken); -#endif // CALLBACKSCHEDULER_H +/** + * Information about a running callback that has been registered + * via a call to PIOS_CALLBACKSCHEDULER_Create(). + */ +struct pios_callback_info { + /** Remaining task stack in bytes -1 for detected stack overflow. */ + int32_t stack_remaining; + /** Flag indicating whether or not the task is running. */ + bool is_running; + /** Count of executions of the callback since system start */ + uint32_t running_time_count; +}; + +/** + * Iterator callback, called for each monitored callback by PIOS_CALLBACKSCHEDULER_ForEachCallback(). + * + * @param task_id The id of the task the task_info refers to. + * @param task_info Information about the task identified by task_id. + * @param context Context information optionally provided by the caller to PIOS_TASK_MONITOR_TasksIterate() + */ +typedef void (*CallbackSchedulerCallbackInfoCallback)(int16_t task_id, const struct pios_callback_info *callback_info, void *context); + +/** + * Iterator. Iterates over all callbacks and all scheduler tasks and retrieves information + * + * @param[in] callback Callback function to receive the data - will be called in same task context as the callerThe id of the task the task_info refers to. + * @param context Context information optionally provided to the callback. + */ +void PIOS_CALLBACKSCHEDULER_ForEachCallback(CallbackSchedulerCallbackInfoCallback callback, void *context); + +#endif // PIOS_CALLBACKSCHEDULER_H diff --git a/flight/pios/pios.h b/flight/pios/pios.h index c1371d866..15cdc294e 100644 --- a/flight/pios/pios.h +++ b/flight/pios/pios.h @@ -93,6 +93,14 @@ #include #endif +/* PIOS CallbackScheduler */ +#ifdef PIOS_INCLUDE_CALLBACKSCHEDULER +#ifndef PIOS_INCLUDE_FREERTOS +#error PiOS CallbackScheduler requires PIOS_INCLUDE_FREERTOS to be defined +#endif +#include +#endif + /* PIOS bootloader helper */ #ifdef PIOS_INCLUDE_BL_HELPER /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */ diff --git a/flight/pios/pios_sim_posix.h b/flight/pios/pios_sim_posix.h index 5b378eb46..ecc02e1cb 100644 --- a/flight/pios/pios_sim_posix.h +++ b/flight/pios/pios_sim_posix.h @@ -47,6 +47,14 @@ #include #endif +/* PIOS CallbackScheduler */ +#ifdef PIOS_INCLUDE_CALLBACKSCHEDULER +#ifndef PIOS_INCLUDE_FREERTOS +#error PiOS CallbackScheduler requires PIOS_INCLUDE_FREERTOS to be defined +#endif +#include +#endif + /* C Lib Includes */ #include #include diff --git a/flight/targets/boards/coptercontrol/firmware/Makefile b/flight/targets/boards/coptercontrol/firmware/Makefile index f8534da9a..e2fab1dd3 100644 --- a/flight/targets/boards/coptercontrol/firmware/Makefile +++ b/flight/targets/boards/coptercontrol/firmware/Makefile @@ -70,7 +70,6 @@ ifndef TESTAPP SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c - SRC += $(OPUAVOBJ)/callbackscheduler.c ## UAVObjects SRC += $(OPUAVSYNTHDIR)/accessorydesired.c @@ -112,6 +111,7 @@ ifndef TESTAPP SRC += $(OPUAVSYNTHDIR)/relaytuningsettings.c SRC += $(OPUAVSYNTHDIR)/relaytuning.c SRC += $(OPUAVSYNTHDIR)/taskinfo.c + SRC += $(OPUAVSYNTHDIR)/callbackinfo.c SRC += $(OPUAVSYNTHDIR)/mixerstatus.c SRC += $(OPUAVSYNTHDIR)/ratedesired.c SRC += $(OPUAVSYNTHDIR)/barosensor.c diff --git a/flight/targets/boards/coptercontrol/firmware/inc/openpilot.h b/flight/targets/boards/coptercontrol/firmware/inc/openpilot.h index 963014e21..26cfb9a98 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/openpilot.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/openpilot.h @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "alarms.h" diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h index ea94abb02..2b9417616 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h @@ -43,6 +43,10 @@ /* PIOS FreeRTOS support */ #define PIOS_INCLUDE_FREERTOS + +/* PIOS CallbackScheduler support */ +#define PIOS_INCLUDE_CALLBACKSCHEDULER + /* PIOS bootloader helper */ #define PIOS_INCLUDE_BL_HELPER /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */ diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h index eda0a2511..4e8aa47c6 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h @@ -34,6 +34,7 @@ #define PIOS_INCLUDE_DELAY #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_FREERTOS +#define PIOS_INCLUDE_CALLBACKSCHEDULER #define PIOS_INCLUDE_TASK_MONITOR #define PIOS_INCLUDE_COM #define PIOS_INCLUDE_UDP diff --git a/flight/targets/boards/coptercontrol/firmware/pios_board.c b/flight/targets/boards/coptercontrol/firmware/pios_board.c index 194387fdc..4026343ae 100644 --- a/flight/targets/boards/coptercontrol/firmware/pios_board.c +++ b/flight/targets/boards/coptercontrol/firmware/pios_board.c @@ -198,7 +198,7 @@ void PIOS_Board_Init(void) } /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/coptercontrol/firmware/pios_board_posix.c b/flight/targets/boards/coptercontrol/firmware/pios_board_posix.c index 7487a17aa..7fa958a38 100644 --- a/flight/targets/boards/coptercontrol/firmware/pios_board_posix.c +++ b/flight/targets/boards/coptercontrol/firmware/pios_board_posix.c @@ -39,7 +39,7 @@ void PIOS_Board_Init(void) PIOS_DELAY_Init(); /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/oplinkmini/firmware/Makefile b/flight/targets/boards/oplinkmini/firmware/Makefile index 3a9c6b113..1768b6ba7 100644 --- a/flight/targets/boards/oplinkmini/firmware/Makefile +++ b/flight/targets/boards/oplinkmini/firmware/Makefile @@ -46,7 +46,6 @@ ifndef TESTAPP SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c - SRC += $(OPUAVOBJ)/callbackscheduler.c ## UAVObjects SRC += $(OPUAVSYNTHDIR)/oplinkstatus.c diff --git a/flight/targets/boards/oplinkmini/firmware/inc/openpilot.h b/flight/targets/boards/oplinkmini/firmware/inc/openpilot.h index 3cceef152..89e1e909c 100644 --- a/flight/targets/boards/oplinkmini/firmware/inc/openpilot.h +++ b/flight/targets/boards/oplinkmini/firmware/inc/openpilot.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include "alarms.h" diff --git a/flight/targets/boards/oplinkmini/firmware/inc/pios_config.h b/flight/targets/boards/oplinkmini/firmware/inc/pios_config.h index ef965b0af..8dd30c0f3 100644 --- a/flight/targets/boards/oplinkmini/firmware/inc/pios_config.h +++ b/flight/targets/boards/oplinkmini/firmware/inc/pios_config.h @@ -43,6 +43,9 @@ /* PIOS FreeRTOS support */ #define PIOS_INCLUDE_FREERTOS +/* PIOS CallbackScheduler support */ +#define PIOS_INCLUDE_CALLBACKSCHEDULER + /* PIOS bootloader helper */ #define PIOS_INCLUDE_BL_HELPER /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */ diff --git a/flight/targets/boards/oplinkmini/firmware/inc/pios_config_posix.h b/flight/targets/boards/oplinkmini/firmware/inc/pios_config_posix.h index ecedcf3ce..82712de0d 100644 --- a/flight/targets/boards/oplinkmini/firmware/inc/pios_config_posix.h +++ b/flight/targets/boards/oplinkmini/firmware/inc/pios_config_posix.h @@ -34,6 +34,7 @@ #define PIOS_INCLUDE_DELAY #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_FREERTOS +#define PIOS_INCLUDE_CALLBACKSCHEDULER #define PIOS_INCLUDE_TASK_MONITOR #define PIOS_INCLUDE_COM #define PIOS_INCLUDE_UDP diff --git a/flight/targets/boards/oplinkmini/firmware/pios_board.c b/flight/targets/boards/oplinkmini/firmware/pios_board.c index 85b3a9939..56adfb4f1 100644 --- a/flight/targets/boards/oplinkmini/firmware/pios_board.c +++ b/flight/targets/boards/oplinkmini/firmware/pios_board.c @@ -106,7 +106,7 @@ void PIOS_Board_Init(void) } /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/oplinkmini/firmware/pios_board_posix.c b/flight/targets/boards/oplinkmini/firmware/pios_board_posix.c index 7487a17aa..7fa958a38 100644 --- a/flight/targets/boards/oplinkmini/firmware/pios_board_posix.c +++ b/flight/targets/boards/oplinkmini/firmware/pios_board_posix.c @@ -39,7 +39,7 @@ void PIOS_Board_Init(void) PIOS_DELAY_Init(); /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/osd/firmware/Makefile b/flight/targets/boards/osd/firmware/Makefile index 90bc9618e..14d863b1b 100644 --- a/flight/targets/boards/osd/firmware/Makefile +++ b/flight/targets/boards/osd/firmware/Makefile @@ -55,7 +55,6 @@ ifndef TESTAPP SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c - SRC += $(OPUAVOBJ)/callbackscheduler.c ## OSD fonts SRC += $(OPSYSTEM)/fonts.c @@ -84,6 +83,7 @@ ifndef TESTAPP SRC += $(OPUAVSYNTHDIR)/firmwareiapobj.c SRC += $(OPUAVSYNTHDIR)/hwsettings.c SRC += $(OPUAVSYNTHDIR)/taskinfo.c + SRC += $(OPUAVSYNTHDIR)/callbackinfo.c SRC += $(OPUAVSYNTHDIR)/mixerstatus.c SRC += $(OPUAVSYNTHDIR)/homelocation.c SRC += $(OPUAVSYNTHDIR)/gpspositionsensor.c diff --git a/flight/targets/boards/osd/firmware/inc/openpilot.h b/flight/targets/boards/osd/firmware/inc/openpilot.h index 76cc3ccd6..54e6a5d30 100644 --- a/flight/targets/boards/osd/firmware/inc/openpilot.h +++ b/flight/targets/boards/osd/firmware/inc/openpilot.h @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "alarms.h" diff --git a/flight/targets/boards/osd/firmware/inc/pios_config.h b/flight/targets/boards/osd/firmware/inc/pios_config.h index 1ad6f6629..33542a953 100644 --- a/flight/targets/boards/osd/firmware/inc/pios_config.h +++ b/flight/targets/boards/osd/firmware/inc/pios_config.h @@ -43,6 +43,9 @@ /* PIOS FreeRTOS support */ #define PIOS_INCLUDE_FREERTOS +/* PIOS CallbackScheduler support */ +#define PIOS_INCLUDE_CALLBACKSCHEDULER + /* PIOS bootloader helper */ #define PIOS_INCLUDE_BL_HELPER /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */ diff --git a/flight/targets/boards/osd/firmware/pios_board.c b/flight/targets/boards/osd/firmware/pios_board.c index ffaa1dd36..0c45ddfdc 100644 --- a/flight/targets/boards/osd/firmware/pios_board.c +++ b/flight/targets/boards/osd/firmware/pios_board.c @@ -178,7 +178,7 @@ void PIOS_Board_Init(void) } /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/revolution/firmware/Makefile b/flight/targets/boards/revolution/firmware/Makefile index 3202b2e1e..26b49d13a 100644 --- a/flight/targets/boards/revolution/firmware/Makefile +++ b/flight/targets/boards/revolution/firmware/Makefile @@ -73,7 +73,6 @@ ifndef TESTAPP SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c - SRC += $(OPUAVOBJ)/callbackscheduler.c #ifeq ($(DEBUG), YES) SRC += $(OPSYSTEM)/dcc_stdio.c diff --git a/flight/targets/boards/revolution/firmware/Makefile.osx b/flight/targets/boards/revolution/firmware/Makefile.osx index e5da5da2a..732164a60 100644 --- a/flight/targets/boards/revolution/firmware/Makefile.osx +++ b/flight/targets/boards/revolution/firmware/Makefile.osx @@ -141,7 +141,6 @@ SRC += $(OPSYSTEM)/alarms.c SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c -SRC += $(OPUAVOBJ)/callbackscheduler.c SRC += $(UAVOBJSYNTHDIR)/uavobjectsinit.c else ## TESTCODE diff --git a/flight/targets/boards/revolution/firmware/UAVObjects.inc b/flight/targets/boards/revolution/firmware/UAVObjects.inc index a0e668138..8e33bb8c1 100644 --- a/flight/targets/boards/revolution/firmware/UAVObjects.inc +++ b/flight/targets/boards/revolution/firmware/UAVObjects.inc @@ -90,6 +90,7 @@ UAVOBJSRCFILENAMES += systemalarms UAVOBJSRCFILENAMES += systemsettings UAVOBJSRCFILENAMES += systemstats UAVOBJSRCFILENAMES += taskinfo +UAVOBJSRCFILENAMES += callbackinfo UAVOBJSRCFILENAMES += velocitystate UAVOBJSRCFILENAMES += velocitydesired UAVOBJSRCFILENAMES += watchdogstatus diff --git a/flight/targets/boards/revolution/firmware/inc/openpilot.h b/flight/targets/boards/revolution/firmware/inc/openpilot.h index 3cceef152..89e1e909c 100644 --- a/flight/targets/boards/revolution/firmware/inc/openpilot.h +++ b/flight/targets/boards/revolution/firmware/inc/openpilot.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include "alarms.h" diff --git a/flight/targets/boards/revolution/firmware/inc/pios_config.h b/flight/targets/boards/revolution/firmware/inc/pios_config.h index fbaff9438..6ad54cc7e 100644 --- a/flight/targets/boards/revolution/firmware/inc/pios_config.h +++ b/flight/targets/boards/revolution/firmware/inc/pios_config.h @@ -43,6 +43,9 @@ /* PIOS FreeRTOS support */ #define PIOS_INCLUDE_FREERTOS +/* PIOS Callback Scheduler support */ +#define PIOS_INCLUDE_CALLBACKSCHEDULER + /* PIOS bootloader helper */ #define PIOS_INCLUDE_BL_HELPER /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */ diff --git a/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h b/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h index 293516522..c74e0d2f7 100644 --- a/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h +++ b/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h @@ -35,6 +35,7 @@ #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_FREERTOS +#define PIOS_INCLUDE_CALLBACKSCHEDULER #define PIOS_INCLUDE_TASK_MONITOR #define PIOS_INCLUDE_COM // #define PIOS_INCLUDE_GPS diff --git a/flight/targets/boards/revolution/firmware/pios_board.c b/flight/targets/boards/revolution/firmware/pios_board.c index 15b667214..262fcf899 100644 --- a/flight/targets/boards/revolution/firmware/pios_board.c +++ b/flight/targets/boards/revolution/firmware/pios_board.c @@ -404,7 +404,7 @@ void PIOS_Board_Init(void) } /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/revolution/firmware/pios_board_sim.c b/flight/targets/boards/revolution/firmware/pios_board_sim.c index 4a9453efb..2171be22c 100644 --- a/flight/targets/boards/revolution/firmware/pios_board_sim.c +++ b/flight/targets/boards/revolution/firmware/pios_board_sim.c @@ -132,7 +132,7 @@ void PIOS_Board_Init(void) PIOS_DELAY_Init(); /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/revoproto/firmware/Makefile b/flight/targets/boards/revoproto/firmware/Makefile index 73dc7acd6..f8f72e0c5 100644 --- a/flight/targets/boards/revoproto/firmware/Makefile +++ b/flight/targets/boards/revoproto/firmware/Makefile @@ -71,7 +71,6 @@ ifndef TESTAPP SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c - SRC += $(OPUAVOBJ)/callbackscheduler.c #ifeq ($(DEBUG), YES) SRC += $(OPSYSTEM)/dcc_stdio.c diff --git a/flight/targets/boards/revoproto/firmware/Makefile.osx b/flight/targets/boards/revoproto/firmware/Makefile.osx index ce2ff7938..d7f29ee4c 100644 --- a/flight/targets/boards/revoproto/firmware/Makefile.osx +++ b/flight/targets/boards/revoproto/firmware/Makefile.osx @@ -145,7 +145,6 @@ SRC += $(OPSYSTEM)/alarms.c SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c -SRC += $(OPUAVOBJ)/callbackscheduler.c SRC += $(UAVOBJSYNTHDIR)/uavobjectsinit.c diff --git a/flight/targets/boards/revoproto/firmware/UAVObjects.inc b/flight/targets/boards/revoproto/firmware/UAVObjects.inc index f93429e80..a925f36d4 100644 --- a/flight/targets/boards/revoproto/firmware/UAVObjects.inc +++ b/flight/targets/boards/revoproto/firmware/UAVObjects.inc @@ -90,6 +90,7 @@ UAVOBJSRCFILENAMES += systemalarms UAVOBJSRCFILENAMES += systemsettings UAVOBJSRCFILENAMES += systemstats UAVOBJSRCFILENAMES += taskinfo +UAVOBJSRCFILENAMES += callbackinfo UAVOBJSRCFILENAMES += velocitystate UAVOBJSRCFILENAMES += velocitydesired UAVOBJSRCFILENAMES += watchdogstatus diff --git a/flight/targets/boards/revoproto/firmware/inc/openpilot.h b/flight/targets/boards/revoproto/firmware/inc/openpilot.h index 3cceef152..89e1e909c 100644 --- a/flight/targets/boards/revoproto/firmware/inc/openpilot.h +++ b/flight/targets/boards/revoproto/firmware/inc/openpilot.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include "alarms.h" diff --git a/flight/targets/boards/revoproto/firmware/inc/pios_config.h b/flight/targets/boards/revoproto/firmware/inc/pios_config.h index c8e3d340c..6077225aa 100644 --- a/flight/targets/boards/revoproto/firmware/inc/pios_config.h +++ b/flight/targets/boards/revoproto/firmware/inc/pios_config.h @@ -43,6 +43,9 @@ /* PIOS FreeRTOS support */ #define PIOS_INCLUDE_FREERTOS +/* PIOS Callback Scheduler support */ +#define PIOS_INCLUDE_CALLBACKSCHEDULER + /* PIOS bootloader helper */ #define PIOS_INCLUDE_BL_HELPER /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */ diff --git a/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h b/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h index 56470b59b..cb2061837 100644 --- a/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h +++ b/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h @@ -35,6 +35,7 @@ #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_FREERTOS +#define PIOS_INCLUDE_CALLBACKSCHEDULER #define PIOS_INCLUDE_TASK_MONITOR #define PIOS_INCLUDE_COM // #define PIOS_INCLUDE_GPS diff --git a/flight/targets/boards/revoproto/firmware/pios_board.c b/flight/targets/boards/revoproto/firmware/pios_board.c index ed142f951..9206a3f24 100644 --- a/flight/targets/boards/revoproto/firmware/pios_board.c +++ b/flight/targets/boards/revoproto/firmware/pios_board.c @@ -444,7 +444,7 @@ void PIOS_Board_Init(void) } /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/revoproto/firmware/pios_board_sim.c b/flight/targets/boards/revoproto/firmware/pios_board_sim.c index 401d4be57..a99f0b3e8 100644 --- a/flight/targets/boards/revoproto/firmware/pios_board_sim.c +++ b/flight/targets/boards/revoproto/firmware/pios_board_sim.c @@ -132,7 +132,7 @@ void PIOS_Board_Init(void) PIOS_DELAY_Init(); /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/targets/boards/simposix/firmware/Makefile b/flight/targets/boards/simposix/firmware/Makefile index 221580e7f..beda566a8 100644 --- a/flight/targets/boards/simposix/firmware/Makefile +++ b/flight/targets/boards/simposix/firmware/Makefile @@ -85,7 +85,6 @@ SRC += $(FLIGHTLIB)/alarms.c SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c -SRC += $(OPUAVOBJ)/callbackscheduler.c SRC += $(UAVOBJSYNTHDIR)/uavobjectsinit.c SRC += $(FLIGHTLIB)/CoordinateConversions.c @@ -101,6 +100,7 @@ SRC += $(MATHLIB)/pid.c SRC += $(PIOSCORECOMMON)/pios_task_monitor.c SRC += $(PIOSCORECOMMON)/pios_dosfs_logfs.c SRC += $(PIOSCORECOMMON)/pios_debuglog.c +SRC += $(PIOSCORECOMMON)/pios_callbackscheduler.c SRC += $(PIOSCORECOMMON)/pios_deltatime.c ## PIOS Hardware diff --git a/flight/targets/boards/simposix/firmware/UAVObjects.inc b/flight/targets/boards/simposix/firmware/UAVObjects.inc index 44a9828c6..318137d47 100644 --- a/flight/targets/boards/simposix/firmware/UAVObjects.inc +++ b/flight/targets/boards/simposix/firmware/UAVObjects.inc @@ -90,6 +90,7 @@ UAVOBJSRCFILENAMES += systemalarms UAVOBJSRCFILENAMES += systemsettings UAVOBJSRCFILENAMES += systemstats UAVOBJSRCFILENAMES += taskinfo +UAVOBJSRCFILENAMES += callbackinfo UAVOBJSRCFILENAMES += velocitystate UAVOBJSRCFILENAMES += velocitydesired UAVOBJSRCFILENAMES += watchdogstatus diff --git a/flight/targets/boards/simposix/firmware/inc/openpilot.h b/flight/targets/boards/simposix/firmware/inc/openpilot.h index 3cceef152..89e1e909c 100644 --- a/flight/targets/boards/simposix/firmware/inc/openpilot.h +++ b/flight/targets/boards/simposix/firmware/inc/openpilot.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include "alarms.h" diff --git a/flight/targets/boards/simposix/firmware/inc/pios_config.h b/flight/targets/boards/simposix/firmware/inc/pios_config.h index f3b494e91..9194e68b9 100644 --- a/flight/targets/boards/simposix/firmware/inc/pios_config.h +++ b/flight/targets/boards/simposix/firmware/inc/pios_config.h @@ -36,6 +36,7 @@ /* Major features */ #define PIOS_INCLUDE_FREERTOS +#define PIOS_INCLUDE_CALLBACKSCHEDULER #define PIOS_INCLUDE_BL_HELPER /* Enable/Disable PiOS Modules */ diff --git a/flight/targets/boards/simposix/firmware/pios_board.c b/flight/targets/boards/simposix/firmware/pios_board.c index d3dcc3f17..a11316893 100644 --- a/flight/targets/boards/simposix/firmware/pios_board.c +++ b/flight/targets/boards/simposix/firmware/pios_board.c @@ -132,7 +132,7 @@ void PIOS_Board_Init(void) } /* Initialize the delayed callback library */ - CallbackSchedulerInitialize(); + PIOS_CALLBACKSCHEDULER_Initialize(); /* Initialize UAVObject libraries */ EventDispatcherInitialize(); diff --git a/flight/uavobjects/eventdispatcher.c b/flight/uavobjects/eventdispatcher.c index d9518d620..e33ac9e30 100644 --- a/flight/uavobjects/eventdispatcher.c +++ b/flight/uavobjects/eventdispatcher.c @@ -26,7 +26,7 @@ #include -#include +#include // Private constants #if defined(PIOS_EVENTDISAPTCHER_QUEUE) @@ -103,8 +103,8 @@ int32_t EventDispatcherInitialize() mQueue = xQueueCreate(MAX_QUEUE_SIZE, sizeof(EventCallbackInfo)); // Create callback - eventSchedulerCallback = DelayedCallbackCreate(&eventTask, CALLBACK_PRIORITY, TASK_PRIORITY, STACK_SIZE * 4); - DelayedCallbackDispatch(eventSchedulerCallback); + eventSchedulerCallback = PIOS_CALLBACKSCHEDULER_Create(&eventTask, CALLBACK_PRIORITY, TASK_PRIORITY, CALLBACKINFO_RUNNING_EVENTDISPATCHER, STACK_SIZE * 4); + PIOS_CALLBACKSCHEDULER_Dispatch(eventSchedulerCallback); // Done return 0; @@ -148,7 +148,7 @@ int32_t EventCallbackDispatch(UAVObjEvent *ev, UAVObjEventCallback cb) evInfo.queue = 0; // Push to queue int32_t result = xQueueSend(mQueue, &evInfo, 0); // will not block if queue is full - DelayedCallbackDispatch(eventSchedulerCallback); + PIOS_CALLBACKSCHEDULER_Dispatch(eventSchedulerCallback); return result; } @@ -306,7 +306,7 @@ static void eventTask() timeToNextUpdateMs = processPeriodicUpdates(); } - DelayedCallbackSchedule(eventSchedulerCallback, timeToNextUpdateMs - (xTaskGetTickCount() * portTICK_RATE_MS), CALLBACK_UPDATEMODE_SOONER); + PIOS_CALLBACKSCHEDULER_Schedule(eventSchedulerCallback, timeToNextUpdateMs - (xTaskGetTickCount() * portTICK_RATE_MS), CALLBACK_UPDATEMODE_SOONER); } /** diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro b/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro index e5208baa9..74388f4b8 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro @@ -102,6 +102,7 @@ HEADERS += \ $$UAVOBJECT_SYNTHETICS/i2cstats.h \ $$UAVOBJECT_SYNTHETICS/flightbatterysettings.h \ $$UAVOBJECT_SYNTHETICS/taskinfo.h \ + $$UAVOBJECT_SYNTHETICS/callbackinfo.h \ $$UAVOBJECT_SYNTHETICS/flightplanstatus.h \ $$UAVOBJECT_SYNTHETICS/flightplansettings.h \ $$UAVOBJECT_SYNTHETICS/flightplancontrol.h \ @@ -200,6 +201,7 @@ SOURCES += \ $$UAVOBJECT_SYNTHETICS/i2cstats.cpp \ $$UAVOBJECT_SYNTHETICS/flightbatterysettings.cpp \ $$UAVOBJECT_SYNTHETICS/taskinfo.cpp \ + $$UAVOBJECT_SYNTHETICS/callbackinfo.cpp \ $$UAVOBJECT_SYNTHETICS/flightplanstatus.cpp \ $$UAVOBJECT_SYNTHETICS/flightplansettings.cpp \ $$UAVOBJECT_SYNTHETICS/flightplancontrol.cpp \ diff --git a/make/apps-defs.mk b/make/apps-defs.mk index fe268f73a..bb5376223 100644 --- a/make/apps-defs.mk +++ b/make/apps-defs.mk @@ -97,6 +97,7 @@ SRC += $(PIOSCOMMON)/pios_usb_util.c ## PIOS system code SRC += $(PIOSCOMMON)/pios_task_monitor.c +SRC += $(PIOSCOMMON)/pios_callbackscheduler.c ## Misc library functions SRC += $(FLIGHTLIB)/fifo_buffer.c diff --git a/shared/uavobjectdefinition/callbackinfo.xml b/shared/uavobjectdefinition/callbackinfo.xml new file mode 100644 index 000000000..6850662de --- /dev/null +++ b/shared/uavobjectdefinition/callbackinfo.xml @@ -0,0 +1,40 @@ + + + Task information + + + EventDispatcher + StateEstimation + AltitudeHold + PathPlanner0 + PathPlanner1 + + + + + EventDispatcher + StateEstimation + AltitudeHold + PathPlanner0 + PathPlanner1 + + + + + + + + + EventDispatcher + StateEstimation + AltitudeHold + PathPlanner0 + PathPlanner1 + + + + + + + + diff --git a/shared/uavobjectdefinition/taskinfo.xml b/shared/uavobjectdefinition/taskinfo.xml index c5ddc5058..2132cd8a0 100644 --- a/shared/uavobjectdefinition/taskinfo.xml +++ b/shared/uavobjectdefinition/taskinfo.xml @@ -108,8 +108,8 @@ - - + +