• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IntMasterDisable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: oled_d_print_xy

//Print at x,y with full brightness
void oled_d_print_xy(char *str, unsigned long x, unsigned long y)
{
	IntMasterDisable();

	RIT128x96x4StringDraw(str, x, y, MAX_BRIGHTNESS);

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


示例17: RemoTIUARTWake

//##### INTERNAL BEGIN #####
//*****************************************************************************
//
// Send a wakup packet to the remote network processors UART interface.
//
// This function will send a NULL character to the UART interface repeatedly
// in order to awaken the RNP and cause it to start listening for UART packets.
//
// \return None.
//
//*****************************************************************************
void
RemoTIUARTWake(void)
{
#if 0
    bool bIntState;
    uint32_t ui32Ticks;

    //
    // Disable Master interrupts.  Record previous interrupt state to properly
    // restore it later.
    //
    bIntState = IntMasterDisable();

    //
    // Tick counter for tracking how many times we send the NULL character set.
    //
    ui32Ticks = 0;

    //
    // If the TX interrupt is enabled.  If it is assume UART is already
    // awake.  If it is not then wake up the UART on the RNP with a null char.
    //
    if((HWREG(g_ui32UARTBase + UART_O_IM) & 0x20) != UART_IM_TXIM);
    {
        do
        {
            //
            // Send consecutive NULL characters.
            //
            UARTCharPut(g_ui32UARTBase, 0);
            UARTCharPut(g_ui32UARTBase, 0);
            UARTCharPut(g_ui32UARTBase, 0);
            UARTCharPut(g_ui32UARTBase, 0);

            //
            // Delay 10 milliseconds to allow time for RNP to process and wake.
            //
            SysCtlDelay(SysCtlClockGet() / (100 * 3));
            ui32Ticks++;

        //
        // Send the NULL character set until we get a character back or we have
        // tried 10 times to get a response.
        //
        } while((ui32Ticks < 10) & (UARTCharsAvail(g_ui32UARTBase) == 0));
    }

    //
    // Restore the master interrupt enable to it previous state.
    //
    if(!bIntState)
    {
        IntMasterEnable();
    }
#endif // 0
}
开发者ID:EuphonistiHack,项目名称:marble-maze,代码行数:67,代码来源:remoti_uart.c


示例18: flashEraseCallback

static void flashEraseCallback(void)
{
    // Disable global interrupts
    IntMasterDisable();

    // Erase Flash CCA page
    FlashMainPageErase(CC2538_FLASH_CCA_ADDRESS);

    // Reset the board
    SysCtrlReset();
}
开发者ID:OsamaWajiha,项目名称:firmware,代码行数:11,代码来源:Board.cpp


示例19: HardwareInit

void HardwareInit()
{
  IntMasterDisable();
  //
  // Datasheet says use PLL if reading from ADC
  //
  SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ);
//  SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ);
  ConsoleInit(115200);
  A3906Init();
  SysTickInit(1000);
  RMBD01Init();
  IntMasterEnable();
}
开发者ID:EranSegal,项目名称:ek-lm4f230H5QR,代码行数:14,代码来源:EncoderReset.c


示例20: clock_init

static void clock_init(void)
{
    /**
     * Disable global interrupts
     */
    bool bIntDisabled = IntMasterDisable();

    /**
     * Configure the 32 kHz pins, PD6 and PD7, for crystal operation
     * By default they are configured as GPIOs
     */
    GPIODirModeSet(GPIO_D_BASE, 0x40, GPIO_DIR_MODE_IN);
    GPIODirModeSet(GPIO_D_BASE, 0x80, GPIO_DIR_MODE_IN);
    IOCPadConfigSet(GPIO_D_BASE, 0x40, IOC_OVERRIDE_ANA);
    IOCPadConfigSet(GPIO_D_BASE, 0x80, IOC_OVERRIDE_ANA);

    /**
     * Set the real-time clock to use the 32khz internal crystal
     * Set the system clock to use the external 32 MHz crystal
     * Set the system clock to 32 MHz
     */
    SysCtrlClockSet(true, false, SYS_CTRL_SYSDIV_32MHZ);

    /**
     * Set the IO clock to operate at 16 MHz
     * This way peripherals can run while the system clock is gated
     */
    SysCtrlIOClockSet(SYS_CTRL_SYSDIV_16MHZ);

    /**
     * Wait until the selected clock configuration is stable
     */
    while (!((HWREG(SYS_CTRL_CLOCK_STA)) & (SYS_CTRL_CLOCK_STA_XOSC_STB)));

    /**
     * Define what peripherals run in each mode
     */
    SysCtrlDeepSleepSetting();
    SysCtrlSleepSetting();
    SysCtrlRunSetting();
    SysCtrlWakeupSetting();

    /**
     * Re-enable interrupt if initially enabled.
     */
    if(!bIntDisabled)
    {
        IntMasterEnable();
    }
}
开发者ID:barriquello,项目名称:iotstack,代码行数:50,代码来源:board.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IntPoint函数代码示例发布时间:2022-05-30
下一篇:
C++ IntFromString函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap