本文整理汇总了C++中GlobalInterruptEnable函数的典型用法代码示例。如果您正苦于以下问题:C++ GlobalInterruptEnable函数的具体用法?C++ GlobalInterruptEnable怎么用?C++ GlobalInterruptEnable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GlobalInterruptEnable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
* runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start
* the loaded application code.
*/
int main(void)
{
/* Setup hardware required for the bootloader */
SetupHardware();
/* Turn on first LED on the board to indicate that the bootloader has started */
LEDs_SetAllLEDs(LEDS_LED1);
/* Enable global interrupts so that the USB stack can function */
GlobalInterruptEnable();
while (RunBootloader)
{
CDC_Task();
USB_USBTask();
/* Time out and start the sketch if one is present */
if (Timeout > TIMEOUT_PERIOD){
RunBootloader = false;}
}
/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();
/* Unlock the forced application start mode of the bootloader if it is restarted */
MagicBootKey = MAGIC_BOOT_KEY;
/* Enable the watchdog and force a timeout to reset the AVR */
wdt_enable(WDTO_250MS);
for (;;);
}
开发者ID:robthepyro,项目名称:Apollo-Voltmeter,代码行数:36,代码来源:BootloaderCDC.c
示例2: main
int main(void)
{
SetupHardware();
GlobalInterruptEnable();
sei();
for (;;)
{
if (tx_ticks > 0)
{
tx_ticks--;
}
else if (tx_ticks == 0)
{
LEDs_TurnOnLEDs(LEDS_LED2); // on = off?
}
if (rx_ticks > 0)
{
rx_ticks--;
}
else if (rx_ticks == 0)
{
LEDs_TurnOnLEDs(LEDS_LED1); // on = off?
}
MIDI_To_Arduino();
MIDI_To_Host();
USB_USBTask();
}
}
开发者ID:guidokritz,项目名称:KiloMux-Shield,代码行数:34,代码来源:arduino_midi.c
示例3: main
/**
* /brief Main function for the focuser firmware
*/
int main(int argc, char *argv[]) {
// initialize the
unsigned short d = 10;
led_on();
while (d--) {
_delay_ms(100);
led_off();
_delay_ms(100);
led_on();
}
led_off();
// initialize USB, but USB requests will only be handled when
// interrupts are enabled below
USB_Init(USB_DEVICE_OPT_FULLSPEED);
// start the timer, this also enables the watchdog timer
timer_start();
// enable interrupts so that USB processing can begin
GlobalInterruptEnable();
// do nothing
for (;;) {
if (saveneeded) {
motor_save();
}
if (newserial) {
serial_write();
}
}
}
开发者ID:AndreasFMueller,项目名称:Focuser,代码行数:35,代码来源:focuser.c
示例4: main
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
stdout=&mystdout;
stdin=&mystdin;
SetupHardware();
//LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
//Eval Prototype Sharp Reset Pin
//DDRB &= ~RESET_PIN; //Set Input
//PORTB |= RESET_PIN; //Set High
//DDRB |= RESET_PIN; //Set Output
//Drude Sharp LCD Reset PIN
PORTF |= RESETN_PIN; //Set High
DDRF |= RESETN_PIN; //Set Output
//Digitizer Interrupt
//DDRB &= ~(_BV(7)); //PB7 input
//PORTB &= ~(1<<PB7); //PB7 low
PORTB |= (_BV(7)); //Set high (input pullup)
//IP4787CZ32Y HDMI ESD interface chip (HDMI_ACT PIN) Active-High (Test-Point 12)
PORTF |= (_BV(PF1)); //Set high (input pullup)
//Toshiba Interrupt Pin
PORTE |= (_BV(PE6)); //Set high (input pullup)
//Toshiba Standby Pin
PORTF |= (_BV(PF4)); //Set high (input pullup)
//Toshiba Reset Pin - Active Low
PORTC |= (_BV(PC7)); //Set high (input pullup)
//LCD-CABC
//PORTF |= (_BV(PF7)); //Set high (defaults to input pullup)
//DDRF &= ~(_BV(PF7)); //Set output
//PORTF |= (_BV(PF7)); //Set low
//LED-PWM
PORTD |= (_BV(PD6)); //Set high (defaults to input pullup)
//PORTD &= ~(_BV(PD6)); //Set low
//DDRD &= ~(_BV(PD6)); //Set output
RingBuffer_InitBuffer(&FromHost_Buffer, FromHost_Buffer_Data, sizeof(FromHost_Buffer_Data));
init_screen(0x1F); //magic number!
mxt_list_types();
for (;;)
{
HandleSerial();
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
HID_Device_USBTask(&Digitizer_HID_Interface);
USB_USBTask();
HandleDigitizer();
}
}
开发者ID:ultimachine,项目名称:Drude-Firmware,代码行数:63,代码来源:VirtualSerialDigitizer.c
示例5: main
/** Main program entry point. This routine configures the hardware required by the application, then
* enters a loop to run the application tasks in sequence.
*/
int main(void)
{
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
for (;;)
{
USB_USBTask();
uint8_t ReceivedData[VENDOR_IO_EPSIZE];
memset(ReceivedData, 0x00, sizeof(ReceivedData));
Endpoint_SelectEndpoint(VENDOR_OUT_EPADDR);
if (Endpoint_IsOUTReceived())
{
Endpoint_Read_Stream_LE(ReceivedData, VENDOR_IO_EPSIZE, NULL);
Endpoint_ClearOUT();
Endpoint_SelectEndpoint(VENDOR_IN_EPADDR);
Endpoint_Write_Stream_LE(ReceivedData, VENDOR_IO_EPSIZE, NULL);
Endpoint_ClearIN();
}
}
}
开发者ID:40000ft,项目名称:lufa,代码行数:29,代码来源:BulkVendor.c
示例6: main
/** Main program entry point. This routine configures the hardware required by the application, then
* enters a loop to run the application tasks in sequence.
*/
int main(void)
{
SetupHardware();
puts_P(PSTR(ESC_FG_CYAN "Mouse Host/Device Demo running.\r\n" ESC_FG_WHITE));
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
for (;;)
{
/* Determine which USB mode we are currently in */
if (USB_CurrentMode == USB_MODE_Host)
{
MouseHost_Task();
HID_Host_USBTask(&Mouse_HID_Host_Interface);
}
else
{
HID_Device_USBTask(&Mouse_HID_Device_Interface);
}
USB_USBTask();
}
}
开发者ID:DuinoPilot,项目名称:lufa,代码行数:28,代码来源:MouseHostDevice.c
示例7: main
/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
* runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start
* the loaded application code.
*/
int main(void)
{
/* Setup hardware required for the bootloader */
SetupHardware();
/* Turn on first LED on the board to indicate that the bootloader has started */
LEDs_SetAllLEDs(LEDS_LED1);
/* Enable global interrupts so that the USB stack can function */
GlobalInterruptEnable();
while (RunBootloader)
{
CDC_Task();
USB_USBTask();
}
/* Wait a short time to end all USB transactions and then disconnect */
_delay_us(1000);
/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();
/* Unlock the forced application start mode of the bootloader if it is restarted */
MagicBootKey = MAGIC_BOOT_KEY;
/* Enable the watchdog and force a timeout to reset the AVR */
wdt_enable(WDTO_250MS);
for (;;);
}
开发者ID:40000ft,项目名称:lufa,代码行数:35,代码来源:BootloaderCDC.c
示例8: main
/** Main program entry point. This routine configures the hardware required by the application, then
* enters a loop to run the application tasks in sequence.
*/
int main(void)
{
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
while (RunBootloader || TicksSinceLastCommand++ < 0xFF)
{
MS_Device_USBTask(&Disk_MS_Interface);
USB_USBTask();
}
/* Wait a short time to end all USB transactions and then disconnect */
_delay_us(1000);
/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();
/* Unlock the forced application start mode of the bootloader if it is restarted */
MagicBootKey = MAGIC_BOOT_KEY;
/* Enable the watchdog and force a timeout to reset the AVR */
wdt_enable(WDTO_250MS);
for (;;);
}
开发者ID:abcminiuser,项目名称:lufa,代码行数:30,代码来源:BootloaderMassStorage.c
示例9: main
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
SetupHardware();
RingBuffer_InitBuffer(&USBtoUSART_Buffer, USBtoUSART_Buffer_Data, sizeof(USBtoUSART_Buffer_Data));
RingBuffer_InitBuffer(&USARTtoUSB_Buffer, USARTtoUSB_Buffer_Data, sizeof(USARTtoUSB_Buffer_Data));
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
for (;;)
{
/* Only try to read in bytes from the CDC interface if the transmit buffer is not full */
if (!(RingBuffer_IsFull(&USBtoUSART_Buffer)))
{
int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
/* Read bytes from the USB OUT endpoint into the USART transmit buffer */
if (!(ReceivedByte < 0))
RingBuffer_Insert(&USBtoUSART_Buffer, ReceivedByte);
}
/* Check if the UART receive buffer flush timer has expired or the buffer is nearly full */
uint16_t BufferCount = RingBuffer_GetCount(&USARTtoUSB_Buffer);
if (BufferCount)
{
Endpoint_SelectEndpoint(VirtualSerial_CDC_Interface.Config.DataINEndpoint.Address);
/* Check if a packet is already enqueued to the host - if so, we shouldn't try to send more data
* until it completes as there is a chance nothing is listening and a lengthy timeout could occur */
if (Endpoint_IsINReady())
{
/* Never send more than one bank size less one byte to the host at a time, so that we don't block
* while a Zero Length Packet (ZLP) to terminate the transfer is sent if the host isn't listening */
uint8_t BytesToSend = MIN(BufferCount, (CDC_TXRX_EPSIZE - 1));
/* Read bytes from the USART receive buffer into the USB IN endpoint */
while (BytesToSend--)
{
/* Try to send the next byte of data to the host, abort if there is an error without dequeuing */
if (CDC_Device_SendByte(&VirtualSerial_CDC_Interface,
RingBuffer_Peek(&USARTtoUSB_Buffer)) != ENDPOINT_READYWAIT_NoError)
{
break;
}
/* Dequeue the already sent byte from the buffer now we have confirmed that no transmission error occurred */
RingBuffer_Remove(&USARTtoUSB_Buffer);
}
}
}
/* Load the next byte from the USART transmit buffer into the USART */
if (!(RingBuffer_IsEmpty(&USBtoUSART_Buffer)))
Serial_SendByte(RingBuffer_Remove(&USBtoUSART_Buffer));
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
}
}
开发者ID:aureq,项目名称:TimelapsePlus-Firmware,代码行数:63,代码来源:USBtoSerial.c
示例10: SetupHardware
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
/* Disable watchdog */
MCUSR = 0;
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
serial_init();
GlobalInterruptEnable();
//LED_CONFIG;
/* Hardware Initialization */
LEDs_Init();
PIN_CONFIG(4);
PIN_CONFIG(5);
PIN_CONFIG(6);
PIN_CONFIG(7);
while(!started);
USB_Init();
}
开发者ID:RalphFox,项目名称:GIMX-firmwares,代码行数:28,代码来源:emu.c
示例11: main
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
SetupHardware();
/* Create a regular character stream for the interface so that it can be used with the stdio.h functions */
CDC_Device_CreateStream(&VirtualSerial_CDC_Interface, &USBSerialStream);
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
_setBrightness(50);
for (;;)
{
/* Must throw away unused bytes from the host, or it will lock up while waiting for the device */
CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
DS1302_clock_burst_read((uint8_t *) &rtc);
_setDigit( rtc.Seconds % 10 );
_setBrightness( 50 );
_delay_ms(4);
}
}
开发者ID:koolatron,项目名称:herbert,代码行数:30,代码来源:main.c
示例12: main
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
SetupHardware();
/* Create a regular blocking character stream for the interface so that it can be used with the stdio.h functions */
CDC_Device_CreateBlockingStream(&VirtualSerial_CDC_Interface, &USBSerialStream);
GlobalInterruptEnable();
for (;;)
{
/* Read in next LED colour command from the host */
uint8_t ColourUpdate = fgetc(&USBSerialStream);
/* Top 3 bits select the LED, bottom 5 control the brightness */
uint8_t Channel = (ColourUpdate & 0b11100000);
uint8_t Duty = (ColourUpdate & 0b00011111);
if (Channel & (1 << 5))
SoftPWM_Channel1_Duty = Duty;
if (Channel & (1 << 6))
SoftPWM_Channel2_Duty = Duty;
if (Channel & (1 << 7))
SoftPWM_Channel3_Duty = Duty;
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
}
}
开发者ID:chicagoedt,项目名称:Firmware,代码行数:34,代码来源:LEDNotifier.c
示例13: main
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
SetupHardware();
TCP_Init();
Webserver_Init();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
for (;;)
{
if (RNDIS_Device_IsPacketReceived(&Ethernet_RNDIS_Interface))
{
LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
RNDIS_Device_ReadPacket(&Ethernet_RNDIS_Interface, &FrameIN.FrameData, &FrameIN.FrameLength);
Ethernet_ProcessPacket(&FrameIN, &FrameOUT);
if (FrameOUT.FrameLength)
{
RNDIS_Device_SendPacket(&Ethernet_RNDIS_Interface, &FrameOUT.FrameData, FrameOUT.FrameLength);
FrameOUT.FrameLength = 0;
}
LEDs_SetAllLEDs(LEDMASK_USB_READY);
}
TCP_TCPTask(&Ethernet_RNDIS_Interface, &FrameOUT);
RNDIS_Device_USBTask(&Ethernet_RNDIS_Interface);
USB_USBTask();
}
}
开发者ID:BirdBrainTechnologies,项目名称:HummingbirdDuoFirmware,代码行数:37,代码来源:RNDISEthernet.c
示例14: main
int main(void)
{
SetupHardware();
/* Create a regular character stream for the interface so that it can be used with the stdio.h functions */
CDC_Device_CreateStream(&VirtualSerial_CDC_Interface, &USBSerialStream);
GlobalInterruptEnable();
while(1)
{
DebounceUpdate();
EncoderUpdate();
LedUpdate();
SendSerial();
/* Must throw away unused bytes from the host, or it will lock up while waiting for the device */
CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
HID_Device_USBTask(&Mouse_HID_Interface);
HID_Device_USBTask(&Keyboard_HID_Interface);
USB_USBTask();
}
}
开发者ID:Hylian,项目名称:sdvx,代码行数:27,代码来源:note.c
示例15: main
/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
* runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start
* the loaded application code.
*/
int main(void)
{
/* David Cox
* In my application is needs internal pullups activated on special pins on these ports as soon as possible.
*/
PORTB = 0xFF;
PORTC = 0xFF;
PORTF = 0xFF;
/* Setup hardware required for the bootloader */
SetupHardware();
/* Turn on first LED on the board to indicate that the bootloader has started */
LEDs_SetAllLEDs(LEDS_LED1);
/* Enable global interrupts so that the USB stack can function */
GlobalInterruptEnable();
while (RunBootloader)
{
CDC_Task();
USB_USBTask();
}
/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();
/* Unlock the forced application start mode of the bootloader if it is restarted */
MagicBootKey = MAGIC_BOOT_KEY;
/* Enable the watchdog and force a timeout to reset the AVR */
wdt_enable(WDTO_250MS);
for (;;);
}
开发者ID:SpiRaiL,项目名称:lufa,代码行数:39,代码来源:BootloaderCDC.c
示例16: main
/** Main program entry point. This routine configures the hardware required by the application, then
* enters a loop to run the application tasks in sequence.
*/
int main(void)
{
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
while (RunBootloader || TicksSinceLastCommand++ < 0xFF)
{
MS_Device_USBTask(&Disk_MS_Interface);
USB_USBTask();
}
/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();
/* Unlock the forced application start mode of the bootloader if it is restarted */
MagicBootKey = MAGIC_BOOT_KEY;
/* blink bootloader led couple of times */
for (int i=0; i<2; i++) {
PORTE &= 0b10111111; //led low
_delay_ms(250);
PORTE |= 0b01000000; //led high
_delay_ms(250);
} PORTE &= 0b10111111; //led low
/* Enable the watchdog and force a timeout to reset the AVR */
wdt_enable(WDTO_250MS);
for (;;);
}
开发者ID:friglob,项目名称:OpenDeck,代码行数:37,代码来源:BootloaderMassStorage.c
示例17: SetupHardware
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* enable clock division, run on 16MHz */
clock_prescale_set(clock_div_1);
/* enable Interrupts */
GlobalInterruptEnable();
/* disable JTAG since we use the pins for I/O, e.g. the STBY pin */
JTAG_DISABLE();
/* pull STBY low, so enough power can be provided */
DDRF |= (PWR_STBY);
PORTF &= ~(PWR_STBY);
/* reset sensors */
DDRC |= PWR_SENSORS;
PORTC &= ~(PWR_SENSORS);
/* enable pushbutton */
DDRB |= ~(PWR_BUTTON);
/* set default uart configuration */
Serial_Config(1000000, 8, CDC_LINEENCODING_OneStopBit, CDC_PARITY_None);
/* get off the spi-bus */
DDRB &= ~JEN_SPIMISO;
DDRB &= ~JEN_SPIMOSI;
DDRB &= ~JEN_CLOCK;
DDRE &= ~JEN_SPISS;
}
开发者ID:pscholl,项目名称:Arduino,代码行数:36,代码来源:DualVirtualSerial.c
示例18: clock_init
//Initialize the clock
void clock_init(void)
{
GlobalInterruptDisable();
INTC_RegisterGroupHandler(INTC_IRQ_GROUP(AVR32_TC_IRQ0), AVR32_INTC_INT0, tc_irq);
GlobalInterruptEnable();
// Initialize the timer/counter.
tc_init_waveform(tc, &WAVEFORM_OPT); // Initialize the timer/counter waveform.
// Set the compare triggers.
// Remember TC counter is 16-bits, so counting second is not possible with fPBA = 12 MHz.
// We configure it to count ms.
// We want: (1/(fPBA/8)) * RC = 0.001 s, hence RC = (fPBA/8) / 1000 = 1500 to get an interrupt every 1 ms.
tc_write_rc(tc, TC_CHANNEL, (F_PBA_SPEED / 8) / 1000); // Set RC value.
//tc_write_ra(tc, TC_CHANNEL, 0); // Set RA value.
//tc_write_rb(tc, TC_CHANNEL, 1900); // Set RB value.
//gpio_enable_module_pin(AVR32_TC_A0_0_1_PIN, AVR32_TC_A0_0_1_FUNCTION);
//gpio_enable_module_pin(AVR32_TC_B0_0_1_PIN, AVR32_TC_B0_0_1_FUNCTION);
tc_configure_interrupts(tc, TC_CHANNEL, &TC_INTERRUPT);
// Start the timer/counter.
tc_start(tc, TC_CHANNEL); // And start the timer/counter.
}
开发者ID:satrian,项目名称:sdr-mk15,代码行数:27,代码来源:clock-arch.c
示例19: RTC_SetTimeDate
bool RTC_SetTimeDate(const TimeDate_t* NewTimeDate)
{
GlobalInterruptDisable();
DummyRTC_Count = *NewTimeDate;
GlobalInterruptEnable();
return true;
}
开发者ID:0xdec,项目名称:tmk_keyboard,代码行数:8,代码来源:RTC.c
示例20: RTC_GetTimeDate
bool RTC_GetTimeDate(TimeDate_t* const TimeDate)
{
GlobalInterruptDisable();
*TimeDate = DummyRTC_Count;
GlobalInterruptEnable();
return true;
}
开发者ID:0xdec,项目名称:tmk_keyboard,代码行数:8,代码来源:RTC.c
注:本文中的GlobalInterruptEnable函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论