找回密码
 注册
搜索
查看: 2252|回复: 3

[讨论] MTK6260D 11B版本 添加一个task问题

[复制链接]
发表于 2014-10-13 22:04:24 | 显示全部楼层 |阅读模式
添加task的时候,除了app_task_config.h里面按照上面的模块添加之后,做好它的入口函数 还需要在其他地方添加什么吗?
/*************************Task CFG Begin****************/
/*task_indx_type*/
task_index(INDX_TEST)
/*module_type and mod_task_g*/
task_module_map(INDX_TEST, MOD_TEST)

/*task's parameters*/
task_name("TEST")
task_queue_name("TEST Q")
task_priority(TASK_PRIORITY_OBEX + 1)
task_stack_size(1024)
//task_create_function(test_create)
null_task_create_entry(NULL)
task_stack_internalRAM(KAL_FALSE)
task_external_queue_size(20)
task_internal_queue_size(0)
task_boot_mode(NORMAL_M)
/*************************Task CFG END******************/

其中INDX_TEST是自己添加的  但是这个需要在其他地方定义一下吗?

直接添加进去编译会报错
发表于 2014-10-30 01:00:25 | 显示全部楼层
学习下
点评回复

使用道具 举报

发表于 2014-11-14 17:07:11 | 显示全部楼层
我这里有详细的操作步骤。欢迎加入功能机学习交流群。284013941

###############模块的添加##################
1.添加新模块文件
code\jt

jt文件夹
jt\src\main.c
jt\inc\main.h

2.option.mak中

COMPLIST += jt
COMMINCDIRS += interface\jt
CUS_REL_SRC_COMP += jt

3.make文件中添加
make\jt\jt.mak

# Define source file lists to SRC_LIST
SRC_LIST = jt\src\main.c

# Define include path lists to INC_DIR
INC_DIR = jt\inc

# Define the specified compile options to COMP_DEFS
COMP_DEFS =

# Define the source file search paths to SRC_PATH
SRC_PATH = jt\src

##################### task添加 ##################################

1.app_task_config.h
task_index(INDX_JT)



task_module_map(INDX_JT, MOD_JT)
task_name("JT")
task_queue_name("JT Q")
task_priority(TASK_PRIORITY_MMI + 1)
task_stack_size(4096)
task_create_function(jt_task_create)
task_stack_internalRAM(KAL_FALSE)
task_external_queue_size(50)
task_internal_queue_size(0)
task_boot_mode(NORMAL_M)

2.user_msgid_app.h定义消息范围

#ifdef KAL_MSGID_EXPANSION

#if !defined(__L1_STANDALONE__)
#include "jt_sap.h"
#endif
MSG_ID_NAME(JT)
#else
MSG_ID_RANGE(JT, 1000)
#endif


// #define MSG_ID_RANGE(MSGNAME, MSGRANGE) \
// MSG_ID_##MSGNAME##_CODE_BEGIN, \
// MSG_ID_##MSGNAME##_CODE_TAIL = MSG_ID_##MSGNAME##_CODE_BEGIN + MSGRANGE,

3.interface\jt\jt_sap.h 定义消息

MSG_ID_JT_STARTUP_REQ = MSG_ID_JT_CODE_BEGIN,

4.option.mak把消息定义头文件加入到公共的

COMMINCDIRS += interface\jt

5.main.c的实现

#include "main.h"
#include "syscomp_config.h"
#include "task_config.h"

static void jt_task_main(task_entry_struct * task_entry_ptr);

kal_bool jt_task_create(comptask_handler_struct **handle)
{
static const comptask_handler_struct my_handler_info =
{
jt_task_main,
NULL,
NULL,
NULL,
NULL,
};

*handle = (comptask_handler_struct *)&my_handler_info;
return KAL_TRUE;
}

void jt_main(ilm_struct *ilm_ptr)
{

if (ilm_ptr->msg_id == MSG_ID_JT_STARTUP_REQ)
{
//消息处理
}
}

static void jt_task_main(task_entry_struct * task_entry_ptr)
{
kal_uint32 my_index;
ilm_struct current_ilm;

kal_get_my_task_index(&my_index);
while (1)
{
receive_msg_ext_q(task_info_g[task_entry_ptr->task_indx].task_ext_qid,&current_ilm);
stack_set_active_module_id( my_index, current_ilm.dest_mod_id );

jt_main((void*)&current_ilm);

free_ilm(&current_ilm);
}
}

6.发送消息给自己创建的task

ilm_struct *ilm_ptr = NULL;
ilm_ptr = ilm_ptr = allocate_ilm(MOD_MMI);
ilm_ptr->msg_id = (msg_type) MSG_ID_JT_STARTUP_REQ;
ilm_ptr->local_para_ptr = NULL;//(local_para_struct*) local_data;
ilm_ptr->peer_buff_ptr = NULL;

SEND_ILM(MOD_MMI, MOD_JT, MMI_L4C_SAP, ilm_ptr);
点评回复

使用道具 举报

52RD网友  发表于 2015-8-18 14:29:30
更正一下,第三步中:
MSG_ID_JT_STARTUP_REQ = MSG_ID_JT_CODE_BEGIN,  应该修改成MSG_ID_JT_STARTUP_REQ = MSG_ID_JT_MSG_CODE_BEGIN,
52RD网友  发表于 2024-2-4 02:36:49
Washing Machine Repairs, Dishwasher Repairs, Fridge Repairs, Stove
and Oven Repairs and more appliances repair

If your commercial or domestic appliance is broken, you can book your repair online or call our helpful team.
With over 24 years’ in the appliance repair industry and extremely knowledgeable technicians, we’re sure that we can be of assistance.


Get in touch with uss washing machine repair near me

We can all agree thazt whwn a crucial appliance stops
working properly, it can be very stressful. The usual routine at home wipl be disrupted.
Withouut a working washing machine, the pile of dirty laundry will pile up and youu can even run outt of
clean clothes to wear. If the refrigerator breaks down, you willl worry about were too stlre frozen food, and some fooods might even spoil.And if
the stove doesn’t work, you won’t be able to cook your delicioous homemade meals annd be stuck with less heslthy and
more expensive takeaways.

As yyou caan see, it can cause a lot oof inconvenience to the members of the
household if any of the appliances at homme malfunctions.
So if that ever happens to you, you won’t want to delay
the repair. Instead, you would want to have your broken appliance fjxed right away.
And so the first thing you would ask is, is there an appliance repair near me?



We provides washer repair, dryer repair, refrigerator
reair and microwave repair. We also do oven repair, stove
repair, cooktop repair and range repair, ice
maker repair, freezer repair, dishwasher repair.
It is rather simple; just calol oour friendly operators
on 087 093 1136 for a professional service in your area.
We shall come out aand diagnose your problem. Call 087 093 1136 for appliance
repairs near me.

We are ready too give you a service call concerning repairing
inn order to help you to judge our competence as to your appliance rpairing
needs. We provide the ssame day service of alll the brands you have
no mtter if it’s Bosch, Defy, Electrolux, Gaggenau, Grundig, Indesit, Miele, Samsung, LG, GE, Whirlpool,
Maytag, Kenmore or any other brand from A – Z available in the market.

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-11-23 01:36 , Processed in 4.891615 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表