Hi,
in the provided sample applications in the Workbench I can see that the AppController follows this structure:
void AppController_Init(void * cmdProcessorHandle, uint32_t param2)
{
...
retcode = CmdProcessor_Enqueue(AppCmdProcessor, AppControllerSetup, NULL, UINT32_C(0));
...
}
void AppControllerSetup(void * cmdProcessorHandle, uint32_t param2)
{
...
retcode = CmdProcessor_Enqueue(AppCmdProcessor, AppControllerEnable, NULL, UINT32_C(0));
...
}
void AppControllerEnable(void * cmdProcessorHandle, uint32_t param2)
{
...
xTaskCreate(AppControllerFire, (const char * const ) "AppController", TASK_STACK_SIZE_APP_CONTROLLER, NULL, TASK_PRIO_APP_CONTROLLER, &AppControllerHandle))
...
}
static void AppControllerFire(void* pvParameters)
{
...
//Application logic
...
}
I have two question concerning this structure:
1) What is the benefit of "isolating" every function in a separate "CmdProcessor_Enqueue" call, instead of directly call "AppControllerSetup" in "AppController_Init" and so on?
2) Why is "AppControllerSetup" created as a task rather than enqueued through "CmdProcessor_Enqueue" ? What is the benefit of this?
I checked as well the documentation: https://developer.bosch.com/web/xdk/cmdprocessor but could not find some hint.
Kind regards Christof
Hello Sunstos,
Before answering your question, I would like to highlight about the XDK application. The applications provided in XDK workbench can run on XDK hardware and are template applications; meaning- user can extend one's idea in the existing application.
There is no hardcore rule to follow the same application structure and user has the freedom to use custom structure (like you mentioned direct function call) considering the performance risk.
What is the benefit of "isolating" every function in a separate "CmdProcessor_Enqueue" call, instead of directly call "AppControllerSetup" in "AppController_Init" and so on?
Why is "AppControllerSetup" created as a task rather than enqueued through "CmdProcessor_Enqueue" ? What is the benefit of this?
Thank you,
Padmapriya.