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


C++ IntMasterDisable函数代码示例

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


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

示例1: SysTickTimerHandler

//*****************************************************************************
//
// The SysTick Timer interrupt handler.
//
//*****************************************************************************
void SysTickTimerHandler(void)
{
    
    IntMasterDisable();
    SYSTICKINT_FLAG = true;
    IntMasterEnable();   
}
开发者ID:Jesse-Millwood,项目名称:EGR424-Lab5,代码行数:12,代码来源:lab5.c

示例2: Timer1IntHandler

//*****************************************************************************
//
// The interrupt handler for the first timer interrupt.
//
//*****************************************************************************
void
Timer1IntHandler(void)
{

    //
    // Clear the timer interrupt.
    //
    TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
	DEBUG_TP5(0); 

    //
    // Update the interrupt status.
    //
    IntMasterDisable();
	
	if(GetDMCmode() != BIT_MODE )
	{

		/*------------------------------------------------------------*/
		/* EncoderTick(QEI0_BASE); time is 3~ microsecond			  */
		/* EncoderTick(QEI0_BASE); time is 3~ microsecond			  */
		/*------------------------------------------------------------*/		
		EncoderTick(QEI0_BASE); // PITCH Encoder	  
		EncoderTick(QEI1_BASE); // ROLL Encoder
	}
    IntMasterEnable();
	
	DEBUG_TP5(1); 
}
开发者ID:EranSegal,项目名称:ek-lm4f230H5QR,代码行数:34,代码来源:SysTick.c

示例3: RemoTIUARTGetRxMsgCount

//*****************************************************************************
//
// Gets the current number of UART messages waiting to be processed.
//
// This function returns the number of unprocessed messages that are currently
// in the UART ring buffer.
//
// \return Current number of UART messages in the buffer.
//
//*****************************************************************************
uint_fast16_t
RemoTIUARTGetRxMsgCount(void)
{
    bool bIntState;
    uint_fast16_t ui16Temp;

    //
    // Turn off interrupts and save Interrupt enable state.
    //
    bIntState = IntMasterDisable();

    //
    // Copy message count to local variable.
    //
    ui16Temp = g_ui16RxMsgCount;

    //
    // Restore interrupt enable state.
    //
    if(!bIntState)
    {
        IntMasterEnable();
    }

    //
    // Return a snapshot of the message count.
    //
    return(ui16Temp);
}
开发者ID:ilemus,项目名称:uCOS-II,代码行数:39,代码来源:remoti_uart.c

示例4: mRTCGetRaw

// *******************************************************
// Returns the raw RTC time which is the same number
// of systick interrupts.
unsigned long long mRTCGetRaw(void)
{
	IntMasterDisable();
	unsigned long long ticks = g_ullRTCTicks;
	IntMasterEnable();
	return ticks;
}
开发者ID:msteinke,项目名称:helicopter_RTP_controller,代码行数:10,代码来源:mRTC.c

示例5: RemoTIUARTRegisterTxCompleteCallback

//*****************************************************************************
//
// Register a callback for UART transmission complete..
//
// \param pfnCallback is a pointer to a tRemoTICallback function.
//
// Register the \e pfnCallback that will be called when a UART transmisssion is
// complete.  The Transmit buffer has just been emptied of its last byte. Only
// one callback is active at a time.  Calling this function more than once
// will override earlier callbacks.  Pass \b NULL to unregister.
//
// \return None.
//
//*****************************************************************************
void
RemoTIUARTRegisterTxCompleteCallback(tRemoTICallback *pfnCallback)
{
    bool bIntState;
    //
    // Turn off interrupts and save previous interrupt enable state.
    //
    bIntState = IntMasterDisable();

    //
    // Register the callback.
    //
    g_pfnTxCallback = pfnCallback;

    //
    // Restore interrupt master enable state.
    //
    if(!bIntState)
    {
        IntMasterEnable();
    }

    //
    // Finished.
    //
}
开发者ID:ilemus,项目名称:uCOS-II,代码行数:40,代码来源:remoti_uart.c

示例6: init_BtnHandler

/*****************************************************
 * 	Function: init_BtnHandler
 *	Description: Initializes button interrupt
 *			Initializes timer for button counter
 *	Input: NONE
 *	Output: NONE
 *****************************************************/
void init_BtnHandler(void)
{
	// Unlock un-maskable pin
	HWREG(BTN_OVERRIDE_REG + GPIO_O_LOCK) = GPIO_LOCK_KEY;

	// Set up our interrupt for button presses
	IntMasterDisable();																				// Disable all interrupts
	GPIOIntDisable(BTN_OVERRIDE_REG, BTN_OVERRIDE);
	GPIOPinTypeGPIOInput(BTN_OVERRIDE_REG, BTN_OVERRIDE);
	GPIOPadConfigSet(BTN_OVERRIDE_REG, BTN_OVERRIDE, GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);		// Set Pull-up
	GPIOIntTypeSet(BTN_OVERRIDE_REG, BTN_OVERRIDE, GPIO_BOTH_EDGES); 								// Set edge to trigger on
	GPIOIntClear(BTN_OVERRIDE_REG, BTN_OVERRIDE); 													// Clear the interrupt bit
	GPIOIntEnable(BTN_OVERRIDE_REG, BTN_OVERRIDE); 													// Enable the interrupt
	IntEnable(INT_GPIOE);

	// Lock un-maskable pin
	HWREG(BTN_OVERRIDE_REG + GPIO_O_LOCK) = 0;

	// Setup timer interrupt for button pressing
	// This timer will run up and when it is released we will check how long it was running
	SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
	TimerConfigure(BTN_OVERRIDE_TIM_BASE, TIMER_CFG_PERIODIC);					// Setup interrupt as 32 bit timer counting up
	TimerLoadSet(BTN_OVERRIDE_TIM_BASE, BTN_OVERRIDE_TIM, clockTime/1000);		// Load Timer
	IntEnable(INT_TIMER0A);
	TimerIntEnable(BTN_OVERRIDE_TIM_BASE, TIMER_TIMA_TIMEOUT);

	// Turn the input pin to the button high
	GPIOPinTypeGPIOOutput(BTN_OVERRIDE_CONTROL_REG, BTN_OVERRIDE_CONTROL);
	GPIOPinWrite(BTN_OVERRIDE_CONTROL_REG, BTN_OVERRIDE_CONTROL, BTN_OVERRIDE_CONTROL);
}
开发者ID:BooRan,项目名称:Auto_Water_TM4,代码行数:37,代码来源:main.c

示例7: IntDefaultHandler

//*****************************************************************************
//
//! This is the code that gets called when the processor receives an unexpected
//! interrupt.  This simply enters an infinite loop, preserving the system
//! state for examination by a debugger.
//!
//! \return None.
//
//*****************************************************************************
void
IntDefaultHandler(void)
{
    //
    // Disable all interrupts.
    //
    IntMasterDisable();

    //
    // Turn off all the PWM outputs.
    //
    PWMOutputState(PWM0_BASE, PWM_OUT_0_BIT | PWM_OUT_1_BIT | PWM_OUT_2_BIT |
                              PWM_OUT_3_BIT | PWM_OUT_4_BIT | PWM_OUT_5_BIT,
                              false);

    //
    // Turn on STATUS and MODE LEDs.  They will remain on.
    //
    BlinkStart(STATUS_LED, 1, 1, 1);
    BlinkStart(MODE_LED, 1, 1, 1);
    BlinkHandler();

    //
    // Go into an infinite loop.
    //
    while(1)
    {
    }
}
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:38,代码来源:main.c

示例8: ADC0IntHandler

void ADC0IntHandler()
{

    unsigned long adc0Value;   // Holds the ADC result
    char adc0String[5];        // Holds the string-converted ADC result

    // 清ADC0中断标志.
    // ADCIntClear (unsigned long ulBase, unsigned long ulSequenceNum) 
    ADCIntClear(ADC0_BASE, 0);
    
    //从SSO读出转换结果 (FIFO0),本例中只有一个采样.如果要使用多个转换源,需要使用数组做为参数传递给API函数,保存FIFO转换结果.
    // long ADCSequenceDataGet (unsigned long ulBase,unsigned long ulSequenceNum,unsigned long *pulBuffer) 
    ADCSequenceDataGet(ADC0_BASE, 0, &adc0Value);
    adc0Value= ((59960 - (adc0Value * 100)) / 356);
    
    
    // 在OLED上显示当前温度
    usprintf(adc0String, "%d", adc0Value);    
    IntMasterDisable();
    RIT128x96x4StringDraw("Current temp :         ", 6, 48, 15);
    RIT128x96x4StringDraw(adc0String, 94, 48, 15);
    IntMasterEnable();  

    // ADC模块空闲,可以进行下一次转换
    adc_busy=0;    
 
}
开发者ID:mybays,项目名称:lm3s,代码行数:27,代码来源:main.c

示例9: USBMouseMain

//*****************************************************************************
//
// Main routine for the mouse.
//
//*****************************************************************************
void
USBMouseMain(void)
{
    //
    // Disable interrupts while changing the variables below.
    //
    IntMasterDisable();

    switch(sMouseState.eState)
    {
        case MOUSE_PENDING:
        {
            //
            // Send the report since there is one pending.
            //
            USBDHIDMouseStateChange((void *)&g_sMouseDevice,
                                    (uint8_t)sMouseState.i32X,
                                    (uint8_t)sMouseState.i32Y,
                                    sMouseState.ui8Buttons);
            //
            // Clear out the report data so that pending data does not
            // continually accumulate.
            //
            sMouseState.i32X = 0;
            sMouseState.i32Y = 0;

            if(sMouseState.ui8Buttons)
            {
                //
                // Need to always send out that all buttons are released.
                //
                sMouseState.ui8Buttons = 0;
                sMouseState.eState = MOUSE_SENDING_PEND;
            }
            else
            {
                //
                // Switch to sending state and wait for the transmit to be
                // complete.
                //
                sMouseState.eState = MOUSE_SENDING;
            }

            break;
        }
        case MOUSE_DISCONNECT:
        case MOUSE_SENDING:
        case MOUSE_SENDING_PEND:
        case MOUSE_IDLE:
        default:
        {
            break;
        }
    }

    //
    // Enable interrupts now that the main loop is complete.
    //
    IntMasterEnable();
}
开发者ID:setarcos,项目名称:tm4c123gxl_chid,代码行数:65,代码来源:usb_mouse.c

示例10: UpdateIndexAtomic

//*****************************************************************************
//
// Change the value of a variable atomically.
//
// \param pui32Val points to the index whose value is to be modified.
// \param ui32Delta is the number of bytes to increment the index by.
// \param ui32Size is the size of the buffer the index refers to.
//
// This function is used to increment a read or write buffer index that may be
// written in various different contexts.  It ensures that the
// read/modify/write sequence is not interrupted and, hence, guards against
// corruption of the variable.  The new value is adjusted for buffer wrap.
//
// \return None.
//
//*****************************************************************************
static void
UpdateIndexAtomic(volatile uint32_t *pui32Val, uint32_t ui32Delta,
                  uint32_t ui32Size)
{
    bool bIntsOff;

    //
    // Turn interrupts off temporarily.
    //
    bIntsOff = IntMasterDisable();

    //
    // Update the variable value.
    //
    *pui32Val += ui32Delta;

    //
    // Correct for wrap.  We use a loop here since we don't want to use a
    // modulus operation with interrupts off but we don't want to fail in
    // case ui32Delta is greater than ui32Size (which is extremely unlikely
    // but...)
    //
    while(*pui32Val >= ui32Size)
    {
        *pui32Val -= ui32Size;
    }

    //
    // Restore the interrupt state
    //
    if(!bIntsOff)
    {
        IntMasterEnable();
    }
}
开发者ID:azim1866,项目名称:ECE5770,代码行数:51,代码来源:usbringbuf.c

示例11: IrqInterruptDisable

/************************************************************************************//**
** \brief     Disables the generation IRQ interrupts and stores information on
**            whether or not the interrupts were already disabled before explicitly
**            disabling them with this function. Normally used as a pair together
**            with IrqInterruptRestore during a critical section.
** \return    none.
**
****************************************************************************************/
void IrqInterruptDisable(void)
{
  if (interruptNesting == 0)
  {
    IntMasterDisable();
  }
  interruptNesting++;
} /*** end of IrqInterruptDisable ***/
开发者ID:x893,项目名称:OpenBLT,代码行数:16,代码来源:irq.c

示例12: oled_d_print_xyb

//Print at x,y with given brightness
void oled_d_print_xyb(char *str, unsigned long x, unsigned long y, unsigned long b)
{
	IntMasterDisable();

	RIT128x96x4StringDraw(str, x, y, b);

	IntMasterEnable();
}
开发者ID:gibsjose,项目名称:SoundVisualizer,代码行数:9,代码来源:oled_driver.c

示例13: oled_d_print_origin

//Print at 0,0 with full brightness
void oled_d_print_origin(char *str)
{
	IntMasterDisable();

	RIT128x96x4StringDraw(str, 0, 0, MAX_BRIGHTNESS);

	IntMasterEnable();
}
开发者ID:gibsjose,项目名称:SoundVisualizer,代码行数:9,代码来源:oled_driver.c

示例14: oled_d_clear

//Clear the screen
void oled_d_clear(void)
{
	IntMasterDisable();

	RIT128x96x4Clear();

	IntMasterEnable();
}
开发者ID:gibsjose,项目名称:SoundVisualizer,代码行数:9,代码来源:oled_driver.c

示例15: halTimer32kIntConnect

/**************************************************************************//**
* @brief    Connect interrupt service routine to 32 kHz timer interrupt.
*
* @param    pFnHandle   Void function pointer to interrupt service routine
*
* @return   None
******************************************************************************/
void halTimer32kIntConnect(void (*pFnHandle)(void))
{
    tBoolean intDisabled = IntMasterDisable();
    SleepModeIntRegister(&halTimer32kIsr);  // Register function and
    IntDisable(INT_SMTIM);                  // disable SMTIM interrupts
    pFptr = pFnHandle;                      // Set custom ISR
    if(!intDisabled) IntMasterEnable();
}
开发者ID:CDACBANG,项目名称:Ubimote_HR,代码行数:15,代码来源:hal_timer_32k.c


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