📄 sysgen1.pl
字号:
MSG_ID_DM_DEL_ACCOUNT_REQ,
MSG_ID_DM_GET_ACCOUNT_REQ,
MSG_ID_DM_LIST_SERVERID_REQ,
MSG_ID_DM_GET_PSERVERID_REQ,
MSG_ID_DM_SET_PSERVERID_REQ,
MSG_ID_DM_NOTIFICATION_INIT_SESSION_RES,
MSG_ID_DM_GET_BOOTSTRAP_USERPIN_RES,
MSG_ID_DM_DL_RES,
MSG_ID_DM_UPDATE_RES,
MSG_ID_DM_ALERT_RES,
MSG_ID_DM_CANCEL_REQ,
MSG_ID_DM_MMI_READY_IND,
//End DM message
__TEMPLATE
return $template;
}
#****************************************************************************
# subroutine: generate custom1_create.c content body
# return: the body strings
#****************************************************************************
sub custom1_create_c_file_body
{
my $template = <<"__TEMPLATE";
/*************************************************************************
* Include Statements
*************************************************************************/
#include "kal_release.h"
#include "stack_common.h"
#include "stack_msgs.h"
#include "task_main_func.h"
#include "app_ltlcom.h"
#include "lcd_ip_cqueue.h"
#include "stack_types.h"
#include "task_config.h"
#include "syscomp_config.h"
#include "custom_config.h"
#include "custom_util.h"
#include "stack_init.h"
#include "stack_ltlcom.h"
/*************************************************************************
* Function declaration
*************************************************************************/
static void custom1_main(task_entry_struct * task_entry_ptr);
static void custom2_main(task_entry_struct * task_entry_ptr);
/*************************************************************************
* FUNCTION
* custom1_create
*
* DESCRIPTION
*
* PARAMETERS
*
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_bool
custom1_create(comptask_handler_struct **handle)
{
static const comptask_handler_struct custom1_handler_info =
{
custom1_main, /* task entry function */
NULL, /* task initialization function */
NULL, /* task configuration function */
NULL, /* task reset handler */
NULL, /* task termination handler */
};
*handle = (comptask_handler_struct *)&custom1_handler_info;
return KAL_TRUE;
}
static void
custom1_main(task_entry_struct * task_entry_ptr)
{
ilm_struct current_ilm;
#ifdef DRV_DEBUG
ilm_struct *send_ilm;
custom_print("Custom1 Send Test\\n");
send_ilm = allocate_ilm(MOD_CUSTOM1);
send_ilm->src_mod_id = MOD_CUSTOM1;
send_ilm->dest_mod_id = MOD_CUSTOM2;
send_ilm->msg_id = MSG_ID_CUSTOM1_CUSTOM2;
msg_send_ext_queue(send_ilm);
#endif /* DRV_DEBUG */
while ( 1 ) {
receive_msg_ext_q(task_info_g[task_entry_ptr->task_indx].task_ext_qid, ¤t_ilm);
switch (current_ilm.msg_id) {
case MSG_ID_CUSTOM2_CUSTOM1:
custom_print("Custom1 receive message from custom2.\\n");
break;
default:
break;
}
free_ilm(¤t_ilm);
}
}
/*************************************************************************
* FUNCTION
* custom2_create
*
* DESCRIPTION
*
* PARAMETERS
*
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_bool
custom2_create(comptask_handler_struct **handle)
{
static const comptask_handler_struct custom2_handler_info =
{
custom2_main, /* task entry function */
NULL, /* task initialization function */
NULL, /* task configuration function */
NULL, /* task reset handler */
NULL, /* task termination handler */
};
*handle = (comptask_handler_struct *)&custom2_handler_info;
return KAL_TRUE;
}
static void
custom2_main(task_entry_struct * task_entry_ptr)
{
ilm_struct current_ilm;
#ifdef DRV_DEBUG
ilm_struct *send_ilm;
custom_print("Custom1 Send Test\\n");
send_ilm = allocate_ilm(MOD_CUSTOM2);
send_ilm->src_mod_id = MOD_CUSTOM2;
send_ilm->dest_mod_id = MOD_CUSTOM1;
send_ilm->msg_id = MSG_ID_CUSTOM2_CUSTOM1;
msg_send_ext_queue(send_ilm);
#endif /* DRV_DEBUG */
while ( 1 ) {
receive_msg_ext_q(task_info_g[task_entry_ptr->task_indx].task_ext_qid, ¤t_ilm);
switch (current_ilm.msg_id) {
case MSG_ID_CUSTOM1_CUSTOM2:
custom_print("Custom1 receive message from custom2.\\n");
break;
default:
break;
}
free_ilm(¤t_ilm);
}
}
__TEMPLATE
return $template;
}
#****************************************************************************
# subroutine: generate custom_config.h content body
# return: the body strings
#****************************************************************************
sub custom_config_h_file_body
{
my $template = <<"__TEMPLATE";
#ifndef _CUSTOM_CONFIG_H
#define _CUSTOM_CONFIG_H
#include "kal_non_specific_general_types.h"
/*************************************************************************
* Steps to add component task
*
* DESCRIPTION
* The file describes steps to add component task.
*
* 1. add component task's index (Please add before system service)
*
* 2. add component task's module id definition (Please add before system service)
*
* 3. add module to task transformation in syscomp_config.c
*
* 4. add and implement component task's create handler
*
* GLOBALS AFFECTED
*
*************************************************************************/
/*************************************************************************
* [Very Important Message]
* 1. Component Task Index (Please add before system service)
* 2. Customers are allowed to create at most 16 tasks as defined in
* config\\include\\stack_config.h (MAX_CUSTOM_TASKS = 16)
*************************************************************************/
typedef enum {
INDX_CUSTOM1 = RPS_CUSTOM_TASKS_BEGIN,
INDX_CUSTOM2,
INDX_PICSEL,
INDX_HOTCARD,
INDX_NOLLEC_DM,
RPS_CUSTOM_TASKS_END
} custom_task_indx_type;
/*************************************************************************
* [Very Important Message]
* 1. Component task's module id (Please add before system service)
* 2. Customers are allowed to create at most 16 task module ID as defined
* in config\\include\\stack_config.h (MAX_CUSTOM_MODS = 16)
*************************************************************************/
typedef enum {
MOD_CUSTOM1 = MOD_CUSTOM_BEGIN,
MOD_CUSTOM2,
MOD_CUSTOM_PICSEL,
MOD_CUSTOM_HOTCARD,
MOD_CUSTOM_DM,
MOD_CUSTOM_END
} custom_module_type;
/*************************************************************************
* Other Declarations
*************************************************************************/
extern custom_task_indx_type custom_mod_task_g[ MAX_CUSTOM_MODS ];
#endif /* _CUSTOM_CONFIG_H */
__TEMPLATE
return $template;
}
#****************************************************************************
# subroutine: generate custom_config.c content body
# return: the body strings
#****************************************************************************
sub custom_config_c_file_body
{
my ($global_mem_config_string, $ctrl_buff_pool_config_string) = &dispatch_globalmem_and_ctrlbuffpool;
my $template = <<"__TEMPLATE";
/*************************************************************************
* Include Statements
*************************************************************************/
#include "kal_release.h"
#include "stack_types.h"
#include "syscomp_config.h"
#include "stack_common.h"
#include "stack_config.h"
#include "stack_msgs.h"
#include "app_ltlcom.h"
#include "lcd_ip_cqueue.h"
#include "task_config.h"
#include "custom_config.h"
#include "stack_buff_pool.h"
#include "ctrl_buff_pool.h"
#include "custom_MemoryDevice.h"
#include "system_inc.h" /* include system_inc.h after including above header files */
//#define CUSTOM1_EXIST
//#define CUSTOM2_EXIST
/*************************************************************************
* External function declaration
*************************************************************************/
extern kal_bool custom1_create(comptask_handler_struct **handle);
extern kal_bool custom2_create(comptask_handler_struct **handle);
extern kal_bool picsel_task_create(comptask_handler_struct **handle);
extern kal_bool hotcard_task_create(comptask_handler_struct **handle);
extern kal_bool dm_task_create(comptask_handler_struct **handle);
/*************************************************************************
* Global
* custom_mod_task_g
*
* DESCRIPTION
* module to task index mapping.
* for example:
* INDX_CUSTOM1 -> MOD_CUSTOM1
* means module MOD_CUSTOM1 belongs to INDX_CUSTOM1 task
*
* Please arrange the mapping according to custom_config.h custom_module_type
* sequence.
*
* GLOBALS AFFECTED
*
*************************************************************************/
custom_task_indx_type custom_mod_task_g[ MAX_CUSTOM_MODS ] =
{
INDX_CUSTOM1, /* MOD_CUSTOM1 */
INDX_CUSTOM2, /* MOD_CUSTOM2 */
INDX_PICSEL,
INDX_HOTCARD,
INDX_NOLLEC_DM,
INDX_NIL /* Please end with INDX_NIL element */
};
/*************************************************************************
* Global
* custom_comp_config_tbl
*
* DESCRIPTION
* The array contains system component tasks' configuration information
*
* GLOBALS AFFECTED
*
*************************************************************************/
const comptask_info_struct custom_comp_config_tbl[ MAX_CUSTOM_TASKS ] =
{
/* INDX_CUSTOM1 */
{"CUST1", "CUST1 Q", 210, 1024, 10, 0,
#ifdef CUSTOM1_EXIST
custom1_create, KAL_FALSE
#else
NULL, KAL_FALSE
#endif
},
/* INDX_CUSTOM2 */
{"CUST2", "CUST2 Q", 211, 1024, 10, 0,
#ifdef CUSTOM2_EXIST
custom2_create, KAL_FALSE
#else
NULL, KAL_FALSE
#endif
},
/* INDX_PICSEL */
{"PICSEL", "PICSEL Q", 212, 1024, 10, 0,
#ifdef __PICSEL_VIEWER_ENABLE__
picsel_task_create, KAL_FALSE
#else
NULL, KAL_FALSE
#endif
},
/* INDX_HOTCARD */
{"HOTCARD", "HOTCARD Q", 213, 10240, 10, 0,
#ifdef __BCR_SUPPORT_ENABLE__
hotcard_task_create, KAL_FALSE
#else
NULL, KAL_FALSE
#endif
},
/* INDX_NOLLEC_DM */
{"DM", "DM Q", 214, 20480, 10, 0,
#ifdef __NOLLEC_DM_VERSION_3__
dm_task_create, KAL_FALSE
#else
NULL, KAL_FALSE
#endif
},
};
/*************************************************************************
* FUNCTION
* custom_configmem()
*
* DESCRIPTION
* This routine configure
*
* a. system total memory usage
* Task's stack, external queue, control buffer entries etc.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -