本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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;
}
示例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.
//
}
示例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);
}
示例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)
{
}
}
示例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;
}
示例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();
}
示例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();
}
}
示例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 ***/
示例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();
}
示例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();
}
示例14: oled_d_clear
//Clear the screen
void oled_d_clear(void)
{
IntMasterDisable();
RIT128x96x4Clear();
IntMasterEnable();
}
示例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();
}