当前位置: 首页>>代码示例>>C++>>正文


C++ Hwi_disable函数代码示例

本文整理汇总了C++中Hwi_disable函数的典型用法代码示例。如果您正苦于以下问题:C++ Hwi_disable函数的具体用法?C++ Hwi_disable怎么用?C++ Hwi_disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Hwi_disable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Task_deleteTerminatedTasksFunc

/*
 *  ======== Task_deleteTerminatedTasksFunc ========
 */
Void Task_deleteTerminatedTasksFunc()
{
    UInt hwiKey, taskKey;
    Task_Handle tsk;

    taskKey = Task_disable();

    hwiKey = Hwi_disable();

    if (!Queue_empty(Task_Module_State_terminatedQ())) {
        tsk = Queue_head(Task_Module_State_terminatedQ());
        Hwi_restore(hwiKey);
        tsk->readyQ = NULL;
        Task_delete(&tsk);
    }
    else {
        Hwi_restore(hwiKey);
    }

    Task_restore(taskKey);
}
开发者ID:DemonTu,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:24,代码来源:Task.c

示例2: Timer_trigger

/*
 *  ======== Timer_trigger ========
 *  1. stop timer
 *  2. write the period with insts
 *  3. start the timer.
 */
Void Timer_trigger(Timer_Object *obj, UInt insts)
{
    UInt key;

    /* follow proper procedure for dynamic period change */
    key = Hwi_disable();

    /* RESET=1, ENBL=0 */
    CTM_ctm.CTCR[obj->ctmid] = 2;

    Hwi_clearInterrupt(obj->intNum);
    Hwi_enableInterrupt(obj->intNum);

    /* set interval to insts */
    CTM_ctm.TINTVLR[obj->ctmid] = insts;

    /* RESTART=0, INT=1, ENBL=1 */
    CTM_ctm.CTCR[obj->ctmid] = 0x00000101;

    Hwi_restore(key);
}
开发者ID:CheredHerry,项目名称:ti-bios,代码行数:27,代码来源:Timer_smp.c

示例3: Task_yield

/*
 *  ======== Task_yield ========
 */
Void Task_yield()
{
    UInt tskKey, hwiKey;

    tskKey = Task_disable();
    hwiKey = Hwi_disable();

    if (Task_module->curQ) {
        /* move current task to end of curQ */
        Queue_enqueue(Task_module->curQ,
            Queue_dequeue(Task_module->curQ));
    }
    Task_module->curQ = NULL;  /* force a Task_switch() */
    Task_module->workFlag = 1;

    Hwi_restore(hwiKey);

    Log_write3(Task_LM_yield, (UArg)Task_module->curTask, (UArg)(Task_module->curTask->fxn), (UArg)(BIOS_getThreadType()));

    Task_restore(tskKey);
}
开发者ID:DemonTu,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:24,代码来源:Task.c

示例4: unregisterEdma3Interrupts

/**  To Unregister the ISRs with the underlying OS, if previously registered. */
void unregisterEdma3Interrupts (unsigned int edma3Id)
    {
    static UInt32 cookie = 0;
    Int eventId = 0;	/* GEM event id */

    /* Disabling the global interrupts */
    cookie = Hwi_disable();

	/* Transfer completion ISR */
	CpIntc_disableHostInt(0, ccXferHostInt[edma3Id][dsp_num]);
    eventId = CpIntc_getEventId(ccXferHostInt[edma3Id][dsp_num]);
	EventCombiner_disableEvent(eventId);

	/* CC/TC Error ISR */
	CpIntc_disableHostInt(0, edma3ErrHostInt[edma3Id][dsp_num]);
    eventId = CpIntc_getEventId(edma3ErrHostInt[edma3Id][dsp_num]);
	EventCombiner_disableEvent(eventId);

    /* Restore interrupts */
    Hwi_restore(cookie);
    }
开发者ID:andreimironenko,项目名称:edma3lld,代码行数:22,代码来源:sample_c6657_int_reg.c

示例5: Timer_setAvailMask

/*
 *  ======== Timer_setAvailMask ========
 */
Bool Timer_setAvailMask(UInt mask)
{
    UInt i;
    UInt key;
    UInt tmpMask;

    key = Hwi_disable();
    tmpMask = mask;
    for (i = 0; i < Timer_numTimerDevices; i++) {
        /* Check if mask is setting any currently used timer as available */
        if ((tmpMask & 0x1) && (Timer_module->handles[i] != NULL)) {
            Hwi_restore(key);
            return (FALSE);
        }
        tmpMask = tmpMask >> 1;
    }
    Timer_module->availMask = mask;
    Hwi_restore(key);

    return (TRUE);
}
开发者ID:mobiaqua,项目名称:ti-sysbios,代码行数:24,代码来源:Timer.c

示例6: Timer_disableCC3200

/*
 *  ======== Timer_disableCC3200 ========
 */
Void Timer_disableCC3200(Int id)
{
    UInt key;

    key = Hwi_disable();

    switch (id) {
        case 0: GPT_A0_CLK_GATING &= ~(0x1);
                break;
        case 1: GPT_A1_CLK_GATING &= ~(0x1);
                break;
        case 2: GPT_A2_CLK_GATING &= ~(0x1);
                break;
        case 3: GPT_A3_CLK_GATING &= ~(0x1);
                break;
        default:
                break;
    }

    Hwi_restore(key);
}
开发者ID:DemonTu,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:24,代码来源:Timer.c

示例7: TimestampProvider_get64

/*
 *  ======== TimestampProvider_get64 ========
 */
Void TimestampProvider_get64(Types_Timestamp64 *result)
{
    UInt key;
    UInt64 timestamp;

    key = Hwi_disable();

    if (TimestampProvider_useClockTimer) {

        timestamp = Clock_getTicks() * Timer_getPeriod(MOD->timer)
                   + Timer_getExpiredCounts(MOD->timer);
    }
    else {
        timestamp = ((UInt64)MOD->hi << 32) + Timer_getExpiredCounts(MOD->timer);
    }

    Hwi_restore(key);

    result->hi = timestamp >> 32;
    result->lo = timestamp;
}
开发者ID:andreimironenko,项目名称:bios,代码行数:24,代码来源:TimestampProvider.c

示例8: AlgLink_scdAlgRtPrmUpdate

Int32 AlgLink_scdAlgRtPrmUpdate(AlgLink_ScdObj * pObj, AlgLink_ScdChObj *pChObj, FVID2_Frame *pFrame)
{
    System_FrameInfo *pFrameInfo;
    System_LinkChInfo *pChInfo;
    UInt32 oldIntState;

    pFrameInfo = (System_FrameInfo *)pFrame->appData;

    if(pFrameInfo==NULL)
        return FVID2_EFAIL;

    if(pFrameInfo->rtChInfoUpdate==FALSE)
        return FVID2_SOK;

    pChInfo = &pFrameInfo->rtChInfo;

    oldIntState = Hwi_disable();

    if(pChInfo->width != pChObj->width
        ||
       pChInfo->height != pChObj->height
    )
    {
        pChObj->rtPrmUpdate           = TRUE;
        pChObj->algReset              = TRUE;
    }

    pChObj->width                 = SystemUtils_floor(pChInfo->width, ALG_LINK_SIMCOP_SCD_WIDTH_ALIGN);
    pChObj->height                = pChInfo->height;

    if(pChObj->width>pObj->algCreatePrm.maxWidth)
        pChObj->width = pObj->algCreatePrm.maxWidth;

    if(pChObj->height>pObj->algCreatePrm.maxHeight)
        pChObj->height = pObj->algCreatePrm.maxHeight;

    Hwi_restore(oldIntState);

    return FVID2_SOK;
}
开发者ID:JammyWei,项目名称:dm8168,代码行数:40,代码来源:scdLink_alg.c

示例9: Swi_setAttrs

/*
 *  ======== Swi_setAttrs ========
 */
Void Swi_setAttrs(Swi_Object *swi, Swi_FuncPtr fxn, Swi_Params *params)
{
    UInt hwiKey;
    Swi_Params swiParams;

    if (params == NULL) {
        Swi_Params_init(&swiParams);
        params = &swiParams;
    }

    hwiKey = Hwi_disable();

    /* defensively remove swi from its readyQ */
    Queue_remove((Queue_Elem *)swi);

    if (fxn) {
        swi->fxn = fxn;
    }

    swi->posted = FALSE;

    swi->arg0 = params->arg0;
    swi->arg1 = params->arg1;

    if (params->priority == ~0) {
        swi->priority = Swi_numPriorities - 1;
    }
    else {
        swi->priority = params->priority;
    }

    Assert_isTrue((swi->priority < Swi_numPriorities),
                   Swi_A_badPriority);

    swi->mask = 1 << swi->priority;
    swi->initTrigger = swi->trigger = params->trigger;
    swi->readyQ = Queue_Object_get(Swi_module->readyQ, swi->priority);

    Hwi_restore(hwiKey);
}
开发者ID:alexeicolin,项目名称:sysbios,代码行数:43,代码来源:Swi_smp.c

示例10: IpcPower_unregisterCallback

Int IpcPower_unregisterCallback(Int event, IpcPower_CallbackFuncPtr cbck)
{
    IArg hwiKey;
    IpcPower_CallbackElem **list, *node;
    Int status = IpcPower_E_FAIL;
    BIOS_ThreadType context = BIOS_getThreadType();

    if ((context != BIOS_ThreadType_Task) &&
        (context != BIOS_ThreadType_Main)) {
        Log_print0(Diags_ERROR, FXNN":Invalid context\n");
        return (status);
    }

    list = &IpcPower_callbackList;
    node  = NULL;

    hwiKey = Hwi_disable();  /* begin: critical section */
    while (*list != NULL) {
        if ( ((*list)->callback == cbck) &&
             ((*list)->event == event) ) {
            node   = *list;
            *list  = (*list)->next;
            status = IpcPower_S_SUCCESS;
            break;
        }
        list = &(*list)->next;
    }
    Hwi_restore(hwiKey);  /* end: critical section */

    if (status == IpcPower_S_SUCCESS) {
        if (node != NULL) {
            Memory_free(NULL, node, sizeof(IpcPower_CallbackElem));
        }
        else {
            Log_print0(Diags_ERROR, FXNN":Invalid pointer\n");
        }
    }

    return (status);
}
开发者ID:Hashcode,项目名称:sysbios-rpmsg,代码行数:40,代码来源:IpcPowerDsp.c

示例11: Swi_restore

/*
 *  ======== Swi_restore ========
 */
Void Swi_restore(UInt swiKey)
{
    UInt hwiKey;

    if (swiKey == FALSE) {
        hwiKey = Hwi_disable();

        if (Swi_module->curSet) {
            Hwi_restore(hwiKey);
            Swi_schedule();     /* sets locked to FALSE */
        }
        else {
            Swi_module->locked = FALSE;
            Hwi_restore(hwiKey);
        }

        if (BIOS_taskEnabled) {
            /* run task scheduler if its unlocked */
            TASK_RESTORE(TASK_DISABLE());
        }
    }
}
开发者ID:andreimironenko,项目名称:bios,代码行数:25,代码来源:Swi.c

示例12: MemoryProtect_unlock

/*
 *  ======== MemoryProtect_unlock ========
 *  unlocks the permission attribute table entries for the
 *  specified controller, using the specified key.
 */
Void MemoryProtect_unlock(MemoryProtect_Controller *ctrl, MemoryProtect_Key *keyreg)
{
    MemoryProtect_Lock *lock;
    UInt key;

    lock = ctrl->mpLck;

    key = Hwi_disable();

    /* it's illegal to unlock the MemoryProtect when already unlocked */
    if (lock->mpLkStat & MemoryProtect_LKSTATLK) {
        lock->mpLkCmd = MemoryProtect_LCKKEYR;
        /* must write all four key regs exactly once */
        lock->mpLk0 = keyreg->key0;
        lock->mpLk1 = keyreg->key1;
        lock->mpLk2 = keyreg->key2;
        lock->mpLk3 = keyreg->key3;
        lock->mpLkCmd = MemoryProtect_LCKUNLOCK;
    }

    Hwi_restore(key);
}
开发者ID:andreimironenko,项目名称:bios,代码行数:27,代码来源:MemoryProtect.c

示例13: Timer_disableTiva

/*
 *  ======== Timer_disableTiva ========
 */
Void Timer_disableTiva(Int id)
{
    UInt key;

    key = Hwi_disable();

    //TODO: Can we remove the delays from the disable code ?

    /* if a pre-Flurry class device, and one of the first four timers ... */
    if (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_CLASS_M) <
        SYSCTL_DID0_CLASS_FLURRY) && (id < 4)) {

        /* enable run mode clock */
        *RCGC1 &= ~(UInt32)(1 << (id + 16));

        /* ensure at least 5 clock cycle delay for clock disable */
        *RCGC1;
        *RCGC1;
        *RCGC1;
        *RCGC1;
        *RCGC1;
    }
    /* else, Flurry or later device, or 5th timer or above ... */
    else {
        /* enable run mode clock */
        *RCGCTIMERS &= ~(UInt32)(1 << id);
        *SCGCTIMERS &= ~(UInt32)(1 << id);
        *DCGCTIMERS &= ~(UInt32)(1 << id);

        /* ensure at least 5 clock cycle delay for clock disable */
        *RCGCTIMERS;
        *RCGCTIMERS;
        *RCGCTIMERS;
        *RCGCTIMERS;
        *RCGCTIMERS;
    }

    Hwi_restore(key);
}
开发者ID:mobiaqua,项目名称:ti-sysbios,代码行数:42,代码来源:Timer.c

示例14: PWMTiva_control

/*
 *  ======== PWMTiva_control ========
 *  @pre    Function assumes that the handle is not NULL
 */
int PWMTiva_control(PWM_Handle handle, unsigned int cmd, void *arg)
{
    unsigned int           key;
    uint32_t               period;
    uint32_t               presRegVal;
    uint8_t                prescalar;
    PWMTiva_Object        *object = handle->object;
    PWMTiva_HWAttrs const *hwAttrs = handle->hwAttrs;

    switch(cmd) {
        case PWMTiva_CHANGE_GEN_PERIOD:
            Assert_isTrue((uint32_t *) arg != NULL, NULL);

            /* Calculate period in PWM timer counts */
            period = (*(uint32_t *) arg) * (object->pwmStatus)->cyclesPerMicroSec;

            /* Ensure new period can be generated with current prescalar */
            PWMTiva_calculatePrescalar(period, &presRegVal, &prescalar);
            if (prescalar != (object->pwmStatus)->prescalar) {
                return (-1);
            }
            period /= prescalar;

            key = Hwi_disable();
            PWMGenPeriodSet(hwAttrs->baseAddr, hwAttrs->pwmOutput & PWM_GEN_MASK,
                            period);

            /* Update PWM status with new period */
            *((object->pwmStatus)->genPeriods +
              ((hwAttrs->pwmOutput / PWM_OUT_0) - 1)) = *((uint32_t *) arg);

            Hwi_restore(key);

            return (PWMTiva_CHANGE_GEN_PERIOD);
    }

    /* No implementation yet */
    return (PWM_STATUS_UNDEFINEDCMD);
}
开发者ID:DemonTu,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:43,代码来源:PWMTiva.c

示例15: InterruptDsp_intRegister

/*!
 *  ======== InterruptDsp_intRegister ========
 *  Register ISR for remote processor interrupt
 */
Void InterruptDsp_intRegister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
                              Fxn func, UArg arg)
{
    Hwi_Params  hwiAttrs;
    UInt        key;

    Assert_isTrue(intInfo->intVectorId <= 15, 
                  ti_sdo_ipc_Ipc_A_internal);
                  
    Assert_isTrue(intInfo->localIntId >= DSP_INT0 && 
                  intInfo->localIntId <= DSP_INT3,
                  ti_sdo_ipc_Ipc_A_internal);
                  
    Assert_isTrue(intInfo->remoteIntId == ARM_INT0 || 
                  intInfo->remoteIntId == ARM_INT1,
                  ti_sdo_ipc_Ipc_A_internal);
    
    /* Disable global interrupts */
    key = Hwi_disable();

    InterruptDsp_intClear(remoteProcId, intInfo);

    /* Register interrupt for communication between ARM and DSP */
    Hwi_Params_init(&hwiAttrs);
    hwiAttrs.maskSetting = Hwi_MaskingOption_SELF;
    hwiAttrs.arg         = arg;
    hwiAttrs.eventId     = intInfo->localIntId;

    Hwi_create(intInfo->intVectorId,
               (Hwi_FuncPtr)func,
               &hwiAttrs,
               NULL);

    /* Restore global interrupts */
    Hwi_restore(key);

    /* enable the interrupt vector */
    Hwi_enableInterrupt(intInfo->intVectorId);
}
开发者ID:mobiaqua,项目名称:ti-ipc1,代码行数:43,代码来源:InterruptDsp.c


注:本文中的Hwi_disable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。