本文整理汇总了C++中RestoreIRQMask函数的典型用法代码示例。如果您正苦于以下问题:C++ RestoreIRQMask函数的具体用法?C++ RestoreIRQMask怎么用?C++ RestoreIRQMask使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RestoreIRQMask函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GPTI_StartItem
/*
* FUNCTION
* GPTI_StartItem
*
* DESCRIPTION
* GPT start a item.
*
* CALLS
*
* PARAMETERS
* moudle = UART_Module, SIM_Module, GPT_Module
* tick = the delay(the unit is 10ms)
* gptimer_func = the callback function when the tick is reached.
* parameter = the parameter inputed into gptimer_func
*
* RETURNS
* KAL_TRUE, start item successfully
* KAL_FALSE, start item fail
*
* GLOBALS AFFECTED
* external_global
*/
kal_bool GPTI_StartItem(kal_uint8 module,kal_uint16 tick,void (*gptimer_func)(void *),void *parameter)
{
kal_uint32 savedMask;
if (GPTTimer.status & (1<<module))
{
return KAL_FALSE;
}
GPTTimer.GPTItems[module].tick = GPTTimer.GPT_TICK+tick;
GPTTimer.GPTItems[module].gptimer_func = gptimer_func;
GPTTimer.GPTItems[module].parameter = parameter;
savedMask = SaveAndSetIRQMask();
//if (tick == 0)
// tick =1;
GPTTimer.status |= (1<<module);
if(GPTTimer.GPTSTOP == KAL_TRUE)
{
GPTTimer.GPTSTOP = KAL_FALSE;
RestoreIRQMask(savedMask);
savedMask = SaveAndSetIRQMask();
if (((volatile kal_bool)GPTTimer.GPTSTOP) == KAL_FALSE)
GPT_Start(gptimer_num);
}
RestoreIRQMask(savedMask);
return KAL_TRUE;
}
示例2: DclSADC_Open
/*************************************************************************
* FUNCTION
* DclSADC_Open
*
* DESCRIPTION
* This function is to open the SW ADC module and return a handle
*
* PARAMETERS
* dev: only valid for DCL_ADC
* flags: no sepcial flags is needed. Please use FLAGS_NONE
*
* RETURNS
* DCL_HANDLE_INVALID: Open failed
* Other value: A valid handle
*
*************************************************************************/
DCL_HANDLE DclSADC_Open(DCL_DEV dev, DCL_FLAGS flags)
{
DCL_UINT32 savedMask;
DCL_UINT32 i;
if (dev != DCL_ADC){
return DCL_HANDLE_INVALID; // Incorrecr device ID
}
for (i=0;i<MAX_DCL_ADC_HANDLE;i++)
{
savedMask = SaveAndSetIRQMask();
if(dcl_adc_handle_used[i] == 0)
{
dcl_adc_handle_used[i] = 1;
RestoreIRQMask(savedMask);
break;
}
RestoreIRQMask(savedMask);
}
if(i >= MAX_DCL_ADC_HANDLE)
{
return DCL_HANDLE_INVALID;
}
return (DCL_HANDLE)i;
}
示例3: cc_irq_trigger_interrupt_with_buff
kal_int32 cc_irq_trigger_interrupt_with_buff(kal_uint32 index, void *addr, kal_uint32 length)
{
kal_uint32 savedMask;
kal_int32 ret;
if (!CC_IRQ_TX_INDEX_IS_IN_RANGE(index) || addr == NULL || length > CC_IRQ_BUFF_MAX)
{
return CC_IRQ_ERR_PARAM;
}
index = CC_IRQ_TX_INDEX_OFFSET(index);
savedMask = SaveAndSetIRQMask();
if (CC_IRQ_IS_TX_RESOURCE_AVAIL(index, length))
{
if (!CC_IRQ_IS_ENABLED())
{
RestoreIRQMask(savedMask);
return CC_IRQ_ERR_PEER_ASYNC;
}
CC_IRQ_ENQUEUE_BUFF(index, addr, length);
CC_IRQ_TRIGGER_INTR(index);
ret = CC_IRQ_SUCCESS;
}
else
{
ret = CC_IRQ_ERR_CHANNEL_FULL;
}
RestoreIRQMask(savedMask);
return ret;
}
示例4: Audio_SW_CPD_Eevent_ChangeMode
void Audio_SW_CPD_Eevent_ChangeMode(kal_bool flag)
{
kal_uint32 savedMask;
kal_uint32 reg_value;
if(flag){
savedMask = SaveAndSetIRQMask();
reg_value = *MCU_TOPSM_SM_SW_WAKEUP;
reg_value |= (0x1 << 0); //bit[0]: request to md2gsys
*MCU_TOPSM_SM_SW_WAKEUP = reg_value;
RestoreIRQMask( savedMask );
//This only needs to be applied to these three chips due to CPD HW status bug
#if defined(MT6250) || defined(MT6280) || defined(MT6583) || defined(MT6260)
AUDIO_DELAY(33);
#endif
while(!(*MCU_TOPSM_SM_MAS_RDY_STA & 0x00000001));
}
else{
savedMask = SaveAndSetIRQMask();
reg_value = *MCU_TOPSM_SM_SW_WAKEUP;
reg_value &= ~(0x1 << 0);
*MCU_TOPSM_SM_SW_WAKEUP = reg_value;
RestoreIRQMask( savedMask );
}
}
示例5: MT6302_Writer_GPIO
void MT6302_Writer_GPIO(kal_uint8 data)
{
kal_uint32 i, j;
kal_uint8 MT6302_CS_PIN, MT6302_CLK_PIN, MT6302_DAT_PIN;
i = SaveAndSetIRQMask();
if(KAL_FALSE == MT6302_checkSPIMode()){
RestoreIRQMask(i);
// some states of 3 SPI pins don't match our expectation.
ASSERT(0);
}
MT6302_CS_PIN=MT6302_getGPIOCS();
MT6302_CLK_PIN=MT6302_getGPIOCLK();
MT6302_DAT_PIN=MT6302_getGPIODAT();
GPIO_WriteIO(0, MT6302_CS_PIN);
for(j=8;j>0;j--)
{
if(data&(0x1<<(j-1)))
GPIO_WriteIO(1, MT6302_DAT_PIN);
else
GPIO_WriteIO(0, MT6302_DAT_PIN);
GPIO_WriteIO(1, MT6302_CLK_PIN);
GPIO_WriteIO(0, MT6302_CLK_PIN);
}
GPIO_WriteIO(0, MT6302_DAT_PIN);
GPIO_WriteIO(1, MT6302_CS_PIN);
RestoreIRQMask(i);
}
示例6: _VideoCommGetBuffData
static kal_bool _VideoCommGetBuffData(
const VIDEO_COMM_BUFF_QUEUE_T* prBuffQueue,
VIDEO_COMM_STATE_T *prCommState,
VIDEO_BUFFERHEADER_TYPE_T *prBuffHeader)
{
const kal_uint32 u4ReadIdx = prBuffQueue->u4ReadIdx;
const kal_uint32 u4WriteIdx = prBuffQueue->u4WriteIdx;
kal_uint32 u4SavedMask;
u4SavedMask = SaveAndSetIRQMask();
prCommState->u4EntryCount++;
RestoreIRQMask(u4SavedMask);
if (u4ReadIdx == u4WriteIdx)
{
u4SavedMask = SaveAndSetIRQMask();
prCommState->u4EntryCount--;
RestoreIRQMask(u4SavedMask);
return KAL_FALSE;
}
*prBuffHeader = prBuffQueue->prBuffQ[u4ReadIdx];
u4SavedMask = SaveAndSetIRQMask();
prCommState->u4EntryCount--;
RestoreIRQMask(u4SavedMask);
return KAL_TRUE;
}
示例7: DclHGPT_Open
/*-----------------------------------------------------------------------*
* FUNCTION
* DclHGPT_Open
*
* DESCRIPTION
* This function is to open a HW GPT module. Note that HW GPT only supports
* single open for each valid eDev and if DCL_GPT1 is chosen SGPT may be
* influenced and work abnormally.
*
* PARAMETERS
* eDev - only valid for GPT1 and GPT2
* flags - no sepcial flags is needed. Please use FLAGS_NONE
*
* RETURNS
* DCL_HANDLE_INVALID - Open failed.
* other value - a valid handle
*
*------------------------------------------------------------------------*/
DCL_HANDLE DclHGPT_Open(GPT_DEV eDev, DCL_FLAGS flags)
{
kal_uint32 savedMask;
switch(eDev)
{
case GPT1:
savedMask = SaveAndSetIRQMask();
if (KAL_TRUE == fgGPT1Open)
{
RestoreIRQMask(savedMask);
return (DCL_HGPT_MAGIC_NUM | GPT1);
}
fgGPT1Open = KAL_TRUE;
RestoreIRQMask(savedMask);
return (DCL_HGPT_MAGIC_NUM | GPT1);//use return instead of break;
case GPT2:
#if !defined(__IC_SLT__) // for slt load, always return a valid handle
savedMask = SaveAndSetIRQMask();
if (KAL_TRUE == fgGPT2Open)
{
RestoreIRQMask(savedMask);
return DCL_HANDLE_INVALID;
}
fgGPT2Open = KAL_TRUE;
RestoreIRQMask(savedMask);
#endif
return (DCL_HGPT_MAGIC_NUM | GPT2);//use return instead of break;
default:
ASSERT(0);
return DCL_HANDLE_INVALID;
}
}
示例8: DclHGPT_Open
/*-----------------------------------------------------------------------*
* FUNCTION
* DclHGPT_Open
*
* DESCRIPTION
* This function is to open a HW GPT module. Note that HW GPT only supports
* single open for each valid eDev and if DCL_GPT1 is chosen SGPT may be
* influenced and work abnormally.
*
* PARAMETERS
* eDev - only valid for GPT1 and GPT2
* flags - no sepcial flags is needed. Please use FLAGS_NONE
*
* RETURNS
* DCL_HANDLE_INVALID - Open failed.
* other value - a valid handle
*
*------------------------------------------------------------------------*/
DCL_HANDLE DclHGPT_Open(GPT_DEV eDev, DCL_FLAGS flags)
{
kal_uint32 savedMask;
switch(eDev)
{
case GPT1:
savedMask = SaveAndSetIRQMask();
if (KAL_TRUE == fgGPT1Open)
{
RestoreIRQMask(savedMask);
return (DCL_HGPT_MAGIC_NUM | GPT1);
}
fgGPT1Open = KAL_TRUE;
RestoreIRQMask(savedMask);
return (DCL_HGPT_MAGIC_NUM | GPT1);//use return instead of break;
case GPT2:
savedMask = SaveAndSetIRQMask();
if (KAL_TRUE == fgGPT2Open)
{
RestoreIRQMask(savedMask);
return DCL_HANDLE_INVALID;
}
fgGPT2Open = KAL_TRUE;
RestoreIRQMask(savedMask);
return (DCL_HGPT_MAGIC_NUM | GPT2);//use return instead of break;
default:
ASSERT(0);
return DCL_HANDLE_INVALID;
}
}
示例9: L1Audio_HISR
void L1Audio_HISR( void )
{
uint32 savedMask;
L1Audio_Disable_DSPSlowIdle();
if( l1audio.hisrMagicFlag ) {
int32 I;
kal_uint16 temp;
temp = *AUDIO_DBG_SHERIF;
for( I = 0; I < MAX_HISR_HANDLER; I++ ) {
if( l1audio.hisrMagicFlag & (1<<I) ) {
savedMask = SaveAndSetIRQMask();
l1audio.hisrMagicFlag &= ~(1<<I);
RestoreIRQMask( savedMask );
kal_brief_trace( TRACE_GROUP_DSPDEBUG, DSPDEBUG_CTRLFLOW, temp, I);
l1audio.hisrHandler[I]( l1audio.hisrUserData[I] );
if( l1audio.postHisrHandler != (L1Audio_EventHandler)0 )
l1audio.postHisrHandler( (void*)l1audio.hisrMagicNo[I] );
}
}
}
#if !defined( MED_MODEM )
//special case when MED_MODEM( of MED_PROFILE ) is defined, all Media_Play, Media_record
//do not exist, then mediaHisr could be removed to reduce memory size.
//In the future, when old interface are not used, mediaHisr should be removed officially.
if( l1audio.media_flag != 0 ) { /* Audio File Playback/Recording */
#ifndef __L1_STANDALONE__ // avoid link error
mediaHisr( l1audio.media_flag );
#endif
if( l1audio.postHisrHandler != (L1Audio_EventHandler)0 )
l1audio.postHisrHandler( (void*)l1audio.media_flag );
l1audio.media_flag = 0;
}
#endif
if( l1audio.event_flag ) {
int16 I;
for( I = 0; I < MAX_AUDIO_FUNCTIONS; I++ ) {
if( l1audio.event_flag & (1<<I) ) {
savedMask = SaveAndSetIRQMask();
l1audio.event_flag &= ~(1<<I);
RestoreIRQMask( savedMask );
L1Audio_SetEvent( I, l1audio.evData[I] );
}
}
}
// To restore slow idle ctrl for DSP
L1Audio_Enable_DSPSlowIdle();
}
示例10: adc_sche_measure
/*
* FUNCTION
* adc_sche_measure
*
* DESCRIPTION
* This function is to measure ADC channel.
*
* CALLS
*
* PARAMETERS
* adc_sche_id: logical channel id
*
* RETURNS
* None
*
* GLOBALS AFFECTED
* None
*/
void adc_sche_measure(void* msg_ptr)
{
MeasParameter *adc_param = (MeasParameter *)msg_ptr;
#if ( (defined(MT6205B))||defined(MT6226M) || (defined(MT6218))|| (defined(MT6218B))|| (defined(MT6219))|| (defined(MT6217))|| (defined(MT6225))|| (defined(MT6228))|| (defined(MT6229))|| (defined(MT6230))|| (defined(MT6226))|| (defined(MT6227)))
#ifdef BMT_DEBUG
//dbg_printWithTime("mea,%d..\r\n",adc_param->adc_logic_id);
#endif
#if 0
/* under construction !*/
/* under construction !*/
#endif
adc_parameters[adc_param->adc_logic_id].adc_sche_event_id = NULL;
if (adc_parameters[adc_param->adc_logic_id].conti_measure)
{
#if !defined(__CHARGER_WITH_IMMEDIMATE_ADC__)
kal_uint32 savedMask;
savedMask = SaveAndSetIRQMask();
adc_sync_mode_on = KAL_TRUE;
adc_pwrdown_disable();
DRV_Reg(AUXADC_SYNC) |= (1<<adc_param->adc_phy_id);
RestoreIRQMask(savedMask);
#endif
adc_sche_rw_status |= (1 << adc_param->adc_logic_id);
adc_sche_set_timer(adc_param->adc_logic_id,1,adc_sche_readback);
}
#endif /*MT6205B,MT6218, MT6218B*/
}
示例11: i2c_wait_transaction_complete_and_lock
//----------------------------Sccb internal arbiteration------------------------------
//--When return from this function, I bit is turned off!!--
static kal_uint32 i2c_wait_transaction_complete_and_lock(SCCB_OWNER owner)
{
kal_uint32 savedMask;
while(1)
{
if(i2c_status.state==SCCB_READY_STATE)
{
savedMask = SaveAndSetIRQMask();
#if defined(I2C_DEBUG)
LT=DRV_Reg(0x80200000);
#endif
if(i2c_status.state==SCCB_READY_STATE) //The sccb is currently free
{
i2c_status.state=SCCB_BUSY_STATE; //Lock it
i2c_status.owner=owner;
I2C_POWER_ON;
return savedMask;
}
else
RestoreIRQMask(savedMask); // What a pity, that the handle is locked by somebody again. back to waiting loop
}
else if(sccb_handle[owner].sccb_config.get_handle_wait==KAL_FALSE)
return 0;
}//end of while
}
示例12: USB2UART_ClrTxBuffer
/* clear tx buffer */
static void USB2UART_ClrTxBuffer(UART_PORT port, module_type ownerid)
{
kal_uint32 savedMask;
#ifndef __PRODUCTION_RELEASE__
if(ownerid != USB2UARTPort.ownerid)
{
EXT_ASSERT( 0, (kal_uint32) ownerid, USB2UARTPort.ownerid, 0);
}
#endif
drv_trace0(TRACE_FUNC, USBACM_CLEAR_TX_BUF);
// kal_prompt_trace(MOD_USB, "clrTx\n");
/* stop dma channel if current status is CDC ACM*/
if ( (gUsbDevice.device_type == USB_CDC_ACM) && (USB2UARTPort.initialized == KAL_TRUE)
&&(gUsbDevice.nDevState==DEVSTATE_CONFIG))
{
USB_Stop_DMA_Channel(g_UsbACM.txpipe->byEP, USB_TX_EP_TYPE);
}
savedMask = SaveAndSetIRQMask();
USB2UARTPort.Tx_Buffer.Write = 0;
USB2UARTPort.Tx_Buffer.Read = 0;
g_UsbACM.send_Txilm = KAL_TRUE;
RestoreIRQMask(savedMask);
drv_trace1(TRACE_FUNC, USBACM_CLEAR_TX_BUF_READY_TO_READ_FLAG, ownerid);
// kal_prompt_trace(MOD_USB, "clr RDY W %d", ownerid);
}
示例13: sim_switchPhysicalSlotMapping
kal_bool sim_switchPhysicalSlotMapping(kal_bool inverse)
{
kal_uint32 maskValue;
maskValue = SaveAndSetIRQMask();
sim_physicalSlotChanged = inverse;
RestoreIRQMask(maskValue);
if(KAL_FALSE == maskValue)
{
#if !defined( __MAUI_BASIC__)
tst_sys_trace("SIM slots mapping is default mapping now");
#else
dbg_print("SIM slots mapping is default mapping now");
#endif
}
else
{
#if !defined( __MAUI_BASIC__)
tst_sys_trace("SIM slots mapping is inverse mapping now");
#else
dbg_print("SIM slots mapping is inverse mapping now");
#endif
}
return sim_physicalSlotChanged;
}
开发者ID:akibsayyed,项目名称:CELLTEL82_WET_KK_GPRS_HSPA_MOLY.WR8.W1315.MD.WG.MP.V35,代码行数:28,代码来源:icc_switchControl_al.c
示例14: pmic_reg_write
/*
* FUNCTION
* pmic_reg_write
*
* DESCRIPTION
* write data to PMIC
*
* CALLS
* used to write data to PMIC
*
* PARAMETERS
* data: write data
* register_index: register index
*
* RETURNS
* None
*
* GLOBALS AFFECTED
* external_global
*/
void pmic_reg_write(kal_uint8 data, kal_uint16 register_index)
{
kal_uint32 savedMask;
savedMask = SaveAndSetIRQMask();
B2PSI_write(data, register_index);
RestoreIRQMask(savedMask);
}
示例15: DCM_MCUBUS_DCM_OFF
/** to workaround WHQA_00012220, "may not update way_en while disabling prefetch buffer",
* here provides an API to switch MCUBUS DCM dynamically.
*/
void DCM_MCUBUS_DCM_OFF(kal_uint32 off)
{
#if defined (REENTRY_SUPPORT)
kal_uint32 _savedMask;
_savedMask = SaveAndSetIRQMask();
if (0 != off) {
dcm_mcubus_dcm_off++;
}
else {
if (dcm_mcubus_dcm_off>0)
dcm_mcubus_dcm_off--;
}
RestoreIRQMask(_savedMask);
#else //#if defined (REENTRY_SUPPORT)
if (0 != off) {
dcm_mcubus_dcm_off++;
}
else {
if (dcm_mcubus_dcm_off>0)
dcm_mcubus_dcm_off--;
}
#endif //#if defined (REENTRY_SUPPORT)
#if defined (DCM_ENABLE)
*PWR_DCM_DEBUG_CON1 = reg_aor(*PWR_DCM_DEBUG_CON1, ~(1<<7), (0 != dcm_mcubus_dcm_off) ? (1<<7) : 0);
#endif //#if defined (DCM_ENABLE)
}