本文整理匯總了C++中EnableInterrupts函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnableInterrupts函數的具體用法?C++ EnableInterrupts怎麽用?C++ EnableInterrupts使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnableInterrupts函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: HotPlugService
void HotPlugService (void) {
DisableInterrupts(0xFF);
Active9232();
if ((HDCP_TxSupports == true)) {
if (HDCP_AksvValid == true) {
// AV MUTE
TPI_DEBUG_PRINT (("TMDS -> Enabled (Video Muted)\n"));
ReadModifyWriteTPI(0x1A, BIT_6 | BIT_4 | BIT_3,
0x40 | 0x00 | 0x08);
tmdsPoweredUp = true;
EnableInterrupts(BIT_0 | 0x02 | 0x10 | 0x20 | 0x40 | 0x80);
}
} else {
TPI_DEBUG_PRINT (("TMDS -> Enabled\n"));
ReadModifyWriteTPI(0x1A,
BIT_6 | BIT_4 | BIT_3,
0x40 | 0x00 | 0x08);
tmdsPoweredUp = TRUE;
EnableInterrupts(0x01 | 0x02 | 0x10 | 0x40);
}
TxPowerStateD0();
I2C_WriteByte(TPI_SLAVE_ADDR, 0xcd, 0x0);
I2C_WriteByte(TPI_SLAVE_ADDR, 0x19, 0x0);
}
示例2: xmbrs_flush_chars
static void xmbrs_flush_chars(struct tty_struct *tty)
{
volatile unsigned int *uartp;
struct xmb_serial *info = (struct xmb_serial *)tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->device, "xmbrs_flush_chars"))
return;
uartp = (volatile unsigned int *) info->addr;
EnableInterrupts(uartp);
/* If there are chars waiting in RX buffer then enable interrupt
to permit receiving them */
save_flags_cli(flags);
if ( (uartp[XUL_STATUS_REG_OFFSET/4] & XUL_SR_RX_FIFO_VALID_DATA) &&
(info->flags & ASYNC_INITIALIZED) ) {
EnableInterrupts(uartp);
}
/* Any chars pending to go out (and tty not stopped etc)? */
if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
!info->xmit_buf)
return;
/* Force remaining chars out */
save_flags_cli(flags);
EnableInterrupts(uartp);
force_tx_fifo_fill(info);
restore_flags(flags);
}
示例3: main
int main(void){ // Real Lab13
// for the real board grader to work
// you must connect PD3 to your DAC output
TExaS_Init(SW_PIN_PE3210, DAC_PIN_PB3210,ScopeOn); // activate grader and set system clock to 80 MHz
// PortE used for piano keys, PortB used for DAC
Sound_Init(); // initialize SysTick timer and DAC
Piano_Init();
EnableInterrupts(); // enable after all initialization are done
DAC_Init();
while(1){ volatile unsigned long current_switch;
current_switch = Piano_In();
if (current_switch == 0x01){
EnableInterrupts();
Sound_Tone(4780);
}
else if (current_switch == 0x02){
EnableInterrupts();
Sound_Tone(4259);
}
else if (current_switch == 0x04){
EnableInterrupts();
Sound_Tone(3794);
}
else if (current_switch == 0x08){
EnableInterrupts();
Sound_Tone(3189);
}
// else if (current_switch == 0x00){
// Sound_Off();
// DisableInterrupts();
// }
delay(10);
}
}
示例4: main
int main(void){
// configurar a UART1
U1BRG = ((20000000 + 8 * 38400) / (16 * 38400)) - 1;
U1MODEbits.BRGH = 0; //divisão por 16
U1MODEbits.PDSEL = 0b10;
U1MODEbits.STSEL = 0; // 1 stop bit - 1
U1STAbits.URXEN = 1;
U1STAbits.UTXEN = 1;
U1MODEbits.ON = 1;
IFS0bits.U1RXIF = 1;
// UART interrupts
U1STAbits.URXISEL = 00;
IEC0bits.U1RXIE = 1;
IPC6bits.U1IP = 3;
EnableInterrupts();
// ADC
TRISBbits.TRISB14 = 1; // RB4 digital output disconnected
AD1PCFGbits.PCFG14 = 0; // RB4 configured as analog input (AN4)
AD1CHSbits.CH0SA = 14; // Selects AN7 as input for the A/D converter
AD1CON2bits.SMPI = 7; // 8 conversoes
AD1CON1bits.SSRC = 7;
AD1CON1bits.CLRASAM = 1;
AD1CON3bits.SAMC = 16;
AD1CON1bits.ON = 1;
IPC6bits.AD1IP = 3;
IEC1bits.AD1IE = 1;
IFS1bits.AD1IF = 0;
EnableInterrupts();
// Timer 4
PR4 = 34482;
T4CONbits.TCKPS = 2;
TMR4 = 0;
//Timer 4 interrupts
IFS0bits.T4IF = 0;
IPC4bits.T4IP = 2;
IEC0bits.T4IE = 1;
//Timer 2
PR2 = 49999;
T2CONbits.TCKPS = 2;
TMR2 = 0;
T2CONbits.TON = 1;
OC1CONbits.OCM = 6;
OC1CONbits.OCTSEL = 0;
OC1RS = 12500;
OC1CONbits.ON = 1;
while(1);
return 0;
}
示例5: OS_Wait
// ******** OS_Wait ************
// decrement semaphore and spin/block if less than zero
// input: pointer to a counting semaphore
// output: none
void OS_Wait(Sema4Type *s){
DisableInterrupts();
while( s->Value <= 0){
//TODO: implement Blocking
EnableInterrupts();
DisableInterrupts();
}
s->Value--;
EnableInterrupts();
}
示例6: OS_bWait
// ******** OS_bWait ************
// if the semaphore is 0 then spin/block
// if the semaphore is 1, then clear semaphore to 0
// input: pointer to a binary semaphore
// output: none
void OS_bWait(Sema4Type *semaPt){
DisableInterrupts();
while( semaPt->Value != 1){
//TODO: implement Blocking
EnableInterrupts();
OS_Suspend();
DisableInterrupts();
}
semaPt->Value =0;
EnableInterrupts();
return;
}
示例7: OS_bWait
// ------------------------- OS_bWait --------------------------------
void OS_bWait(Sema4Type *semaPt){
DisableInterrupts();
while (semaPt->Value <= 0){
unlinkTCB(&Actives, RunPt);
linkTCB(&(semaPt->Blocked), RunPt);
RunPt->blockSt = semaPt;
OS_Suspend();
EnableInterrupts();
}
DisableInterrupts();
(*semaPt).Value = 0;
EnableInterrupts();
}
示例8: xmbrs_unthrottle
static void xmbrs_unthrottle(struct tty_struct * tty)
{
struct xmb_serial *info = (struct xmb_serial *)tty->driver_data;
#ifdef SERIAL_DEBUG_THROTTLE
char buf[64];
printk("unthrottle %s: %d....\n", _tty_name(tty, buf),
tty->ldisc.chars_in_buffer(tty));
#endif
if (serial_paranoia_check(info, tty->device, "xmbrs_unthrottle"))
return;
if (I_IXOFF(tty)) {
if (info->x_char)
info->x_char = 0;
else {
/* Force START_CHAR (xon) out */
volatile unsigned int *uartp;
unsigned long flags;
info->x_char = START_CHAR(tty);
uartp = (volatile unsigned int *) info->addr;
save_flags_cli(flags);
EnableInterrupts(uartp);
force_tx_fifo_fill(info);
restore_flags(flags);
}
}
}
示例9: main
int main(void){
// Digital ports configuration
TRISE = TRISE | 0xF0; // RE7-4 configured as input
// UART1 configuration
U1BRG = ((PBCLK+8*115200)/(16*115200))-1; // 115200 baudrate
U1MODEbits.PDSEL = 0; // 8 bits no parity
U1MODEbits.STSEL = 0; // 1 stop bit
U1STAbits.URXEN = 1; // Receiver enable
U1STAbits.URXISEL = 0; // Receiver interrupt mode
U1MODEbits.ON = 1; // UART enable
// Timer 2 configuration
T2CONbits.TCKPS = 4; // 1:16 prescaler
PR2 = PBCLK/16/100-1; // 100Hz frequency
TMR2 = 0; // Reset T2 count register
IEC0bits.T2IE = 1; // Enable T2 interrupts
IPC2bits.T2IP = 4; // T2 interrupt priority
IFS0bits.T2IF = 0; // Reset T2 interrupt flag
T2CONbits.TON = 1; // Enable T2
EnableInterrupts(); // Global interrupt enable
while(1);
return 0;
}
示例10: main
//debug code
int main(void){
PLL_Init(Bus80MHz); // bus clock at 50 MHz
Output_Init();
SYSCTL_RCGCGPIO_R |= 0x20; // activate port F
//ADC0_InitTimer0ATriggerSeq3(2, F30HZ); // ADC channel 0, 1000 Hz sampling
ADC0_InitTimer0ATriggerSeq3PD3(F30HZ);
//ADC0_InitSWTriggerSeq3_Ch9();
while((SYSCTL_PRGPIO_R&0x0020) == 0){};// ready?
GPIO_PORTF_DIR_R |= 0x02; // make PF1 output (PF1 built-in LEDs)
GPIO_PORTF_AFSEL_R &= ~0x02; // disable alt funct on PF1
GPIO_PORTF_DEN_R |= 0x02; // enable digital I/O on PF1
// configure PF1 as GPIO
GPIO_PORTF_PCTL_R = (GPIO_PORTF_PCTL_R&0xFFFFF0FF)+0x00000000;
GPIO_PORTF_AMSEL_R = 0; // disable analog functionality on PF
EnableInterrupts();
plotInit();
while(1){
GPIO_PORTF_DATA_R ^= 0x02; // toggle LED
//ADCvalue = ADC0_InSeq3();
temperature = adcToTemp(ADCvalue + offset);
plotPoint();
ST7735_SetCursor(1,2);
ST7735_sDecOut2(temperature);
ST7735_SetCursor(2,1);
ST7735_OutUDec(ADCvalue + offset);
}
}
示例11: EXTI0_IRQHandler
void EXTI0_IRQHandler(void)
{
DisableInterrupts();
PressButtom = TRUE;
EXTI_ClearITPendingBit(EXTI_Line0);
EnableInterrupts();
}
示例12: main
void main (void)
{
int i; // counter
// Init I/O
TRISD = 0b00000000; // PORTD bits 7:0 are all outputs (0)
TRISEbits.TRISE0 = 1; // TRISE0 input
INTCON2bits.RBPU = 0; // enable PORTB internal pullups
WPUBbits.WPUB0 = 1; // enable pull up on RB0
SetIntOSC(&ClockSpeed); // Set initial clock speed (250kHz)
SetupINT0Switch(); // Init switch
EnableInterrupts(); // Turn on interrupts
while (1)
{ // delay and count on LEDs here. Interrupt handles switch and freq changes
LATD = LED_Count++; // output count to PORTD LEDs
for (i = 0; i < 10; i++)// delay 1 sec @ 250kHz
{
__delay_ms(100);
}
}
}
示例13: Touch_BeginWaitForTouch
void Touch_BeginWaitForTouch(void){
// XP = 1 XN = DIG IN, INT ON FALL EDGE YP = Hi-Z YN = 0
DisableInterrupts();
// Set XP high
TOUCH_XP = 0xFF;
// Set YN low
TOUCH_YN = 0x00;
// Configure XN (PA3) for digital input
GPIO_PORTA_DIR_R &= ~0x08;
// Configure YP (PE5) for analog Hi-Z
GPIO_PORTE_DIR_R &= ~0x20;
GPIO_PORTE_DEN_R &= ~0x20;
// Setup falling edge interrupt on XN (PA3)
GPIO_PORTA_PUR_R |= 0x08; // enable weak pull up
GPIO_PORTA_IS_R &= ~0x08; // (d) PF4 is edge-sensitive
GPIO_PORTA_IBE_R &= ~0x08; // PF4 is not both edges
GPIO_PORTA_IEV_R &= ~0x08; // PF4 falling edge event
GPIO_PORTA_ICR_R = 0x08; // (e) clear flag4
GPIO_PORTA_IM_R |= 0x08; // (f) arm interrupt on PF4
NVIC_PRI0_R = (NVIC_PRI7_R&0xFFFFFF00)|0x000000a0;
NVIC_EN0_R = NVIC_EN0_INT0; // (h) enable interrupt 30 in NVIC
EnableInterrupts();
}
示例14: ARM_OPCODE_BRANCH
boolean CInterruptSystem::Initialize (void)
{
TExceptionTable *pTable = (TExceptionTable *) ARM_EXCEPTION_TABLE_BASE;
pTable->IRQ = ARM_OPCODE_BRANCH (ARM_DISTANCE (pTable->IRQ, IRQStub));
CleanDataCache ();
DataSyncBarrier ();
InvalidateInstructionCache ();
FlushBranchTargetCache ();
DataSyncBarrier ();
InstructionSyncBarrier ();
#ifndef USE_RPI_STUB_AT
DataMemBarrier ();
write32 (ARM_IC_FIQ_CONTROL, 0);
write32 (ARM_IC_DISABLE_IRQS_1, (u32) -1);
write32 (ARM_IC_DISABLE_IRQS_2, (u32) -1);
write32 (ARM_IC_DISABLE_BASIC_IRQS, (u32) -1);
DataMemBarrier ();
#endif
EnableInterrupts ();
return TRUE;
}
示例15: main
int main(void){
TExaS_Init(SW_PIN_PE3210,DAC_PIN_PB3210,ScopeOn); // bus clock at 80 MHz
//Timer0A_Init(&songTask, F80HZ);
Piano_Init();
Sound_Init(0);
DAC_Init();
Heartbeat_Init();
// other initialization
EnableInterrupts();
uint32_t input;
while(1){
GPIO_PORTF_DATA_R ^= 0x04;
input = Piano_In();
if (input == 0x04){
Sound_Play(A);
}
else if (input == 0x02){
Sound_Play(C);
}
else if (input == 0x01){
Sound_Play(Eb);
}
else if (input == 0x07){
Sound_Play(A);
}
else {
Sound_Play(0);
}
}
}