Exemplo n.º 1
0
/** 
 * \fn     context_EnableClient / context_DisableClient
 * \brief  Enable a specific client activation
 * 
 * Called by the driver main when needed to enble/disable a specific event handling.
 * The Enable function also schedules the driver-task if the specified client is pending.
 * 
 * \note   
 * \param  hContext   - The module handle
 * \param  uClientId  - The client's index
 * \return void 
 * \sa     context_DriverTask
 */ 
void context_EnableClient (TI_HANDLE hContext, TI_UINT32 uClientId)
{
	TContext *pContext = (TContext *)hContext;

#ifdef TI_DBG
    if (pContext->aClientEnabled[uClientId])
    {
        TRACE0(pContext->hReport, REPORT_SEVERITY_ERROR , "context_EnableClient() Client  already enabled!!\n");
        return;
    }
    TRACE3(pContext->hReport, REPORT_SEVERITY_INFORMATION , "context_EnableClient(): Client=, ID=%d, enabled=%d, pending=%d\n", uClientId, pContext->aClientEnabled[uClientId], pContext->aClientPending[uClientId]);
#endif /* TI_DBG */

    /* Enable client */
    pContext->aClientEnabled[uClientId] = TI_TRUE;

    /* If client is pending, schedule driver task */
    if (pContext->aClientPending[uClientId])
    {
        /* 
         * If configured to switch context, request driver task scheduling.
         * Else (context switch not required) call the driver task directly. 
         */
        if (pContext->bContextSwitchRequired)
        {
            os_RequestSchedule (pContext->hOs);
        }
        else 
        {
            context_DriverTask (hContext);
        }
    }
}
Exemplo n.º 2
0
/**
 * \fn     context_EnableClient / context_DisableClient
 * \brief  Enable a specific client activation
 *
 * Called by the driver main when needed to enble/disable a specific event handling.
 * The Enable function also schedules the driver-task if the specified client is pending.
 *
 * \note
 * \param  hContext   - The module handle
 * \param  uClientId  - The client's index
 * \return void
 * \sa     context_DriverTask
 */
void context_EnableClient (TI_HANDLE hContext, TI_UINT32 uClientId)
{
	TContext *pContext = (TContext *)hContext;

#ifdef TI_DBG
	if (pContext->aClientEnabled[uClientId]) {
		return;
	}
#endif /* TI_DBG */

	/* Enable client */
	pContext->aClientEnabled[uClientId] = TI_TRUE;

	/* If client is pending, schedule driver task */
	if (pContext->aClientPending[uClientId]) {

		/*
		 * If configured to switch context, request driver task scheduling.
		 * Else (context switch not required) call the driver task directly.
		 */
		if (pContext->bContextSwitchRequired) {
			os_RequestSchedule (pContext->hOs);
		} else {
			context_DriverTask (hContext);
		}
	}
}
Exemplo n.º 3
0
/** 
 * \fn     context_RequestSchedule
 * \brief  Handle client's switch to driver's context.
 * 
 * This function is called by a client from external context event.
 * It sets the client's Pending flag and requests the driver's task scheduling.
 * Thus, the client's callback will be called afterwards from the driver context.
 * 
 * \note   
 * \param  hContext   - The module handle
 * \param  uClientId  - The client's index
 * \return void 
 * \sa     context_DriverTask
 */ 
void context_RequestSchedule (TI_HANDLE hContext, TI_UINT32 uClientId)
{
	TContext *pContext = (TContext *)hContext;
#ifdef TI_DBG
    pContext->aRequestCount[uClientId]++; 
    TRACE3(pContext->hReport, REPORT_SEVERITY_INFORMATION , "context_RequestSchedule(): Client=, ID=%d, enabled=%d, pending=%d\n", uClientId, pContext->aClientEnabled[uClientId], pContext->aClientPending[uClientId]);
#endif /* TI_DBG */

    /* Set client's Pending flag */
    pContext->aClientPending[uClientId] = TI_TRUE;

    /* 
     * If configured to switch context, request driver task scheduling.
     * Else (context switch not required) call the driver task directly. 
     */
    if (pContext->bContextSwitchRequired)
     {
        os_RequestSchedule (pContext->hOs);
    }
    else 

    {
        context_DriverTask (hContext);
    }
}
Exemplo n.º 4
0
/**
 * \fn     context_RequestSchedule
 * \brief  Handle client's switch to driver's context.
 *
 * This function is called by a client from external context event.
 * It sets the client's Pending flag and requests the driver's task scheduling.
 * Thus, the client's callback will be called afterwards from the driver context.
 *
 * \note
 * \param  hContext   - The module handle
 * \param  uClientId  - The client's index
 * \return void
 * \sa     context_DriverTask
 */
void context_RequestSchedule (TI_HANDLE hContext, TI_UINT32 uClientId)
{
	TContext *pContext = (TContext *)hContext;

#ifdef TI_DBG
	pContext->aRequestCount[uClientId]++;
#endif /* TI_DBG */

	/* Set client's Pending flag */
	pContext->aClientPending[uClientId] = TI_TRUE;

	/*
	 * If configured to switch context, request driver task scheduling.
	 * Else (context switch not required) call the driver task directly.
	 */
	if (pContext->bContextSwitchRequired) {
		os_RequestSchedule (pContext->hOs);
	} else {
		context_DriverTask (hContext);
	}
}