Exemplo n.º 1
0
/*****************************************************************************
 * FUNCTION
 *  jbt_cmd_kick_check_list
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void jbt_cmd_kick_check_list(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    ilm_struct *ilmPtr;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_take_sem(jbt_cmd_kick_sem, KAL_INFINITE_WAIT);
    kal_trace(TRACE_FUNC, JBT_JBT_CMD_KICK_CHECK_LIST);
    kal_trace(TRACE_JBT_GROUP, JBT_JBT_CMD_QUEUE_CONTEXTQUEUE_KICK_OFF_D, jbt_cmd_queue_context.queue_kick_off);

    if (jbt_cmd_queue_context.queue_kick_off != 1)
    {
        jbt_cmd_queue_context.queue_kick_off = 1;
        ilmPtr = allocate_ilm(MOD_JASYN);
        ilmPtr->msg_id = MSG_ID_BT_JSR_KICK_NEW_COMMAND;
        ilmPtr->local_para_ptr = NULL;
        ilmPtr->peer_buff_ptr = NULL;
        ilmPtr->dest_mod_id = MOD_JASYN;
        ilmPtr->src_mod_id = MOD_JASYN;
        ilmPtr->sap_id = BT_APP_SAP;
        msg_send_ext_queue(ilmPtr);
    }
    kal_give_sem(jbt_cmd_kick_sem);
}
Exemplo n.º 2
0
/*****************************************************************************
 * FUNCTION
 *  vis_send_decode_visual_data_ind
 * DESCRIPTION
 *  This function is to send decode visual data indication message.
 * PARAMETERS
 *  event       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_decode_visual_data_ind(kal_uint8 event)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_decode_visual_data_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ind_p = (media_decode_visual_data_ind_struct*)
        construct_local_para(sizeof(media_decode_visual_data_ind_struct), TD_CTRL);

    ind_p->event = event;

    ilm_ptr = allocate_ilm(MOD_VISUAL_HISR);
    ilm_ptr->src_mod_id = MOD_VISUAL_HISR;
    ilm_ptr->dest_mod_id = MOD_MED_V;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_DECODE_VISUAL_DATA_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}
Exemplo n.º 3
0
/*****************************************************************************
 * FUNCTION
 *  vis_send_stop_cnf
 * DESCRIPTION
 *  This function is to send visual stop confirm message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_stop_cnf(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_visual_stop_cnf_struct *msg_p = NULL;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    msg_p = (media_visual_stop_cnf_struct*) construct_local_para(sizeof(media_visual_stop_cnf_struct), TD_CTRL);

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_STOP_CNF;
    ilm_ptr->local_para_ptr = (local_para_struct*) msg_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}
Exemplo n.º 4
0
/*****************************************************************************
 * FUNCTION
 *  vis_send_record_finish_ind
 * DESCRIPTION
 *  This function is to send visual record finish indication message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_record_finish_ind(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_visual_record_finish_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ind_p = (media_visual_record_finish_ind_struct*)
        construct_local_para(sizeof(media_visual_record_finish_ind_struct), TD_CTRL);

    ind_p->result = result;

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_RECORD_FINISH_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}
Exemplo n.º 5
0
/*****************************************************************************
 * FUNCTION
 *  vis_send_play_finish_ind
 * DESCRIPTION
 *  This function is to send visual play finish indication message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_play_finish_ind(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_visual_play_finish_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_GROUP_4, VIS_TRC_SEND_PLAY_FINISH_IND);
    med_debug_print_result(result);
    
    ind_p = (media_visual_play_finish_ind_struct*)
        construct_local_para(sizeof(media_visual_play_finish_ind_struct), TD_CTRL);

    ind_p->result = result;

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_PLAY_FINISH_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}
Exemplo n.º 6
0
void FTC_SEND_MSG(module_type  src_mod,
                  module_type  dest_mod,
                  sap_type  sap,
                  msg_type  msg,
                  ilm_struct  *ilm_ptr)
{
    ilm_ptr->src_mod_id  = src_mod;
    ilm_ptr->dest_mod_id = dest_mod;
    ilm_ptr->msg_id = msg;
    ilm_ptr->sap_id = sap;
    msg_send_ext_queue(ilm_ptr);
}
Exemplo n.º 7
0
/**************************************************************

	FUNCTION NAME		: OslIntMsgSendExtQueue

  	PURPOSE				: Writes to Task External Queue

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: nil

 
**************************************************************/
void OslIntMsgSendExtQueue(MYQUEUE *Message)
{
	#ifdef MMI_ON_HARDWARE_P
		MYQUEUE *oslMessage;
		oslMessage = allocate_ilm(Message->oslSrcId);
		memcpy(oslMessage, Message, sizeof(MYQUEUE));	
		oslMessage->sap_id=INVALID_SAP;
#if 1
		do 
		{ 
			COS_EVENT ev; 
			ev.nEventId = oslMessage->msg_id; 
			ev.nParam1 = (UINT32)oslMessage; 
			ev.nParam3 = oslMessage->dest_mod_id; 

			SEND_COSMSG(oslMessage->dest_mod_id, &ev); 
		} while (0);
#else
		msg_send_ext_queue(oslMessage);
#endif
		
		CheckAndPrintMsgId (Message->msg_id);
	#else
		if(Message->oslDestId==MOD_MMI) 
			Message->oslDestId=MOD_PRT;
		if(Message->oslSrcId==MOD_MMI) 
			Message->oslSrcId=MOD_PRT;
		if(Message->oslDestId==MOD_WAP) 
			Message->oslDestId=MOD_PRT;

    // Add by zhuoxz,2009-6-19
    if (Message->oslDestId==MOD_L4C)
      Message->oslDestId=MOD_PST;
    if(Message->oslSrcId==MOD_L4C) 
      Message->oslSrcId=MOD_PST;
    if (Message->oslDestId==MOD_L4C_2)
      Message->oslDestId=MOD_PST_2;
    if(Message->oslSrcId==MOD_L4C_2) 
      Message->oslSrcId=MOD_PST_2;
    
    if (Message->oslDestId == MOD_PST || Message->oslDestId == MOD_PST_2)
    {
      OslIntWriteMsgQ(task_info_g1[MOD_PST].task_ext_qid, Message, 
        sizeof(MYQUEUE), OSL_INFINITE_WAIT);
    }
    else
    {
		OslIntWriteMsgQ(task_info_g1[Message->oslDestId].task_ext_qid, Message, 
						sizeof(MYQUEUE), OSL_INFINITE_WAIT);
    }
	#endif
}
Exemplo n.º 8
0
/* send ilm to UART owner */
void USB2UART_Sendilm(msg_type msgid)
{
    ilm_struct *USB2UART_ilm;
    void *port_ptr = NULL;

    if (USB2UARTPort.ownerid == MOD_DRV_HISR)
        return;

    switch(msgid)
    {
    case MSG_ID_UART_READY_TO_READ_IND:
    {
        uart_ready_to_read_ind_struct *tmp;
        tmp = (uart_ready_to_read_ind_struct *)
              construct_local_para(sizeof(uart_ready_to_read_ind_struct),TD_UL);
        tmp->port = USB2UARTPort.port_no;
        port_ptr = tmp;
    }
    break;

    case MSG_ID_UART_READY_TO_WRITE_IND:
    {
        uart_ready_to_write_ind_struct *tmp;
        tmp = (uart_ready_to_write_ind_struct *)
              construct_local_para(sizeof(uart_ready_to_write_ind_struct),TD_UL);
        tmp->port = USB2UARTPort.port_no;
        port_ptr = tmp;
    }
    break;

    case MSG_ID_UART_ESCAPE_DETECTED_IND:
    {
        uart_escape_detected_ind_struct *tmp;
        tmp = (uart_escape_detected_ind_struct *)
              construct_local_para(sizeof(uart_escape_detected_ind_struct),TD_UL);
        tmp->port = USB2UARTPort.port_no;
        port_ptr = tmp;
    }
    break;

    default:
        EXT_ASSERT(0, msgid, 0, 0);
        break;
    }

    if (USB2UARTPort.ownerid == MOD_DRV_HISR)
        EXT_ASSERT(0, USB2UARTPort.ownerid, 0, 0);

    DRV_BuildPrimitive(USB2UART_ilm, MOD_DRV_HISR,
                       USB2UARTPort.ownerid, msgid, port_ptr);
    msg_send_ext_queue(USB2UART_ilm);
}
Exemplo n.º 9
0
static void e_compass_write_nvram(E_CompassSensorCalibratedDataStruct *calibrated_data)
{
    ilm_struct *ec_ilm_ptr = 0;
    void *parm_stream = 0;
    void *data_stream = 0;
    kal_uint16 pdu_len;
    nvram_ef_ecompass_calibration ec_nvram;
    module_type module_id;

    module_id = MOD_EC_TASK;

    /* for now we just save three fields */
    ec_nvram.usr_moffset_x = calibrated_data->usr_moffset_x;
    ec_nvram.usr_moffset_y = calibrated_data->usr_moffset_y;
    ec_nvram.usr_moffset_z = calibrated_data->usr_moffset_z;
    ec_nvram.cali_result   = calibrated_data->cali_result;

    ec_nvram.x_axis_sensitivity = calibrated_data->x_axis_sensitivity;
    ec_nvram.y_axis_sensitivity = calibrated_data->y_axis_sensitivity;
    ec_nvram.x_max              = calibrated_data->x_max;
    ec_nvram.y_max              = calibrated_data->y_max;
    ec_nvram.x_min              = calibrated_data->x_min;
    ec_nvram.y_min              = calibrated_data->y_min;

    /* E_COMPASS_DEBUG_OUTPUT("Calibrated result usr_moffset_x = %d, usr_moffset_y = %d, usr_moffset_z = %d, misc = %d", ec_nvram.usr_moffset_x, ec_nvram.usr_moffset_y, ec_nvram.usr_moffset_z, 0); */
    drv_trace4(TRACE_GROUP_10, EC_NVRAM_SAVE, ec_nvram.usr_moffset_x, ec_nvram.usr_moffset_y, ec_nvram.usr_moffset_z, ec_nvram.cali_result);

    ec_ilm_ptr = allocate_ilm(module_id);
    ec_ilm_ptr->msg_id = MSG_ID_NVRAM_WRITE_REQ;

    parm_stream = construct_local_para(sizeof(nvram_write_req_struct), TD_CTRL);
    data_stream = construct_peer_buff(sizeof(nvram_ef_ecompass_calibration), 0, 0, TD_CTRL);

    ((nvram_write_req_struct*) parm_stream)->file_idx = NVRAM_EF_ECOMPASS_DATA_LID;
    ((nvram_write_req_struct*) parm_stream)->para = 1;

    pdu_len = sizeof(nvram_ef_ecompass_calibration);
    kal_mem_cpy(get_pdu_ptr(data_stream, &pdu_len), (void*)&ec_nvram, sizeof(nvram_ef_ecompass_calibration));

    ec_ilm_ptr->local_para_ptr = (local_para_struct*) parm_stream;
    ec_ilm_ptr->peer_buff_ptr = (peer_buff_struct*) data_stream;

    ec_ilm_ptr->src_mod_id  = module_id;
    ec_ilm_ptr->dest_mod_id = MOD_NVRAM;
    ec_ilm_ptr->sap_id = PS_NVRAM_SAP;
    msg_send_ext_queue(ec_ilm_ptr);
}
Exemplo n.º 10
0
void SPPOS_sendMsg(
        msg_type msg,
        module_type dstMod,
        sap_type sap,
        local_para_struct *local_para,
        peer_buff_struct *peer_buff)
{
    ilm_struct *ilmPtr;

    ilmPtr = allocate_ilm(MOD_BT);
    ilmPtr->msg_id = msg;
    ilmPtr->local_para_ptr = local_para;
    ilmPtr->peer_buff_ptr = peer_buff;
    ilmPtr->dest_mod_id = dstMod;
    ilmPtr->src_mod_id = MOD_BT;
    ilmPtr->sap_id = sap;
    msg_send_ext_queue(ilmPtr);
}
Exemplo n.º 11
0
void GPSLocateNvramRepeatHandler(GPSAppTimerID_t Id)
{
    ilm_struct *send_ilm;
	kal_uint16 src_mod;

	src_mod = stack_int_get_active_module_id();
	send_ilm = allocate_ilm(src_mod);
    send_ilm->src_mod_id = src_mod;
#ifdef GPS_NVRAM_TASK
    send_ilm->dest_mod_id = MOD_GPS_NVRAM;
#else
    send_ilm->dest_mod_id = MOD_GPS_APP_TASK;
#endif
    send_ilm->msg_id = MSG_ID_GPSLOCATE_NVRAMSTORE_IND;
    send_ilm->local_para_ptr = NULL;

    msg_send_ext_queue(send_ilm);
}
Exemplo n.º 12
0
/*****************************************************************************
 * FUNCTION
 *  sppa_sendData
 * DESCRIPTION
 *  send data to SPP
 * PARAMETERS
 *  owner       [IN]        
 *  port        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
#ifdef BTMTK_ON_WISE  /*SPP_PORTING*/
void sppa_sendData(module_type owner, UART_PORT port)
{
    ilm_struct *ilm;
    bt_spp_send_data_req_struct *pLocal;

    ilm = allocate_ilm(owner);
    pLocal = (bt_spp_send_data_req_struct*) construct_local_para(sizeof(bt_spp_send_data_req_struct), TD_UL);

    pLocal->port = port;

    ilm->dest_mod_id = MOD_BT;
    ilm->sap_id = 0;
    ilm->src_mod_id = owner;
    ilm->msg_id = MSG_ID_BT_SPP_SEND_DATA_REQ;
    ilm->peer_buff_ptr = NULL;
    ilm->local_para_ptr = (local_para_struct*) pLocal;
    msg_send_ext_queue(ilm);    
}
Exemplo n.º 13
0
/*****************************************************************************
 * FUNCTION
 *  bitstream_send_msg
 * DESCRIPTION
 *  
 * PARAMETERS
 *
 * RETURNS
 *  
 *****************************************************************************/
void bitstream_send_msg(module_type src_id, module_type dst_id, kal_uint16 msg_id, void *local_param_ptr)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    ilm_struct *ilm_ptr = allocate_ilm(src_id);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ilm_ptr->src_mod_id = src_id;
    ilm_ptr->dest_mod_id = dst_id;
    ilm_ptr->sap_id = MED_SAP;
    ilm_ptr->msg_id = (msg_type) msg_id;
    ilm_ptr->local_para_ptr = (local_para_struct*) local_param_ptr;
    ilm_ptr->peer_buff_ptr = (peer_buff_struct*) NULL;

    msg_send_ext_queue(ilm_ptr);
}
Exemplo n.º 14
0
/*****************************************************************************
 * FUNCTION
 *  vis_send_encode_visual_data_ind
 * DESCRIPTION
 *  This function is to send encode visual data indication message.
 * PARAMETERS
 *  event       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_encode_visual_data_ind(kal_uint8 event)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_encode_visual_data_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (event == VIDEO_ENC_EVENT_COUNT_FILE_SIZE)
    {
        if (vid_evaluate_residual_size(video_enc_get_bitstream_file_size()) == 0)
        {
            video_enc_stop_record();
            event = VIDEO_ENC_EVENT_COMPLETE;
        }
        else
        {
            return;
        }
    }
    ind_p = (media_encode_visual_data_ind_struct*)
        construct_local_para(sizeof(media_encode_visual_data_ind_struct), TD_CTRL);

    ind_p->event = event;

    ilm_ptr = allocate_ilm(MOD_VISUAL_HISR);
    ilm_ptr->src_mod_id = MOD_VISUAL_HISR;
    ilm_ptr->dest_mod_id = MOD_MED_V;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_ENCODE_VISUAL_DATA_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}
Exemplo n.º 15
0
/*****************************************************************************
 * FUNCTION
 *  vis_send_error_recover_ind
 * DESCRIPTION
 *  This function is to send error recover indication message to Media task.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_error_recover_ind(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VID_ERROR_RECOVER_IND;
    ilm_ptr->local_para_ptr = NULL;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}
Exemplo n.º 16
0
/*****************************************************************************
 * FUNCTION
 *  bpp_adp_send_msg2app
 * DESCRIPTION
 *  This function send msg to bpp app(mmi)
 * PARAMETERS
 *  msg_id      [IN]        
 *  wparam      [?]         [?]
 * RETURNS
 *  void
 *****************************************************************************/
static void bpp_adp_send_msg2app(kal_uint16 msg_id, local_para_struct *wparam)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
#ifdef __ON_MAUI__
    
    ilm_struct *ilm_send = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    BT_BPP_TRACE_INFO_ARG1(BPP_ADP_SEND_MSG2APP, msg_id);

    ilm_send = allocate_ilm(MOD_BT);
    ilm_send->src_mod_id = MOD_BT;
    ilm_send->dest_mod_id = MOD_MMI;
    ilm_send->sap_id = BT_BPP_SAP;
    ilm_send->msg_id = (kal_uint16) msg_id;
    ilm_send->local_para_ptr = (local_para_struct*) wparam;
    ilm_send->peer_buff_ptr = NULL;
	
    msg_send_ext_queue(ilm_send);

#else

	U16 msg_len;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    BT_BPP_TRACE_INFO_ARG1(BPP_ADP_SEND_MSG2APP, msg_id);
    
    msg_len = wparam ? ((local_para_struct*)wparam)->msg_len : 0;
	
    BT_SendMessage(msg_id, MOD_MMI, wparam, msg_len);

#endif
}
Exemplo n.º 17
0
/*****************************************************************************
 * FUNCTION
 *  nvram_send_ilm
 * DESCRIPTION
 *  This is nvram_send_ilm function of NVRAM module.
 * PARAMETERS
 *  dest_id             [IN]        
 *  msg_id              [IN]        
 *  local_param_ptr     [?]         
 *  peer_buf_ptr        [?]         
 *  ilm_ptr(?)          [IN]        The primitives
 * RETURNS
 *  void
 *****************************************************************************/
void nvram_send_ilm(module_type dest_id, msg_type msg_id, void *local_param_ptr, void *peer_buf_ptr)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (dest_id == MOD_RTC_HISR || dest_id == MOD_SIM)
    {
        if (local_param_ptr)
            free_ctrl_buffer(local_param_ptr);
        if (peer_buf_ptr)
            free_peer_buff(peer_buf_ptr);
            
        return;
    }
    ilm_ptr = allocate_ilm(MOD_NVRAM);

    ASSERT(ilm_ptr != NULL);

    ilm_ptr->src_mod_id = MOD_NVRAM;
    ilm_ptr->msg_id = msg_id;
    ilm_ptr->local_para_ptr = (local_para_struct*) local_param_ptr;
    ilm_ptr->peer_buff_ptr = (peer_buff_struct*) peer_buf_ptr;

    ilm_ptr->dest_mod_id = dest_id;
    ilm_ptr->sap_id = PS_NVRAM_SAP;

   /**
    * Sigh, since SEND_ILM is a macro uses ## directive, 
    * the formal parameter of dest_mod_id must be hardcoded.
    * So NVRAM DOES NOT use it. >=P
    */
    msg_send_ext_queue(ilm_ptr);
}   /* End of nvram_send_ilm */
Exemplo n.º 18
0
static void UART_HISR(void)
{
	ilm_struct *UART_ilm;
	uart_ready_to_write_ind_struct* _data;

	if(g_msgid == MSG_ID_UART_READY_TO_WRITE_IND)
	{			    
	   	_data = (uart_ready_to_write_ind_struct *) construct_local_para(sizeof(uart_ready_to_write_ind_struct),TD_UL);
		_data->port = g_port; 
	}
	else
	{
		_data = NULL;
	}

	DRV_BuildPrimitive(UART_ilm,
                         UARTPort[g_port].UART_id,
                         UARTPort[g_port].ownerid,
                         g_msgid,
                         _data);

	msg_send_ext_queue(UART_ilm);
}
Exemplo n.º 19
0
/*****************************************************************************
 * FUNCTION
 *  mmi_bt_avrcp_tst_only_down_cmd
 * DESCRIPTION
 *  Test when only down cmd comes witout up cmd
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_bt_avrcp_tst_only_down_cmd()
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    
	bt_avrcp_cmd_frame_ind_res_struct* msg_p = (bt_avrcp_cmd_frame_ind_res_struct*)
            construct_local_para(sizeof(bt_avrcp_cmd_frame_ind_res_struct), TD_CTRL);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    msg_p->chnl_num = BT_AVRCP_TG ;
    msg_p->profile_id = 0;
    msg_p->seq_id = 0;
    msg_p->c_type = 0;
    msg_p->data_len = 1; /*assign a value that's larger than 0*/
    msg_p->subunit_id = BT_AVRCP_SUBUNIT_ID_PASS_THROUGH;
    msg_p->subunit_type = BT_AVRCP_SUBUNIT_TYPE_PASS_THROUGH;
    msg_p->frame_data[0] = BT_AVRCP_OP_PASS_THROUGH;
    msg_p->frame_data[1] = MMI_AVRCP_POP_STOP; //MMI_AVRCP_POP_PLAY ;        /*play button down*/

    /*send msg*/
    {
       ilm_struct *ilm_ptr = allocate_ilm(MOD_MMI);
       ilm_ptr->src_mod_id = MOD_MMI;
       ilm_ptr->dest_mod_id = MOD_MMI;
       ilm_ptr->sap_id = BT_AVRCP_SAP;
       ilm_ptr->msg_id = (msg_type)MSG_ID_BT_AVRCP_CMD_FRAME_IND;
       ilm_ptr->local_para_ptr = (local_para_struct*)msg_p;
       ilm_ptr->peer_buff_ptr = NULL;
    
       msg_send_ext_queue(ilm_ptr);
    }


}
kal_bool video_renderer_task_req_msg(
  void * exec_task_name,
  video_renderer_task_exec_func_t exec_func,
  void * exec_param,
  kal_uint32 exec_param_size)
{
#if defined(__MTK_TARGET__)
#if (defined(ISP_SUPPORT))

  _video_renderer_task_local_param_t *ilm_param;
  ilm_struct *p_ilm = NULL;
  module_type eActiveModuleId;
  kal_uint32 local_param_size;
  kal_uint32 construct_size;

  // Here, I utilize some behavior of arm compilier for struct "_video_renderer_task_local_param_t"
  // 1. For exec_param, it is a pointer, and it's size must be 4 byte
  // 2. The start address of struct must be 4 byte align
  // 3. The start address of exec_param in the struct must be 4 byte align
  // Then I will put the input exec_param to stuct exec_param
  
  local_param_size = sizeof(_video_renderer_task_local_param_t);
  construct_size = local_param_size - 4 + exec_param_size; // -4 is the size of exec_param in the struct

  ilm_param = (_video_renderer_task_local_param_t*) 
                  construct_local_para(construct_size, TD_CTRL);
  ASSERT(NULL != ilm_param);

  ilm_param->exec_func = exec_func;
  kal_mem_cpy(&(ilm_param->exec_param), exec_param, exec_param_size);

  eActiveModuleId = stack_get_active_module_id();
  p_ilm = allocate_ilm(eActiveModuleId);
  ASSERT(NULL != p_ilm);

  // check target task
  // Why not use return KAL_FALSE to instead
  // When ilm was allocated but not send to msg queue, ASSERT will happen when next
  // user to try to allocate ilm in the same thread
  if (NULL == exec_task_name)
  {
    ASSERT(0);
  }
  else
  {
    if (0 == strcmp(exec_task_name, "MOD_CAL"))
    {
      p_ilm->dest_mod_id = MOD_CAL;
      p_ilm->sap_id = CAL_SAP;
      p_ilm->msg_id = (msg_type) MSG_ID_CAL_VIDEO_RENDERER_REQ;
    }
    else
    {
      ASSERT(0);
    }
  }

  p_ilm->src_mod_id = eActiveModuleId;
  p_ilm->local_para_ptr = (local_para_struct*) ilm_param;
  p_ilm->peer_buff_ptr = NULL;

  msg_send_ext_queue(p_ilm);

  return KAL_TRUE;

#else //#if (defined(ISP_SUPPORT))
  return KAL_FALSE;
#endif //#if (defined(ISP_SUPPORT))

#else //#if defined(__MTK_TARGET__)
  return KAL_FALSE;
#endif //#if defined(__MTK_TARGET__)
}
Exemplo n.º 21
0
/*****************************************************************************
 * FUNCTION
 *  mmi_bt_avrcp_tst_same_down_cmd
 * DESCRIPTION
 *  Test when same down cmd comes before previous down cmd times up
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_bt_avrcp_tst_same_down_cmd()
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
	bt_avrcp_cmd_frame_ind_res_struct* msg_p = (bt_avrcp_cmd_frame_ind_res_struct*)
            construct_local_para(sizeof(bt_avrcp_cmd_frame_ind_res_struct), TD_CTRL);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    msg_p->chnl_num = BT_AVRCP_TG ;
    msg_p->profile_id = 0;
    msg_p->seq_id = 0;
    msg_p->c_type = 0;
    msg_p->data_len = 1; /*assign a value that's larger than 0*/
    msg_p->subunit_id = BT_AVRCP_SUBUNIT_ID_PASS_THROUGH;
    msg_p->subunit_type = BT_AVRCP_SUBUNIT_TYPE_PASS_THROUGH;
    msg_p->frame_data[0] = BT_AVRCP_OP_PASS_THROUGH;

    if(avrcp_test_counter <4)
    {
        if(avrcp_forward%2)
        {
            msg_p->frame_data[1] = MMI_AVRCP_POP_FORWARD;         /*stop button down*/
        }
        else
        {
            msg_p->frame_data[1] = MMI_AVRCP_POP_BACKWARD;         /*stop button down*/
        }
    }
    else
    {
        if(avrcp_forward%2)
        {
            msg_p->frame_data[1] = MMI_AVRCP_POP_FORWARD| 0x80;  /*stop button up*/
        }
        else
        {
            msg_p->frame_data[1] = MMI_AVRCP_POP_BACKWARD| 0x80;  /*stop button up*/
        }
        avrcp_forward ++ ;
    }
    
    /*send msg*/
    {
       ilm_struct *ilm_ptr = allocate_ilm(MOD_MMI);
       ilm_ptr->src_mod_id = MOD_MMI;
       ilm_ptr->dest_mod_id = MOD_MMI;
       ilm_ptr->sap_id = BT_AVRCP_SAP;
       ilm_ptr->msg_id = (msg_type)MSG_ID_BT_AVRCP_CMD_FRAME_IND;
       ilm_ptr->local_para_ptr = (local_para_struct*)msg_p;
       ilm_ptr->peer_buff_ptr = NULL;
    
       msg_send_ext_queue(ilm_ptr);
    }

    if( avrcp_test_counter < 4 )
    {
        avrcp_test_counter ++ ;
        StartTimer(BT_AVRCP_TEST_TIMER, 1000, (FuncPtr)mmi_bt_avrcp_tst_same_down_cmd);
    }
    else
    {
        avrcp_test_counter = 0;
    }


}
Exemplo n.º 22
0
/*****************************************************************************
 * FUNCTION
 *  mmi_bt_avrcp_tst_different_down_cmd
 * DESCRIPTION
 *  Test when different down cmd comes before previous down cmd times up
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_bt_avrcp_tst_different_down_cmd()
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
	bt_avrcp_cmd_frame_ind_res_struct* msg_p = (bt_avrcp_cmd_frame_ind_res_struct*)
            construct_local_para(sizeof(bt_avrcp_cmd_frame_ind_res_struct), TD_CTRL);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    msg_p->chnl_num = BT_AVRCP_TG ;
    msg_p->profile_id = 0;
    msg_p->seq_id = 0;
    msg_p->c_type = 0;
    msg_p->data_len = 1; /*assign a value that's larger than 0*/
    msg_p->subunit_id = BT_AVRCP_SUBUNIT_ID_PASS_THROUGH;
    msg_p->subunit_type = BT_AVRCP_SUBUNIT_TYPE_PASS_THROUGH;
    msg_p->frame_data[0] = BT_AVRCP_OP_PASS_THROUGH;

    switch(avrcp_test_counter)
    {
        case 0 :
        {
            msg_p->frame_data[1] = MMI_AVRCP_POP_PLAY ;        /*play button down*/
            avrcp_test_counter ++ ;
        }
        break;
        case 1 :
        {
            msg_p->frame_data[1] = MMI_AVRCP_POP_STOP ;        /*stop button down*/
            avrcp_test_counter ++ ;
        }
        break;
        case 2 :
        {
            msg_p->frame_data[1] = MMI_AVRCP_POP_STOP | 0x80 ; /*stop button up*/
            avrcp_test_counter = 0 ;
        }
        break;
        default:
            avrcp_test_counter = 0 ;            
        break;     
    }

    /*send msg*/
    {
       ilm_struct *ilm_ptr = allocate_ilm(MOD_MMI);
       ilm_ptr->src_mod_id = MOD_MMI;
       ilm_ptr->dest_mod_id = MOD_MMI;
       ilm_ptr->sap_id = BT_AVRCP_SAP;
       ilm_ptr->msg_id = (msg_type)MSG_ID_BT_AVRCP_CMD_FRAME_IND;
       ilm_ptr->local_para_ptr = (local_para_struct*)msg_p;
       ilm_ptr->peer_buff_ptr = NULL;
    
       msg_send_ext_queue(ilm_ptr);
    }

    if( avrcp_test_counter != 0 )
    {
        StartTimer(BT_AVRCP_TEST_TIMER, 1000, (FuncPtr)mmi_bt_avrcp_tst_different_down_cmd);
    }    

}