这篇教程C++ wdt_disable函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wdt_disable函数的典型用法代码示例。如果您正苦于以下问题:C++ wdt_disable函数的具体用法?C++ wdt_disable怎么用?C++ wdt_disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wdt_disable函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wdt_ioctlstatic long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg){ void __user *argp = (void __user *)arg; int __user *p = argp; int new_timeout; static const struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 1, .identity = "W83697UG WDT", }; switch (cmd) { case WDIOC_GETSUPPORT: if (copy_to_user(argp, &ident, sizeof(ident))) return -EFAULT; break; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: return put_user(0, p); case WDIOC_SETOPTIONS: { int options, retval = -EINVAL; if (get_user(options, p)) return -EFAULT; if (options & WDIOS_DISABLECARD) { wdt_disable(); retval = 0; } if (options & WDIOS_ENABLECARD) { wdt_ping(); retval = 0; } return retval; } case WDIOC_KEEPALIVE: wdt_ping(); break; case WDIOC_SETTIMEOUT: if (get_user(new_timeout, p)) return -EFAULT; if (wdt_set_heartbeat(new_timeout)) return -EINVAL; wdt_ping(); /* Fall */ case WDIOC_GETTIMEOUT: return put_user(timeout, p); default: return -ENOTTY; } return 0;}static int wdt_open(struct inode *inode, struct file *file){ if (test_and_set_bit(0, &wdt_is_open)) return -EBUSY; /* * Activate */ wdt_ping(); return nonseekable_open(inode, file);}static int wdt_close(struct inode *inode, struct file *file){ if (expect_close == 42) wdt_disable(); else { printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!/n"); wdt_ping(); } expect_close = 0; clear_bit(0, &wdt_is_open); return 0;}/* * Notifier for system down */static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused){ if (code == SYS_DOWN || code == SYS_HALT) wdt_disable(); /* Turn the WDT off *///.........这里部分代码省略.........
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:101,
示例2: _start _start(void){ /* * Depending on the config parameter, enable or disable the WDT. */#if !defined(CONFIG_HW_WATCHDOG)#if !defined(CONFIG_SYS_M2S) wdt_disable();#endif#else wdt_enable();#endif /* * Make sure interrupts are disabled. */ __disable_irq();#ifdef CONFIG_LPC18XX_NORFLASH_BOOTSTRAP_WORKAROUND /* * Reload the whole U-Boot image from NOR flash. * The Boot ROM on LPC4350 parts cannot load more than 32KBytes * from NOR flash when booting. */ lpc18xx_bootstrap_from_norflash();#endif /* CONFIG_LPC18XX_NORFLASH_BOOTSTRAP_WORKAROUND */ /* * Copy data and initialize BSS * This is in lieu of the U-boot "conventional" relocation * of code & data from Flash to RAM. * With Cortex-M3, we execute from NVRAM (internal Flash), * having relocated data to internal RAM (and having cleared the BSS * area in internal RAM as well) * Stack grows downwards; the stack base is set-up by the first * value in the first word in the vectors. */ memcpy(&_data_start, &_data_lma_start, &_data_end - &_data_start); memset(&_bss_start, 0, &_bss_end - &_bss_start); /* * Copy RAMCODE separately, if it is separated */#if defined(CONFIG_MEM_RAMCODE_BASE) && defined(CONFIG_MEM_RAMCODE_LEN) memcpy(&_ramcode_start, &_ramcode_lma_start, &_ramcode_end - &_ramcode_start);#endif /* * In U-boot (armboot) lingvo, "go to the C code" - * in fact, with M3, we are at the C code from the very beginning. * In actuality, this is the jump to the ARM generic start code. * ... * Note initialization of _armboot_start below. The ARM generic * code expects that this variable is set to the upper boundary of * the malloc pool area. * For Cortex-M3, where we do not relocate the code to RAM, I set * the malloc pool right behind the stack. See how armboot_start * is defined in the CPU specific .lds file. */ _armboot_start = (unsigned long)&_mem_stack_base; start_armboot();}
开发者ID:tkgunji,项目名称:RCU2_soft,代码行数:63,
示例3: avila_wdt_exitstatic void __exit avila_wdt_exit(void){ misc_deregister(&avila_wdt_miscdev); del_timer(&wdt_timer); wdt_disable();}
开发者ID:981213,项目名称:openwrt,代码行数:6,
示例4: mainint main(void) { /* Watchdog */ wdt_reset(); wdt_disable(); /* Ports */ DDRB = _BV(PINB0) | _BV(PINB2) | _BV(PINB3) | _BV(PINB5); DDRD = _BV(PIND5) | _BV(PIND7); PORTB = 0xff; //& (_BV(PINB0)); PORTC = 0xff; PORTD = 0xff;// & (_BV(PIND5) | _BV(PIND6) | _BV(PIND7)); /* Power saving */ set_sleep_mode(SLEEP_MODE_IDLE); //b = fifoCreate(255); vs1002Reset(); DDRD |= _BV(DDD1); UCSR0B = _BV(TXEN0) | _BV(RXEN0); // | _BV(RXCIE0); UBRR0L = 9; /* SPI */ SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0); //SPSR = _BV(SPI2X); // 0x8000 + 6144 = 0x9800, 12.288MHz XTAL + clk-doubling /* Clock */ vs1002cmd_s(); SPDR = 0x02; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x03; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x98; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); vs1002cmd_e(); /* Mode: TEST */ vs1002cmd_s(); SPDR = 0x02; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x08; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x20; // Test loop_until_bit_is_set(SPSR, SPIF); vs1002cmd_e(); /* Volume */ vs1002cmd_s(); SPDR = 0x02; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x0b; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); vs1002cmd_e(); /* Test 1.500kHz sine */ vs1002data_s(); SPDR = 0x53; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0xef; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x6e; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x28; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x00; loop_until_bit_is_set(SPSR, SPIF); vs1002data_e(); uint8_t t; for (t = 0; t < 125; t++) { _delay_ms(2); } /* End test */ vs1002data_s(); SPDR = 0x45; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x78; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x69; loop_until_bit_is_set(SPSR, SPIF); SPDR = 0x74; loop_until_bit_is_set(SPSR, SPIF);//.........这里部分代码省略.........
开发者ID:kms,项目名称:avr-vs1002,代码行数:101,
示例5: wdt_disablevoid WatchdogAVR::disable() { // Disable the watchdog and clear any saved watchdog timer value. wdt_disable(); _wdto = -1;}
开发者ID:AcriCAA,项目名称:Adafruit_SleepyDog,代码行数:5,
示例6: mainint main(){ wdt_disable(); // no watchdog, just because I'm lazy // Configure I/O PORTS - All Digital Inputs (ARCADE) DDRB = 0; DDRC = 0; DDRD = 0; // Configure Pullups except for Pins PD2 and PD3 PORTB = 0xff; PORTC = 0xff; PORTD = 0xf3; // 1 1 1 1 0 0 1 1 // Configure ADC ADMUX = (1<<REFS0 | 1<<ADLAR ); // AREF = AVcc, Left Justified // 12000000/128 = 93750Hz ADCSRA = (1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0); // ADC Enable and prescaler of 128 // Configure timer TCCR1B = _BV(CS12) | _BV(CS11); // timer is initialized, used to keep track of idle period // Start the show! usbInit(); // start v-usb usbDeviceDisconnect(); // enforce USB re-enumeration, do this while interrupts are disabled! _delay_ms(250); usbDeviceConnect(); sei(); // enable interrupts uint8_t to_send = 1; // boolean, true for first time while (1) { usbPoll(); // Initialize the report IDs // gamepad_report_1.report_id = 1; // no ID is sent. All data shall be within 8 bytes // Initialize report. No buttons pressed, directional at center gamepad_report_1.buttons8_1=0; gamepad_report_1.buttons12_9=0; gamepad_report_1.vXaxis=0; gamepad_report_1.vYaxis=0; gamepad_report_1.vZaxis=0; gamepad_report_1.vRXaxis=0; gamepad_report_1.vRYaxis=0; gamepad_report_1.vRZaxis=0; // Populate Analog Axes ADMUX = (ADMUX & 0xF8) | Xaxis; // Select X axis ADCSRA |= (1<<ADSC); // start single convertion while(ADCSRA & (1<<ADSC)); // wait for conversion to complete gamepad_report_1.vXaxis = 127-ADCH; ADMUX = (ADMUX & 0xF8) | Yaxis; // Select Y axis ADCSRA |= (1<<ADSC); // start single convertion while(ADCSRA & (1<<ADSC)); // wait for conversion to complete gamepad_report_1.vYaxis = 127-ADCH; ADMUX = (ADMUX & 0xF8) | Zaxis; // Select Z axis ADCSRA |= (1<<ADSC); // start single convertion while(ADCSRA & (1<<ADSC)); // wait for conversion to complete gamepad_report_1.vZaxis = 127-ADCH; ADMUX = (ADMUX & 0xF8) | RXaxis; // Select RX axis ADCSRA |= (1<<ADSC); // start single convertion while(ADCSRA & (1<<ADSC)); // wait for conversion to complete gamepad_report_1.vRXaxis = 127-ADCH; ADMUX = (ADMUX & 0xF8) | RYaxis; // Select RY axis ADCSRA |= (1<<ADSC); // start single convertion while(ADCSRA & (1<<ADSC)); // wait for conversion to complete gamepad_report_1.vRYaxis = 127-ADCH; ADMUX = (ADMUX & 0xF8) | RZaxis; // Select RZ axis ADCSRA |= (1<<ADSC); // start single convertion while(ADCSRA & (1<<ADSC)); // wait for conversion to complete gamepad_report_1.vRZaxis = 127-ADCH; // Populate buttons 1-7 if ( B3 ) gamepad_report_1.buttons8_1 += 1; if ( B4 ) gamepad_report_1.buttons8_1 += 2; if ( B5 ) gamepad_report_1.buttons8_1 += 4; if ( B6 ) gamepad_report_1.buttons8_1 += 8; if ( B7 ) gamepad_report_1.buttons8_1 += 16; if ( B8 ) gamepad_report_1.buttons8_1 += 32; if ( B9 ) gamepad_report_1.buttons8_1 += 64; if ( A9 ) gamepad_report_1.buttons8_1 += 128; // Populate buttons 12-9 if ( A8 ) gamepad_report_1.buttons12_9 += 1; if ( A7 ) gamepad_report_1.buttons12_9 += 2; if ( A6 ) gamepad_report_1.buttons12_9 += 4; if ( A5 ) gamepad_report_1.buttons12_9 += 8;//.........这里部分代码省略.........
开发者ID:Danjovic,项目名称:AVeRCADE,代码行数:101,
|