您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GlobalInterruptEnable函数代码示例

51自学网 2021-06-01 21:18:51
  C++
这篇教程C++ GlobalInterruptEnable函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例18: clock_init

//Initialize the clockvoid 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,


示例19: RTC_SetTimeDate

bool RTC_SetTimeDate(const TimeDate_t* NewTimeDate){	GlobalInterruptDisable();	DummyRTC_Count = *NewTimeDate;	GlobalInterruptEnable();	return true;}
开发者ID:0xdec,项目名称:tmk_keyboard,代码行数:8,


示例20: RTC_GetTimeDate

bool RTC_GetTimeDate(TimeDate_t* const TimeDate){	GlobalInterruptDisable();	*TimeDate = DummyRTC_Count;	GlobalInterruptEnable();	return true;}
开发者ID:0xdec,项目名称:tmk_keyboard,代码行数:8,


示例21: 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();	GlobalInterruptEnable();	uint8_t sending = 0;	for (;;) {		while (1) {                	int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);			if (ReceivedByte < 0) 				break;			if (!configured) continue;			if (!sending) {				PORTC.OUTSET = PIN1_bm;				sending = 1;			}			PORTD.OUTTGL = PIN5_bm;                	while(!USART_IsTXDataRegisterEmpty(&USART));                	USART_PutChar(&USART, ReceivedByte & 0xff);		}		if (sending) {			USART_ClearTXComplete(&USART);               		while(!USART_IsTXComplete(&USART));			PORTC.OUTCLR = PIN1_bm;			sending = 0;			}                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 (configured && Endpoint_IsINReady()) {			uint8_t maxbytes = CDC_TXRX_EPSIZE;                	while (USART_RXBufferData_Available(&USART_data) && maxbytes-->0) {                        	uint8_t b = USART_RXBuffer_GetByte(&USART_data);				CDC_Device_SendByte(&VirtualSerial_CDC_Interface, b);				PORTD.OUTTGL = PIN5_bm;                	}                }		CDC_Device_USBTask(&VirtualSerial_CDC_Interface);		USB_USBTask();		if (loop++) continue;		if (!configured) continue;		PORTD.OUTTGL = PIN5_bm;	}}
开发者ID:drthth,项目名称:busware,代码行数:60,


示例22: 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();    GlobalInterruptEnable();    for (;;)        USB_USBTask();}
开发者ID:agprimatic,项目名称:lufa,代码行数:12,


示例23: main

int main(void){	SetupHardware();	// LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	GlobalInterruptEnable();	// uint8_t BUT_current = PIND & (1 << PD1);; // текущее значение кнопки	// uint8_t BUT_previous = BUT_current; // предыдущее значение кнопки	//uint8_t BUT_message=0; // 0 - ничего не отправлять, 1 - отправить vel 0, 2 - отправить vel 127	//uint8_t LED_current = 0; // текущее значение светодиода	int ADC_current[16]; // текущие значения АЦП	int ADC_previous[16]; // предыдущие значения АЦП	uint8_t ADC_deviation = 20; // порог фиксации изменения АЦП, давить шум	for (uint8_t i=0; i<16; i++) { ADC_current[i] = raw_ADC(); ADC_previous[i] = ADC_current[i];} // инициализация	for (;;)	{				// дроп входящих		MIDI_EventPacket_t ReceivedMIDIEvent; 		while (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent));				// опрос 16 входов мультиплексора		for (int MUX_pos = 0; MUX_pos < 3; MUX_pos++ ){				MUX_address(MUX_pos); // установить адрес				// _delay_ms(1);								// MUX_enable();				// _delay_ms(1);				ADC_current[MUX_pos] = raw_ADC(); // АЦП				// MUX_disable();								if ( abs(ADC_current[MUX_pos] - ADC_previous[MUX_pos]) >= ADC_deviation ) // если изменения больше порога, отправить сообщение CC				{					cc_send(MUX_pos, ADC_current[MUX_pos] / 8);					ADC_previous[MUX_pos] = ADC_current[MUX_pos];				}				_delay_ms(10);				MIDI_Device_USBTask(&Keyboard_MIDI_Interface);				USB_USBTask();		}		// MIDI_Device_USBTask(&Keyboard_MIDI_Interface);		// USB_USBTask();	}}
开发者ID:eta4ever,项目名称:led-kb,代码行数:56,


示例24: 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(&FromHost_Buffer, FromHost_Buffer_Data, sizeof(FromHost_Buffer_Data));	GlobalInterruptEnable();	for (;;)	{		/* Only try to read in bytes from the CDC interface if the transmit buffer is not full */		if (!(RingBuffer_IsFull(&FromHost_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(&FromHost_Buffer, ReceivedByte);		}		while (RingBuffer_GetCount(&FromHost_Buffer) > 0)		{			static uint8_t EscapePending = 0;			int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer);			if (HD44780Byte == COMMAND_ESCAPE)			{				if (EscapePending)				{					HD44780_WriteData(HD44780Byte);					EscapePending = 0;				}				else				{					/* Next received character is the command byte */					EscapePending = 1;				}			}			else			{				if (EscapePending)				{					HD44780_WriteCommand(HD44780Byte);					EscapePending = 0;				}				else				{					HD44780_WriteData(HD44780Byte);				}			}		}		CDC_Device_USBTask(&VirtualSerial_CDC_Interface);		USB_USBTask();	}}
开发者ID:agprimatic,项目名称:lufa,代码行数:59,


示例25: serial_init

/******************************************************************************* Nombre de la funcion	: void serial_init(void)*    returns            : void* Creada por		: Alejandro Weinstein* Fecha Creacion	: 2013-04-08** Descripcion : Inicializa el purto serial virtual USB******************************************************************************/void serial_init(void){  SetupHardware();  RingBuffer_InitBuffer(&USBtoUSART_Buffer, USBtoUSART_Buffer_Data, 			sizeof(USBtoUSART_Buffer_Data));    LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);  GlobalInterruptEnable();}
开发者ID:Sieg777,项目名称:ibm_se,代码行数:18,


示例26: main

int main(void) {  SetupHardware();    GlobalInterruptEnable();    for (;;) {    HID_Device_USBTask(&Joystick_HID_Interface);    USB_USBTask();  }}
开发者ID:letoine,项目名称:NeoGeoControllerToUSB,代码行数:10,


示例27: clock_time

//Return timeuint32_t clock_time(void){uint32_t time;	GlobalInterruptDisable();	time = clock_datetime;	GlobalInterruptEnable();	return time;}
开发者ID:satrian,项目名称:sdr-mk15,代码行数:11,


示例28: 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){  GlobalInterruptEnable();  initialize_hardware();  while (true) {    matrix_scan();    HID_Device_USBTask(&Keyboard_HID_Interface);    USB_USBTask();  }}
开发者ID:mxkl,项目名称:gh60,代码行数:15,


示例29: 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();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	GlobalInterruptEnable();	for (;;)	{		HID_Device_USBTask(&Device_HID_Interface);		USB_USBTask();	}}
开发者ID:BirdBrainTechnologies,项目名称:HummingbirdDuoFirmware,代码行数:16,


示例30: 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();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	GlobalInterruptEnable();	for (;;)	{		CDC_Task();		USB_USBTask();	}}
开发者ID:Steffen-Engel,项目名称:lufa,代码行数:16,



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


C++ GlobalLock函数代码示例
C++ GlobalFreePtr函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。