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

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

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

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

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

示例1: main

int main(void) {	wdt_enable(WDTO_1S);  initPodControls();	/* Even if you don't use the watchdog, turn it off here. On newer devices,	 * the status of the watchdog (on/off, period) is PRESERVED OVER RESET!	 */	/* RESET status: all port bits are inputs without pull-up.	 * That's the way we need D+ and D-. Therefore we don't need any	 * additional hardware initialization.	 */	usbInit();	usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */	uchar i = 0;	while(--i){             /* fake USB disconnect for > 250 ms */			wdt_reset();			_delay_ms(1);	}	usbDeviceConnect();	sei();	for(;;){                /* main event loop */			wdt_reset();			usbPoll();			if(usbInterruptIsReady()){				/* called after every poll of the interrupt endpoint */				usbSetInterrupt((void *)&reportBuffer, sizeof(reportBuffer));			} else {				updateSensorData();        updateLEDState();      }	}}
开发者ID:eldstal,项目名称:avr-pod,代码行数:33,


示例2: main

int main(void){    extern uchar usbNewDeviceAddr;    uint8_t i;//Reconnect USB    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */    i = 0;    while(--i)        _delay_ms(2);    usbDeviceConnect();    usbInit();    sei();    leds[LED_RED].frequency = LED_ON;    LED_init();    for (i=0; i<3; i++)        TIMER_delay(250);    leds[LED_RED].frequency = LED_OFF;    leds[LED_GREEN].frequency = 1;    while(1)    {        if (TIMER_timeout == 0)        {            if(usbNewDeviceAddr)                leds[LED_BLUE].frequency = LED_ON;            PORTD ^= (1<<PD7);            TIMER_start(1);            usbPoll();            LED_poll();        }    }}
开发者ID:alexbrickwedde,项目名称:floodping,代码行数:34,


示例3: main

int main(void){    led_init();        sht1x_init();    //sser_init();        wdt_enable(WDTO_1S);        /* Even if you don't use the watchdog, turn it off here. On newer devices,     * the status of the watchdog (on/off, period) is PRESERVED OVER RESET!     */    /* RESET status: all port bits are inputs without pull-up.     * That's the way we need D+ and D-. Therefore we don't need any     * additional hardware initialization.     */    odDebugInit();    DBG1(0x00, 0, 0);       /* debug output: main starts */    usbInit();    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */    unsigned char i = 0;    while(--i){             /* fake USB disconnect for > 250 ms */        wdt_reset();        _delay_ms(1);    }    usbDeviceConnect();    sei();    DBG1(0x01, 0, 0);       /* debug output: main loop starts */            for(;;){        wdt_reset();        usbPoll();    }    return 0;   /* never reached */}
开发者ID:baracudaz,项目名称:usb-sht,代码行数:32,


示例4: main

int main(){	fabscan_setup();	uchar i;//    wdt_enable(WDTO_1S); // enable 1s watchdog timer    usbInit();    usbDeviceDisconnect(); // enforce re-enumeration    for(i = 0; i<250; i++) { // wait 500 ms//        wdt_reset(); // keep the watchdog happy        _delay_ms(2);    }    usbDeviceConnect();    sei(); // Enable interrupts after re-enumeration    while(1)    {//    		wdt_reset(); // keep the watchdog happy    		usbPoll();    		if(fab_work_flag)	// if there is new data for fabscan → let it work    		{    			fab_work_flag=0;    			fabscan_work(1,incomingByte);    		}    }    return 0;}
开发者ID:pholat,项目名称:FabScan_USB_brd,代码行数:27,


示例5: __attribute__

void __attribute__((noreturn)) main( void ){    cli();    initLeds();    wdt_enable( WDTO_1S );    // USB initialization.    usbInit();    usbDeviceDisconnect();  // enforce re-enumeration, do this while interrupts are disabled!    unsigned char b = 150;    while ( b-- )    {        _delay_ms( 1 );        wdt_reset();    }    cpuIoInit();    usbDeviceConnect();    sei();    for ( ;; )    {        // main event loop        usbPoll();        wdt_reset();        cpuIoPoll();        //_delay_ms( 10 );    }}
开发者ID:z80,项目名称:avrusb,代码行数:30,


示例6: main

int main() {	initLCD();	LCD_goto(1,0);	lcd_puts("AVRLCD 4bit mode");        uchar i;		  DDRB = 1; // PB0 as output    wdt_enable(WDTO_1S); // enable 1s watchdog timer    usbInit();            usbDeviceDisconnect(); // enforce re-enumeration    for(i = 0; i<250; i++) { // wait 500 ms        wdt_reset(); // keep the watchdog happy        _delay_ms(2);    }    usbDeviceConnect();            sei(); // Enable interrupts after re-enumeration            while(1) {        wdt_reset(); // keep the watchdog happy        usbPoll();    }            return 0;}
开发者ID:manoja328,项目名称:myavr,代码行数:26,


示例7: vusb_init

void vusb_init(void){	// inits the timer used for idle rate    // a rate of 12M/(1024 * 256) = 45.78 Hz (period = 21845us)	TCCR0B = _BV(CS02) | _BV(CS00);#define TMR1US	21845L	// a rate of 12M/(64 * 256) = 732,42 Hz (1365us)//	TCCR0B = _BV(CS01) | _BV(CS00);//#define TMR1US	1365L#define OVF2MS(tmr)		((uint16_t)(( (tmr) * TMR1US) / 1000))#define OVF2US(tmr)		((uint16_t)( (tmr) * TMR1US))	usbInit();	usbDeviceDisconnect();	// enforce re-enumeration, do this while interrupts are disabled!	_delay_ms(260);			// fake USB disconnect for > 250 ms	usbDeviceConnect();	vusb_idle_rate = 0;	vusb_curr_protocol = 1;	// report protocol		// clear the reports	usb_consumer_report = 0;	reset_keyboard_report();}
开发者ID:jthen,项目名称:7g-wireless,代码行数:27,


示例8: main

int main( void ){	//===========================================	uchar   calibrationValue;    calibrationValue = eeprom_read_byte(0); /* calibration value from last time */    if(calibrationValue != 0xff){        OSCCAL = calibrationValue;    }	//===========================================	usbInit();    wdt_enable(WDTO_1S);    /* Даже если Вы не используете сторожевой таймер (watchdog), выключите его здесь. На более новых     *  микроконтроллерах состояние watchdog (вкл/выкл, период) СОХРАНЯЕТСЯ ЧЕРЕЗ СБРОС!     */	//===========================================    usbDeviceDisconnect();    _delay_ms(300);			/* 300 ms disconnect */    usbDeviceConnect();	//===========================================    //LED_PORT_DDR |= _BV(LED_BIT);		/* делаем ножку, куда подключен LED, выходом */	sbi(LED_PORT_DDR,LED_BIT);			/* делаем ножку, куда подключен LED, выходом */	//===========================================	sei();		/* Разрешаем прерывания*/    for(;;){    /* main event loop */        wdt_reset();        usbPoll();	}	//===========================================}
开发者ID:aBaTaPbl4,项目名称:BuildOrb2,代码行数:29,


示例9: main

int main(){	uchar	i=0;    wdt_enable(WDTO_1S);        usbInit();    	usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */        for (i=0; i<250; i++)    {         /* fake USB disconnect for > 500 ms */        wdt_reset();        _delay_ms(2);    }    usbDeviceConnect();    //LED_PORT_DDR |= _BV(LED_BIT);   /* make the LED bit an output */    sei();    //DBG1(0x01, 0, 0);       /* debug output: main loop starts */    while (1)    {        wdt_reset();        usbPoll();			}}
开发者ID:Ceitec,项目名称:F-00004,代码行数:26,


示例10: main

int main(void) {	uchar i, j;	/* no pullups on USB and ISP pins */	//PORTD = 0;	//PORTB = 0;	/* all outputs except PD2 = INT0 */	/// LB - different pins on STK500 board	//DDRD = ~(1 << 2);	// make JTAG pins inputs with pullups		SET_JTAG_PULLUPS();	/* output SE0 for USB reset */	/// LB - different pins on STK500 board	//DDRB = ~0;	j = 0;	/* USB Reset by device only required on Watchdog Reset */	while (--j) {		i = 0;		/* delay >10ms for USB reset */		while (--i)			;	}	/* all USB and ISP pins inputs */	//DDRB = 0;	/// LB - LED pins are different from usbasp to sp duo - conflict: SP duo uses these for JTAG	/* all inputs except PC0, PC1 */	//DDRC = 0x03;	//PORTC = 0xfe;	SET_LED_OUTPUT();	LED_OFF();	/* init timer */	clockInit();	#ifdef UART_DEBUG    // init debug uart    setupUART();    TransmitString("/r/n/n***/r/nstarting up/r/n");#endif		// USB Re-Enumeration	usbDeviceDisconnect();	while(--i){         // fake USB disconnect for > 250 ms	    wdt_reset();    // if watchdog is active, reset it	    _delay_ms(1);   // library call -- has limited range	}	usbDeviceConnect();	/* main event loop */	usbInit();	sei();	for (;;) {		usbPoll();	}	return 0;}
开发者ID:Duality4Y,项目名称:tinyJTAG,代码行数:60,


示例11: main

int main(){	uchar i;	DDRB |= 1; // PB0 as output	DDRB |= (1<<1); // PB1 as output    wdt_enable(WDTO_1S); // enable 1s watchdog timer    usbInit();            usbDeviceDisconnect(); // enforce re-enumeration    for(i = 0; i<250; i++) // wait 500 ms	{         wdt_reset(); // keep the watchdog happy        _delay_ms(2);    }    usbDeviceConnect();            sei(); // Enable interrupts after re-enumeration     	PORTB |= (1<<1); // PB1 on	     while(1)	{		        wdt_reset(); // keep the watchdog happy        usbPoll();    }            return 0;}
开发者ID:krzysztofwalach,项目名称:SomethingsWrong,代码行数:31,


示例12: main

int	main(void) {  extern uchar usbNewDeviceAddr;  uint8_t i;  PORTC |= (1<<PC2);//Reconnect USB  usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */  i = 0;  while(--i)     _delay_ms(2);  usbDeviceConnect();  usbInit();  sei();  leds[LED_RED].frequency = LED_ON;  LED_init();  for (i=0;i<3;i++)    TIMER_delay(250);  leds[LED_RED].frequency = LED_OFF;  LED_poll();//  wdt_enable(WDTO_60MS);  i2c_init();  for(;;)     {      if(usbNewDeviceAddr)	    {          leds[LED_BLUE].frequency = LED_ON;		}      wdt_reset();      LED_poll();      usbPoll();    }  return 0;}
开发者ID:Technus,项目名称:usbavrlab-tool,代码行数:35,


示例13: main

int main(void){uchar   i;    wdt_enable(WDTO_1S);    /* Even if you don't use the watchdog, turn it off here. On newer devices,     * the status of the watchdog (on/off, period) is PRESERVED OVER RESET!     */    DBG1(0x00, 0, 0);       /* debug output: main starts */    /* RESET status: all port bits are inputs without pull-up.     * That's the way we need D+ and D-. Therefore we don't need any     * additional hardware initialization.     */    odDebugInit();    usbInit();    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */    i = 0;    while(--i){             /* fake USB disconnect for > 250 ms */        wdt_reset();        _delay_ms(1);    }    usbDeviceConnect();    LED_PORT_DDR |= _BV(LED_BIT);   /* make the LED bit an output */    sei();    DBG1(0x01, 0, 0);       /* debug output: main loop starts */    for(;;){                /* main event loop */        DBG1(0x02, 0, 0);   /* debug output: main loop iterates */        wdt_reset();        usbPoll();    }    return 0;}
开发者ID:elcerdo,项目名称:avr,代码行数:32,


示例14: main

int main() {    uchar i;    DDRB = 1; // LED is on PB0    // set up a 1 second watchdog timer that resets the microcontroller    // if 1000 milliseconds pass without a call to wdt_reset()    wdt_enable(WDTO_1S);    // init v-usb    usbInit();    usbDeviceDisconnect(); // enforce re-enumeration    for(i = 0; i < 250; i++) { // wait 500 ms        wdt_reset(); // keep the watchdog happy        _delay_ms(2);    }    usbDeviceConnect();    sei(); // Enable interrupts after re-enumeration    while(1) {        wdt_reset(); // keep the watchdog happy        usbPoll();    }    return 0;}
开发者ID:2m,项目名称:avr-projects,代码行数:28,


示例15: hardwareInit

static void hardwareInit(void){    /* activate pull-ups except on USB lines */    USB_CFG_IOPORT   = (uchar)~((1<<USB_CFG_DMINUS_BIT)|(1<<USB_CFG_DPLUS_BIT));    /* all pins input except USB (-> USB reset) */#ifdef USB_CFG_PULLUP_IOPORT    /* use usbDeviceConnect()/usbDeviceDisconnect() if available */    USBDDR    = 0;    /* we do RESET by deactivating pullup */    usbDeviceDisconnect();#else    USBDDR    = (1<<USB_CFG_DMINUS_BIT)|(1<<USB_CFG_DPLUS_BIT);#endif    /* 250 ms disconnect */    wdt_reset();    _delay_ms(250);#ifdef USB_CFG_PULLUP_IOPORT    usbDeviceConnect();#else    USBDDR    = 0;      /*  remove USB reset condition */#endif    /*    USART configuration    */    baud.dword  = UART_DEFAULT_BPS;    stopbit = 0;    parity  = 0;    databit = 8;    resetUart();}
开发者ID:AkashGutha,项目名称:avr,代码行数:30,


示例16: main

//Main routineint main(void) {    int d;    uint16_t v;        // cli();    initio();    inittxt();    usbInit();    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */    uint8_t i = 0;    while(--i){             /* fake USB disconnect for > 250 ms */        _delay_ms(1);    }    usbDeviceConnect();        sei();    //Go display stuff    while(1) {	for (d=0; d<11; d++) {	    v=getcharat(d);	    setvfd(d,v);	    _delay_ms(1);	    handlepwm();	    usbPoll();	}	    }}
开发者ID:ceemos,项目名称:vfd-fv651g,代码行数:31,


示例17: main

/**************************************************************************************Function Name 		:	mainDescription			:	Initialize the USB and start the interruptParameters 			:	voidReturn 				:	int **************************************************************************************/int main(void){	uchar l_delayCount;    wdt_enable(WDTO_1S);    odDebugInit();    DBG1(0x00, 0, 0);       /* debug output: main starts */    usbInit();    usbDeviceDisconnect();  /* enforce re-enumeration,     						   do this while interrupts are disabled! */    l_delayCount = 0;    while(--l_delayCount)    {                 	/* fake USB disconnect for > 250 ms */        wdt_reset();        _delay_ms(1);    }    usbDeviceConnect();    sei();    DBG1(0x01, 0, 0);           for(;;)    {                        DBG1(0x02, 0, 0);   /*debug output: main loop iterates*/        wdt_reset();        usbPoll();    }    return 0;}
开发者ID:SripaulJeevendiran,项目名称:pam-password-vusb,代码行数:33,


示例18: main

int main(void){uchar   i;    wdt_enable(WDTO_1S);    /* Если не используется watchdog, отключите эту строчку. Для новых устройств        статус watchdog (on/off, period) СОХРАНЯЕТСЯ ПОСЛЕ СБРОСА!     */    /* Статус RESET: все ножки портов в режиме ввода без нагрузочных резисторов (pull-up).        Это то, что нужно для D+ and D-, таким образом, мы не нуждаемся в дополнительной аппаратной        инициализации.     */    usbInit();              // см. usbdrv.h и usbdrv.c    usbDeviceDisconnect();  /* см. usbdrv.h - запускает реэнумерацию, делаем это, пока отключены прерывания! */    i = 0;    while(--i)    {            /* подделывам USB disconnect на время > 250 ms */        wdt_reset();        _delay_ms(1);    }    usbDeviceConnect();     // см. usbdrv.h    LED_PORT_DDR |= _BV(LED_BIT);   /* переключаем ножку LED в режим вывода */    sei();    for(;;){                /* главный цикл события */        wdt_reset();        usbPoll();    }    return 0;}
开发者ID:aBaTaPbl4,项目名称:BuildOrb2,代码行数:29,


示例19: main

int main(void) {    wdt_enable(WDTO_1S);  // watchdog status is preserved on reset    hardwareInit();    usbInit();    usbDeviceDisconnect();    // fake USB disconnect for > 250 ms    for( uint8_t i=255; i>0; i-- ) {        wdt_reset();        _delay_ms(1);    }    usbDeviceConnect();    sei();    for(;;) {               // main event loop        wdt_reset();        usbPoll();    }    return 0;}
开发者ID:Lords08,项目名称:alanarduinotools,代码行数:25,


示例20: __attribute__

int __attribute__((noreturn)) main(void){uchar   i;    wdt_enable(WDTO_1S);    /* Even if you don't use the watchdog, turn it off here. On newer devices,     * the status of the watchdog (on/off, period) is PRESERVED OVER RESET!     */    /* RESET status: all port bits are inputs without pull-up.     * That's the way we need D+ and D-. Therefore we don't need any     * additional hardware initialization.     */    odDebugInit();    usbInit();    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */    i = 0;    while(--i){             /* fake USB disconnect for > 250 ms */        wdt_reset();        _delay_ms(1);    }    usbDeviceConnect();    sei();    DDRB |= _BV(PB0);    for(;;){                /* main event loop */        wdt_reset();        usbPoll();        if (eeprom_read_byte(10) == 1) {          PORTB |= _BV(PB0);        } else {          PORTB &= ~_BV(PB0);        }    }}
开发者ID:deanmao,项目名称:laptop_alarm,代码行数:33,


示例21: hardwareInit

static void hardwareInit(void){	uchar i;	uchar calibrationValue;	calibrationValue = eeprom_read_byte(0); /* calibration value from last time */	if (calibrationValue != 0xff)	{		OSCCAL = calibrationValue;	}	usbInit();	usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */	i = 0;	while(--i){             /* fake USB disconnect for > 250 ms */		wdt_reset();		_delay_ms(1);	}	usbDeviceConnect();	wdt_enable(WDTO_1S);	/* activate pull-ups for the buttons */	BUTTON_PORT |= _BV(BUTTON1_BIT) | _BV(BUTTON2_BIT);	/* initialize LED output */	LED_DDR |= _BV(LED_BIT);	LED_ON;	/* select clock: 16.5M/1k -> overflow rate = 16.5M/256k = 62.94 Hz (~11ms) */	TCCR1 = 0x0b;}
开发者ID:mmitch,项目名称:tasta,代码行数:32,


示例22: usb_init

voidusb_init(void){#ifdef USB_NET_SUPPORT  usb_net_init();#endif#define USB_DDR_CONFIG(pin)  DDR_CHAR( pin ## _PORT) &= ~(_BV((pin ## _PIN)) | _BV(USB_INT_PIN))#define USB_PORT_CONFIG(pin)  PORT_CHAR( pin ## _PORT) &= ~(_BV((pin ## _PIN)) | _BV(USB_INT_PIN))  USB_DDR_CONFIG(USB_DMINUS);  USB_PORT_CONFIG(USB_DMINUS);#undef USB_DDR_CONFIG#undef USB_PORT_CONFIG  uint8_t i;  /* Reenummerate the device */  usbDeviceDisconnect();  for(i = 0; i < 20; i++){  /* 300 ms disconnect */    _delay_ms(15);    wdt_kick();  }  usbDeviceConnect();  /* USB Initialize */  usbInit();}
开发者ID:Leerzeichen,项目名称:ethersex,代码行数:26,


示例23: main

int main(void){    uchar   i;    wdt_enable(WDTO_1S);    /* If you don't use the watchdog, replace the call above with a wdt_disable().     * On newer devices, the status of the watchdog (on/off, period) is PRESERVED     * OVER RESET!     */    /* RESET status: all port bits are inputs without pull-up.     * That's the way we need D+ and D-. Therefore we don't need any     * additional hardware initialization.     */    odDebugInit();    DBG1(0x00, 0, 0);       /* debug output: main starts */    usbInit();    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */    i = 0;    while(--i){             /* fake USB disconnect for > 250 ms */        wdt_reset();        _delay_ms(1);    }    usbDeviceConnect();    sei();    ledmatrix7219d88_init();    DBG1(0x01, 0, 0);       /* debug output: main loop starts */    for(;;){                /* main event loop */        DBG1(0x02, 0, 0);   /* debug output: main loop iterates */        wdt_reset();        usbPoll();	ledmatrix7219d88_setmatrix(0, rows);    }    return 0;}
开发者ID:purcaro,项目名称:panda-display,代码行数:35,


示例24: main

int main(void){    uchar i;    wdt_enable(WDTO_1S);    wdt_disable();    usbInit();    usbDeviceDisconnect();    i = 0;    while(--i){        wdt_reset();        _delay_ms(1);    }	    _delay_ms(250);    usbDeviceConnect();    sei();    for(;;){        //wdt_reset();        usbPoll();    }    return 0;}
开发者ID:imsplitbit,项目名称:avr_work,代码行数:28,


示例25: main

int main(void){    wdt_reset();    wdt_enable(WDTO_120MS);    usbInit();    usbDeviceDisconnect();    uint8_t t;    for (t=255; t; t--) {        _delay_ms(1);        wdt_reset();    }    usbDeviceConnect();    sei();    gpib_init();    for (;;) {        usbPoll();        wdt_reset();    }}
开发者ID:themadinventor,项目名称:ful488,代码行数:25,


示例26: configure

voidconfigure (void){  /* usb stuff. make the host re-enumerate our device */  cli ();  usbDeviceDisconnect ();  /* configure timer 2 for calling usbPoll() */  TIMSK2 = _BV (TOIE2);         /* overflow interrupt enabled */  TCCR2B = _BV (CS02) | _BV (CS01) | _BV (CS00);        /* set prescaler to 1024, timer starts */  /* end of usb stuff  */  /* display configuration */  d_status = &display[0];  display[LCD_DISP_LENGTH] = '/0';  d_content = &display[LCD_DISP_LENGTH + 1];  display[LCD_DISP_LENGTH * 2 + 1] = '/0';  lcd_init (LCD_DISP_ON);  /* end display configuration */  /* temperature sensors */  t_sensors_count = search_sensors ();  if (t_sensors_count)    {      have_ts = 1;      d_status_update ("Found %d DS18B20", t_sensors_count);      d_update ();    }  /* end if temperature sensors setup */  /* twi/accelerometer configuration */  i2c_init ();  /* don't hurry! */  _delay_ms (1000);  if (!lis_initialize (0, 1, 0, 1))    {      have_ac = 1;      d_content_update ("Found LIS302DL");      d_update ();    }  /* end of accelerometer configuration */  _delay_ms (1500);  /* configure timer 0 for button state detection */  TIMSK0 = _BV (TOIE0);         /* enable overflow interrupt */  TCCR0B = _BV (CS02) | _BV (CS00);     /* set prescaler to 1024, timer starts */  PORTD |= _BV (PD3) | _BV (PD4);       /* pullup for buttons */  /* end if button detection setup */  /* ADC configuration goes here */  ADMUX = _BV (REFS0);  ADCSRA = _BV (ADEN) | _BV (ADPS2) | _BV (ADPS1) | _BV (ADPS0);  PORTC |= _BV (PC0) | _BV (PC1);  /* end of ADC configuration */  /* clear the display */  d_content_update (" ");  d_status_update (" ");  d_update ();  usbDeviceConnect ();  usbInit ();  sei ();}
开发者ID:age,项目名称:mss,代码行数:59,


示例27: initForUsbConnectivity

static inline void initForUsbConnectivity(void) {    usbInit();    /* enforce USB re-enumerate: */    usbDeviceDisconnect();  /* do this while interrupts are disabled */    _delay_ms(500);    usbDeviceConnect();    sei();}
开发者ID:vimes79,项目名称:micronucleus-t85,代码行数:8,


示例28: setupUSB

void setupUSB() {    usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */    _delay_ms(300UL);/* fake USB disconnect for > 250 ms */    usbDeviceConnect();    usbInit();    sei();	usbPoll();}
开发者ID:IvIePhisto,项目名称:Dual-Strike,代码行数:8,


示例29: main

/**************************************************************************** * main()																	* *																			* *																			* ***************************************************************************/int main(void) {		uchar i;	uchar calibrationValue;    calibrationValue = eeprom_read_byte(0); /* calibration value from last time */    if(calibrationValue != 0xff){        OSCCAL = calibrationValue;    }	i2c_init();	    usbInit();    usbDeviceDisconnect();     i = 0;    while(--i) {        _delay_ms(1);    }    usbDeviceConnect();	DDRB &= ~_BV(DDB1);			// input from slave to indicate a msg is waiting///////////	DDRB = 0b0010; // set pb1 as output/////////		sei();    for(;;) {        usbPoll();		if (PINB & _BV(PB1)) {			while (PINB & _BV(PB1)) {				// wait until off			}			i2c_start((DEVICE_ID << 1) + I2C_READ);			action = i2c_read(0);			i2c_stop();			if (action <= sizeof(keys)/sizeof(uchar)) {				reportCount = 0;			}		}		if(usbInterruptIsReady() && (reportCount < 2)){ /* we can send another key */        	buildReport();           	usbSetInterrupt(reportBuffer, sizeof(reportBuffer));        }    }    return 0;}
开发者ID:Sorally,项目名称:programming-projects,代码行数:63,


示例30: main

int main(void){    // Lights, backlights, and fan initialization    set_output(F1DD,F1PIN);    set_output(F2DD,F2PIN);    set_output(LDD,LPIN);    set_output(BLDD,BLPIN);    set_high(LPORT,BLPIN);    TCCR0A = 0xA3;					// Timer0, channels A and B to Fast PWM Mode    TCCR2A = 0x23;					// Timer2, channel B to Fast PWM Mode    TCCR0B = 0x05;					// Prescaler is 1024 to give MOSFETS plenty of time    TCCR2B = 0x07;    OCR0A = 0xFF;					// Rev up fans for 2s to avoid stalling    OCR0B = 0xFF;    _delay_ms(2000);    OCR0A = 0x7F;					// Reduce fans to 50% power (127)    OCR0B = 0x7F;    uchar i;    for (i=0; i<3; i++) {				// Blink lights to signal life        OCR2B = 0xFF;        _delay_ms(200);        OCR2B = 0x00;        _delay_ms(200);    }    OCR2B = 0x14;					// Init lights at low brightness (20)    // LCD initialization    _delay_ms(200);    CHA_LCDinit();    CHA_LCDclr();    CHB_LCDinit();    CHB_LCDclr();    CHA_LCDstringLine(lcdinit,0);	// LCD ready to go!    // USB initialization    wdt_enable(WDTO_1S); 			// Enable 1s watchdog timer    usbInit();    usbDeviceDisconnect(); 			// Enforce re-enumeration    for(i = 0; i<200; i++) { 		// Wait 200 ms        wdt_reset();				// Keep the watchdog happy        _delay_ms(1);    }    usbDeviceConnect();    sei(); 							// Enable interrupts after re-enumeration    CHB_LCDstringLine(usbinit,0);	// USB ready to go!    while(1) {						// Feed watchdog and poll USB forever        wdt_reset();        usbPoll();    }    return 0;}
开发者ID:amcnicoll,项目名称:LCD-USB,代码行数:55,



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


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