예제 #1
0
void bmt_stop_timer(bmt_timer_enum timer_id)
{
   evshed_cancel_event(bmt_event_scheduler_ptr, &bmt_event_scheduler_id[timer_id]);
   #if !defined(BMT_CHARGING_DISABLE)
   if(BMT_CHARGE_TIMEOUT_TIMER == timer_id)
   {
	   drv_trace1(TRACE_GROUP_10, BMT_SAFETY_TIMER_STOP_TRC, bmt_total_charge_time);
   }
   #endif
}
예제 #2
0
/*****************************************************************************
 * FUNCTION
 *  avk_mytimer_stop_timer
 * DESCRIPTION
 *  stop a mytimer
 * PARAMETERS
 *  mytimer : [IN] mytimer id
 * RETURNS
 *  -1 : fail to stop timer
 *  n  : left time util expiry
 *****************************************************************************/
S32 avk_mytimer_stop_timer(avk_mytimer_id mytimer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    eventid timerid;
    
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    timerid = (eventid)mytimer;
    return (S32)evshed_cancel_event((event_scheduler *)g_mytimer_base_cntx,&timerid);
}
예제 #3
0
void bt_simap_stop_timer(eventid *timer_id_p)
{
    eventid timer_evt_id = *timer_id_p;

    kal_trace(TRACE_GROUP_1, BT_SIMAP_STOP_TIMER);
    if (bt_p->os_init == TRUE)
    {
        if (timer_evt_id != 0)
        {
            evshed_cancel_event(bt_p->evsh_sched, timer_id_p);
            *timer_id_p = 0;
        }
    }
}
예제 #4
0
/*****************************************************************************
 * FUNCTION
 *  jpush_alarm_cancel
 * DESCRIPTION
 *  cancel the alarm registrations from event schedule
 * PARAMETERS
 *  event_id        [?]  
 * RETURNS
 *  void
 *****************************************************************************/
void jpush_alarm_cancel(eventid *event_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_FUNC, JPUSH_ALARM_CANCEL);     
    jpush_timer_mutex_lock();
    if(*event_id){
        evshed_cancel_event(j2me_alarm_es_ptr, event_id);
    }
    jpush_timer_mutex_unlock();
}
예제 #5
0
void bt_simap_start_timer(eventid *timer_id_p, kal_uint32 timer_duration, kal_timer_func_ptr funct_ptr)
{
    eventid timer_evt_id = *timer_id_p;

    kal_trace(TRACE_GROUP_1, BT_SIMAP_START_TIMER, timer_duration);
    if (bt_p->os_init == TRUE)
    {
        if (timer_evt_id != 0)
        {
            evshed_cancel_event(bt_p->evsh_sched, timer_id_p);
            *timer_id_p = 0;
        }

        *timer_id_p = evshed_set_event(bt_p->evsh_sched, funct_ptr, NULL, MS_TO_TICKS(timer_duration));
    }
}
예제 #6
0
void tcm_stop_timer( kal_uint8 context_id )
{
    kal_uint8 index;
    tcm_event_info_struct *event_ptr ;

    kal_trace(TRACE_FUNC, FUNC_TCM_STOP_TIMER);

    index = tcm_get_sib_id( GET_FROM_CONTEXTID, context_id );

    ASSERT(index < TCM_TOT_CONTEXT);

    event_ptr = &(tcm_ptr_g->t3333timer[index]) ;

    event_ptr->context_id = 0xff ;

    if (event_ptr->event_id != NULL)
    {
		kal_brief_trace(TRACE_INFO, TCM_STOP_EVENT_TIMER, context_id) ;
		evshed_cancel_event(tcm_ptr_g->tcm_event_scheduler_ptr, &(event_ptr->event_id)) ;
    }

    return;
}
예제 #7
0
/*****************************************************************************
 * FUNCTION
 *  applib_async_file_task_stop
 * DESCRIPTION
 *
 * PARAMETERS
 *  op      [?]
 * RETURNS
 *
 *****************************************************************************/
kal_bool applib_async_file_task_stop(applib_async_file_task_struct *op)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (op == NULL)
    {
        return KAL_FALSE;
    }
    if (op->isFSopen == KAL_TRUE)
    {
        FS_Close(op->fileHandle);
        op->isFSopen = KAL_FALSE;
    }

    if (op->es != NULL)
    {
        if (applib_callout_active(op->fs_timer))
        {
            op->fs_timer.c_flags &= ~APPLIB_CALLOUT_ACTIVE;
            ASSERT(op->fs_timer.event_id != NULL);
            evshed_cancel_event(op->es, &(op->fs_timer.event_id));
            op->fs_timer.event_id = NULL;
        }
        else
        {
            applib_callout_deactivate(op->fs_timer);
        }
        op->es = NULL;
    }
    kal_mem_set(op, 0, sizeof(applib_async_file_task_struct));
    return KAL_TRUE;
}
예제 #8
0
파일: l4c_init.c 프로젝트: fantomgs/modem89
/*****************************************************************************
 * FUNCTION
 *  l4c_reset
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  
 *****************************************************************************/
kal_bool l4c_reset()
{
    kal_bool ret_val = KAL_FALSE;
    //stack_timer_struct temp_timer;
    event_scheduler *temp_evs_ptr;
/* For GPRS_FLC_UT MAUI_02419672 mtk02126 */
#if defined(__RMMI_UT__) && defined(__MOD_TCM__)       
    lcd_lqueue *temp_queue_ptr = NULL;
#endif /*~!defined(__MTK_TARGET__) && defined(__RMMI_UT__) && defined(__MOD_TCM__) */            

    kal_int8 i = 1;

    for (i = L4_MAX_SIM_NUM - 1; i >= 0; i--)
    {
        l4c_ptr_g = &l4c_cntxt_g[i];
        l4c_current_mod_id = MOD_L4C + i;

        /* 
         * We save context here and restore after mem_set to avoid allocate/create some context many time.
         * That will run out of memory.
         */
        /* For GPRS_FLC_UT MAUI_02419672 mtk02126 */
        #if defined(__RMMI_UT__) && defined(__MOD_TCM__)       
        temp_queue_ptr = L4C_PTR->gprs_flc_queue;
        #endif /*~!defined(__MTK_TARGET__) && defined(__RMMI_UT__) && defined(__MOD_TCM__) */                   

        //temp_timer = L4C_PTR->base_timer;
        temp_evs_ptr = L4C_PTR->event_scheduler_ptr;

    
    /* 
     * move the kam_mem_set here, we can save some pointer before mem_set
     */        
        kal_mem_set((kal_uint8*) L4C_PTR, (kal_uint32) 0, (kal_uint32) sizeof(l4c_context_struct));
    
    /* 
     * We restore context here.
     */
    /* For GPRS_FLC_UT MAUI_02419672 mtk02126 */         
    #if defined(__RMMI_UT__) && defined(__MOD_TCM__)       
        L4C_PTR->gprs_flc_queue = temp_queue_ptr;
    #endif /*~ defined(__RMMI_UT__) && defined(__MOD_TCM__) */             
        ret_val = l4c_init_context();

        rmmi_init_context();

    #ifdef __HOMEZONE_SUPPORT__
        HZ_PTR = &l4c_hz_cntxt_g[i];
        kal_mem_set((kal_uint8*) HZ_PTR, (kal_uint32) 0, (kal_uint32) sizeof(l4c_hz_context_struct));

        l4c_hz_init_context();
    #endif 

	#if !defined(__MTK_TARGET__) && defined(__RMMI_UT__)
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
        {
            kal_int8 timer_index; 
            //L4C_PTR->base_timer = temp_timer;
            L4C_PTR->event_scheduler_ptr = temp_evs_ptr;
            for (timer_index=0;timer_index<8;timer_index++)
            {
                if (L4C_PTR->event_id[timer_index] != 0)
                {
                    evshed_cancel_event(L4C_PTR->event_scheduler_ptr, &(L4C_PTR->event_id[timer_index]));                    
                    L4C_PTR->event_id[timer_index] = 0;
                }
            }
        }

	    RMMI_PTR->command_allow = KAL_TRUE;
	    L4C_PTR->smu_activated = L4C_SMU_ACTIVE;
		L4C_PTR->cfun_state = 1;
    #ifdef __MOD_TCM__		
		L4C_PTR->tcm_ready_flag = KAL_TRUE;
	#endif //mtk02285, 201003, 6251_ram
		L4C_PTR->csm_state = CSM_STATE_CISS_READY;
	#endif
    }

    l4c_comm_ptr_g = &l4c_comm_cntxt_g;
    ret_val = l4c_init_common_context();
    ret_val &= rmmi_init_common_context();

#if defined(__GEMINI__)
    l4c_root_ptr_g = &l4c_root_cntxt_g;
    ret_val = l4c_init_root_context();
#endif

#ifdef __IPV4V6__
#ifdef __RMMI_UT__
    kal_mem_set(ipv6ut_tcm_pdp_addr_type, 0x8d, sizeof(ipv6ut_tcm_pdp_addr_type));
#endif
#endif

    return ret_val;
}