Create custom Tasks in SDK 6.0

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
Anonymous (not verified)
Create custom Tasks in SDK 6.0

Hi

I had implemented a program using the dialog part 14583 and in this program I had created three additional tasks. This was using the SDK 5.0.3

For each task I had assigned an ID like

ke_task_id_t MAIN_TASK = TASK_MAX + 3;

and then created the task using

// Create the task ke_task_create(MAIN_TASK, &TASK_DESC_MAIN);

Now I wish to port this program to the 14586 using the SDK 6.0.10 and am having problems creating custom tasks and sending messages in between it.

In the SDK file "DA14585_SDK_6.0.10.511_0\DA14585_SDK\6.0.10.511\sdk\platform\core_modules\rwip\api\rwip_config.h" there are now two types of structures for task ids, the KE_TASK_TYPE and KE_API_ID and the scheme for identifying a task has also changed.

Can you please let me know if there is any example of creating a custom Task, and if there is not, then how do I implement a custom task.

Device:
MHv_Dialog
Offline
Last seen:1 month 2 weeks ago
Staff
Joined:2013-12-06 15:10
Hi mutahir,

Hi mutahir,

We unfortunately do not have a great example available that demonstrates the implementation of custom tasks, but you may be able to learn from how we have implemented the custom services in our barebones BLE project.

那就是说,我想知道为什么哟u are using custom tasks in the first place. It is much easier to implement all of your user code in the already supported user task, so unless you have reasons to prioritize some processes over others, the most efficient and easiest way is to keep all within the usertask. Task switching comes at a price within any kernel, and the Dialog kernel is no different.

/MHv

PW_Dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2019-04-03 02:54
Hi Hutahir,

Hi Hutahir,

The 1st parameter of ke_task_create() is task type, which is uint8_t format. If you want to find a example to call this function, could refer app.c in SDK.