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

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

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

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

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

示例1: dnkbd_attach

voiddnkbd_attach(struct device *parent, struct device *self, void *aux){	struct dnkbd_softc *sc = (struct dnkbd_softc *)self;	struct frodo_attach_args *fa = aux;	printf(": ");	sc->sc_regs = (struct apciregs *)IIOV(FRODO_BASE + fa->fa_offset);	timeout_set(&sc->sc_bellstop_tmo, dnkbd_bellstop, sc);#ifdef WSDISPLAY_COMPAT_RAWKBD	timeout_set(&sc->sc_rawrepeat_ch, dnkbd_rawrepeat, sc);#endif	/* reset the port */	apciinit(sc->sc_regs, 1200, CFCR_8BITS | CFCR_PEVEN | CFCR_PENAB);	sc->sc_isr.isr_func = dnkbd_intr;	sc->sc_isr.isr_arg = sc;	sc->sc_isr.isr_priority = IPL_TTY;	frodo_intr_establish(parent, fa->fa_line, &sc->sc_isr, self->dv_xname);	/* probe for keyboard */	if (dnkbd_probe(sc) != 0) {		printf("no keyboard/n");		return;	}	dnkbd_attach_subdevices(sc);}
开发者ID:avsm,项目名称:openbsd-xen-sys,代码行数:31,


示例2: imxuartattach

voidimxuartattach(struct device *parent, struct device *self, void *args){	struct armv7_attach_args *aa = args;	struct imxuart_softc *sc = (struct imxuart_softc *) self;	sc->sc_irq = arm_intr_establish(aa->aa_dev->irq[0], IPL_TTY,	    imxuart_intr, sc, sc->sc_dev.dv_xname);	sc->sc_iot = aa->aa_iot;	if (bus_space_map(sc->sc_iot, aa->aa_dev->mem[0].addr,	    aa->aa_dev->mem[0].size, 0, &sc->sc_ioh))		panic("imxuartattach: bus_space_map failed!");	if (aa->aa_dev->mem[0].addr == imxuartconsaddr)		printf(" console");	timeout_set(&sc->sc_diag_tmo, imxuart_diag, sc);	timeout_set(&sc->sc_dtr_tmo, imxuart_raisedtr, sc);	sc->sc_si = softintr_establish(IPL_TTY, imxuart_softint, sc);	if(sc->sc_si == NULL)		panic("%s: can't establish soft interrupt.",		    sc->sc_dev.dv_xname);	printf("/n");}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:27,


示例3: domaininit

voiddomaininit(void){	struct domain *dp;	struct protosw *pr;	static struct timeout pffast_timeout;	static struct timeout pfslow_timeout;#undef unix	/*	 * KAME NOTE: ADDDOMAIN(route) is moved to the last part so that	 * it will be initialized as the *first* element.  confusing!	 */#ifndef lint	ADDDOMAIN(unix);#ifdef INET	ADDDOMAIN(inet);#endif#ifdef INET6	ADDDOMAIN(inet6);#endif /* INET6 */#if defined (KEY) || defined (IPSEC) || defined (TCP_SIGNATURE)	pfkey_init();#endif /* KEY || IPSEC */#ifdef MPLS       ADDDOMAIN(mpls);#endif#ifdef NATM	ADDDOMAIN(natm);#endif#ifdef IPSEC#ifdef __KAME__	ADDDOMAIN(key);#endif#endif#if NBLUETOOTH > 0	ADDDOMAIN(bt);#endif	ADDDOMAIN(route);#endif	for (dp = domains; dp; dp = dp->dom_next) {		if (dp->dom_init)			(*dp->dom_init)();		for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)			if (pr->pr_init)				(*pr->pr_init)();	}	if (max_linkhdr < 16)		/* XXX */		max_linkhdr = 16;	max_hdr = max_linkhdr + max_protohdr;	max_datalen = MHLEN - max_hdr;	timeout_set(&pffast_timeout, pffasttimo, &pffast_timeout);	timeout_set(&pfslow_timeout, pfslowtimo, &pfslow_timeout);	timeout_add(&pffast_timeout, 1);	timeout_add(&pfslow_timeout, 1);}
开发者ID:sofuture,项目名称:bitrig,代码行数:58,


示例4: sxiuartattach

voidsxiuartattach(struct device *parent, struct device *self, void *args){	struct armv7_attach_args *aa = args;	struct sxiuart_softc *sc = (struct sxiuart_softc *) self;	bus_space_tag_t iot;	bus_space_handle_t ioh;	int s;	sc->sc_iot = iot = aa->aa_iot;	if (bus_space_map(sc->sc_iot, aa->aa_dev->mem[0].addr,	    aa->aa_dev->mem[0].size, 0, &sc->sc_ioh))		panic("sxiuartattach: bus_space_map failed!");	ioh = sc->sc_ioh;	if (aa->aa_dev->mem[0].addr == sxiuartconsaddr) {		cn_tab->cn_dev = makedev(12 /* XXX */, 0);		cdevsw[12] = sxiuartdev;		/* KLUDGE */		printf(": console");		/* XXX compare uses of COM_HW_CONSOLE against com.c */		SET(sc->sc_hwflags, COM_HW_CONSOLE);		SET(sc->sc_swflags, COM_SW_SOFTCAR);		sxiuartconsiot = iot;		sxiuartconsioh = ioh;	}	timeout_set(&sc->sc_diag_tmo, sxiuart_diag, sc);	timeout_set(&sc->sc_dtr_tmo, sxiuart_raisedtr, sc);	sc->sc_si = softintr_establish(IPL_TTY, sxiuart_softint, sc);	if(sc->sc_si == NULL)		panic("%s: can't establish soft interrupt.",		    sc->sc_dev.dv_xname);	sc->sc_frequency = 24000000; /* XXX */	if ((bus_space_read_1(sc->sc_iot, sc->sc_ioh, SXIUART_IIR) &	  IIR_BUSY) == IIR_BUSY)		(void)bus_space_read_4(sc->sc_iot, sc->sc_ioh, SXIUART_USR);	sc->sc_ier = 0;	/* disable interrupts */	bus_space_write_1(iot, ioh, SXIUART_IER, sc->sc_ier);	/* clear and disable fifo */	bus_space_write_1(iot, ioh, SXIUART_FCR, 0 | RFIFOR | XFIFOR);	s = splhigh();	SET(sc->sc_mcr, MCR_DTR | MCR_RTS | MCR_IENABLE);	bus_space_write_1(sc->sc_iot, sc->sc_ioh, SXIUART_MCR, sc->sc_mcr);	splx(s);	arm_intr_establish(aa->aa_dev->irq[0], IPL_TTY,	    sxiuart_intr, sc, sc->sc_dev.dv_xname);	printf("/n");}
开发者ID:bradla,项目名称:OpenBSD-Hammer2,代码行数:56,


示例5: pckbc_cnattach

intpckbc_cnattach(bus_space_tag_t iot, bus_addr_t addr, bus_size_t cmd_offset,    int flags){	bus_space_handle_t ioh_d, ioh_c;	int res = 0;	if (bus_space_map(iot, addr + KBDATAP, 1, 0, &ioh_d))                return (ENXIO);	if (bus_space_map(iot, addr + cmd_offset, 1, 0, &ioh_c)) {		bus_space_unmap(iot, ioh_d, 1);                return (ENXIO);	}	pckbc_consdata.t_iot = iot;	pckbc_consdata.t_ioh_d = ioh_d;	pckbc_consdata.t_ioh_c = ioh_c;	pckbc_consdata.t_addr = addr;	pckbc_consdata.t_flags = flags;	timeout_set(&pckbc_consdata.t_cleanup, pckbc_cleanup, &pckbc_consdata);	timeout_set(&pckbc_consdata.t_poll, pckbc_poll, &pckbc_consdata);	/* flush */	(void) pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_KBD_SLOT, 0);	/* selftest? */	/* init cmd byte, enable ports */	pckbc_consdata.t_cmdbyte = KC8_CPU;	if (!pckbc_put8042cmd(&pckbc_consdata)) {		printf("kbc: cmd word write error/n");		res = EIO;	}	if (!res) {#if (NPCKBD > 0)		res = pckbd_cnattach(&pckbc_consdata);#else		res = ENXIO;#endif /* NPCKBD > 0 */	}	if (res) {		bus_space_unmap(iot, pckbc_consdata.t_ioh_d, 1);		bus_space_unmap(iot, pckbc_consdata.t_ioh_c, 1);	} else {		pckbc_consdata.t_slotdata[PCKBC_KBD_SLOT] = &pckbc_cons_slotdata;		pckbc_init_slotdata(&pckbc_cons_slotdata);		pckbc_console = 1;	}	return (res);}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:53,


示例6: cpu_configure

/* * Determine i/o configuration for a machine. */voidcpu_configure(void){#if NBIOS32 > 0	bios32_init();#endif	x86_64_proc0_tss_ldt_init();	if (config_rootfound("mainbus", NULL) == NULL)		panic("configure: mainbus not configured");	intr_printconfig();#if NIOAPIC > 0	lapic_set_lvt();	ioapic_enable();#endif#ifdef MULTIPROCESSOR	cpu_init_idle_pcbs();#endif	lcr8(0);	spl0();	cold = 0;	/*	 * At this point the RNG is running, and if FSXR is set we can	 * use it.  Here we setup a periodic timeout to collect the data.	 */	if (viac3_rnd_present) {		timeout_set(&viac3_rnd_tmo, viac3_rnd, &viac3_rnd_tmo);		viac3_rnd(&viac3_rnd_tmo);	}	if (has_rdrand) {		timeout_set(&rdrand_tmo, rdrand, &rdrand_tmo);		rdrand(&rdrand_tmo);	}#ifdef CRYPTO	/*	 * Also, if the chip has crypto available, enable it.	 */	if (amd64_has_xcrypt)		viac3_crypto_setup();	if (amd64_has_aesni)		aesni_setup();#endif}
开发者ID:appleorange1,项目名称:bitrig,代码行数:53,


示例7: panel_attach

voidpanel_attach(struct device *parent, struct device *self, void *aux){	struct panel_softc *sc = (struct panel_softc *)self;	struct hpc_attach_args *haa = aux;	sc->sc_iot = haa->ha_st;	if (bus_space_subregion(haa->ha_st, haa->ha_sh, haa->ha_devoff + 3, 1,	    &sc->sc_ioh)) {		printf(": can't map registers/n");		return;	}	sc->sc_irq = haa->ha_irq;	sc->sc_ih = hpc_intr_establish(sc->sc_irq, IPL_BIO, panel_intr, sc,	    sc->sc_dev.dv_xname);	if (sc->sc_ih == NULL) {		printf(": can't establish interrupt/n");		return;	}	if (sys_config.system_subtype == IP22_INDY)		printf(": power and volume buttons/n");	else		printf(": power button/n");	timeout_set(&sc->sc_repeat_tmo, panel_repeat, sc);}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:28,


示例8: midiattach

voidmidiattach(struct device *parent, struct device *self, void *aux){	struct midi_info	  mi;	struct midi_softc        *sc = (struct midi_softc *)self;	struct audio_attach_args *sa = (struct audio_attach_args *)aux;	struct midi_hw_if        *hwif = sa->hwif;	void  			 *hdl = sa->hdl;#ifdef DIAGNOSTIC	if (hwif == 0 ||	    hwif->open == 0 ||	    hwif->close == 0 ||	    hwif->output == 0 ||	    hwif->getinfo == 0) {		printf("midi: missing method/n");		return;	}#endif	sc->hw_if = hwif;	sc->hw_hdl = hdl;	sc->hw_if->getinfo(sc->hw_hdl, &mi);	sc->props = mi.props;	sc->flags = 0;	timeout_set(&sc->timeo, midi_timeout, sc);	printf(": <%s>/n", mi.name);}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:27,


示例9: consthr_init_wait

static boolean_tconsthr_init_wait(void){	struct timespec timeout;	disp_flag_t flag;	int status = 0;	timeout_set(&timeout, DISP_DEFAULT_INTVAL);	(void) pthread_mutex_lock(&s_disp_ctl.mutex);	flag = s_disp_ctl.flag;	/*	 * The cons thread issues a command to go to home window	 * when it completes the initialization.	 */	while ((flag != DISP_FLAG_CMD) &&	    (flag != DISP_FLAG_QUIT)) {		status = pthread_cond_timedwait(&s_disp_ctl.cond,		    &s_disp_ctl.mutex, &timeout);		if (status == ETIMEDOUT) {			break;		}		flag = s_disp_ctl.flag;	}	(void) pthread_mutex_unlock(&s_disp_ctl.mutex);	if ((status == ETIMEDOUT) || (flag == DISP_FLAG_QUIT)) {		return (B_FALSE);	}	return (B_TRUE);}
开发者ID:antoniogi,项目名称:numatop,代码行数:34,


示例10: spin_edit_start

/*----------------------------------------------------------------------------*/void spin_edit_start(const char *caption, int *val, int max, int min, int increment){  int size;  char buffer[16];  spin_data.value = val;  spin_data.caption = caption;  spin_data.min = min;  spin_data.max = max;  spin_data.increment = increment;  spin_data.size = sprintf(buffer, "%d", min);  size = sprintf(buffer, "%d", max);  if(spin_data.size < size)    spin_data.size = size;  value = *val;  if(value < min)    value = min;  if(value > max)    value = max;  spin_data.cursor_active = 1;  timeout_set(&spin_data.timeout, CURSOR_TIME, sys_tick_count());  push_event_handler();  set_event_handler(spin_handler, 0);}
开发者ID:olegyurchenko,项目名称:dda-control,代码行数:28,


示例11: zts_attach

voidzts_attach(struct device *parent, struct device *self, void *aux){	struct zts_softc *sc = (struct zts_softc *)self;	struct wsmousedev_attach_args a;  	timeout_set(&sc->sc_ts_poll, zts_poll, sc);	/* Initialize ADS7846 Difference Reference mode */	(void)zssp_ic_send(ZSSP_IC_ADS7846,	    (1<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH));	delay(5000);	(void)zssp_ic_send(ZSSP_IC_ADS7846,	    (3<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH));	delay(5000);	(void)zssp_ic_send(ZSSP_IC_ADS7846,	    (4<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH));	delay(5000);	(void)zssp_ic_send(ZSSP_IC_ADS7846,	    (5<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH));	delay(5000);	a.accessops = &zts_accessops;	a.accesscookie = sc;	printf("/n");	/* Copy the default scalue values to each softc */	bcopy(&zts_scale, &sc->sc_tsscale, sizeof(sc->sc_tsscale));			sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);}
开发者ID:alenichev,项目名称:openbsd-kernel,代码行数:31,


示例12: octrng_attach

voidoctrng_attach(struct device *parent, struct device *self, void *aux){	struct octrng_softc *sc = (void *)self;	sc->sc_io = aux;	uint64_t control_reg;	sc->sc_iot = sc->sc_io->aa_bust;	if (bus_space_map(sc->sc_iot, OCTEON_RNG_BASE, OCTRNG_MAP_SIZE, 0,	    &sc->sc_ioh)) {		printf(": can't map registers");	}	control_reg = octeon_xkphys_read_8(OCTRNG_CONTROL_ADDR);	control_reg |= (OCTRNG_ENABLE_OUTPUT | OCTRNG_ENABLE_ENTROPY);	octeon_xkphys_write_8(OCTRNG_CONTROL_ADDR, control_reg);	timeout_set(&sc->sc_to, octrng_rnd, sc);	timeout_add_sec(&sc->sc_to, 5);	printf("/n");}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:25,


示例13: error

/* * Print out an error message.  actions contain a set of flags that determine * what needs to get done.  If BUG is set, it is an internal error.  If SYS is * set, a system error is printed.  If RET is set, we return rather than exit. */static interror(int actions, const char *fmt, ...){    va_list alist;    char *p = error_message;    char *q = p + sizeof(error_message);    if ((actions & BUG) != 0)	buf_app(&p, q, "internal error: ");    va_start(alist, fmt);    p += vsnprintf(p, q-p, fmt, alist);    va_end(alist);    if ((actions & SYS) != 0 && errno) {	buf_app(&p, q, ": ");	buf_app(&p, q, strerror(errno));    }    buf_end(&p, q);    fwrite(error_message, 1, p+1-error_message, stdout);    if ((actions & RET) != 0)	return 0;#if 0    if (RemoteFD >= 0) { 	send(RemoteFD, "?", 1, MSG_OOB);	(void) write(RemoteFD, error_message, p-error_message);	shutdown(RemoteFD, SHUT_WR);	timeout_set(ERROR_TIMEOUT, sig_alrm_die);	while (read(RemoteFD, error_message, sizeof(error_message)) > 0)	    ;           }#endif    return -1;}
开发者ID:ielhelw,项目名称:MCMC_FOR_AMMSB,代码行数:38,


示例14: fdcattach

voidfdcattach(struct device *parent, struct device *self, void *aux){	struct fdc_softc *fdc = (void *)self;	bus_space_tag_t iot;	bus_space_handle_t ioh;	bus_space_handle_t ioh_ctl;	struct isa_attach_args *ia = aux;	struct fdc_attach_args fa;	int type;	iot = ia->ia_iot;	/* Re-map the I/O space. */	if (bus_space_map(iot, ia->ia_iobase, FDC_NPORT, 0, &ioh) ||	    bus_space_map(iot, ia->ia_iobase + FDCTL_OFFSET,			  FDCTL_NPORT, 0, &ioh_ctl))		panic("fdcattach: couldn't map I/O ports");	fdc->sc_iot = iot;	fdc->sc_ioh = ioh;	fdc->sc_ioh_ctl = ioh_ctl;	fdc->sc_drq = ia->ia_drq;	fdc->sc_state = DEVIDLE;	TAILQ_INIT(&fdc->sc_link.fdlink.sc_drives);	/* XXX */	printf("/n");	fdc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,	    IPL_BIO, fdcintr, fdc, fdc->sc_dev.dv_xname);#if defined(__i386__) || defined(__amd64__)	/*	 * The NVRAM info only tells us about the first two disks on the	 * `primary' floppy controller.	 */	if (fdc->sc_dev.dv_unit == 0)		type = mc146818_read(NULL, NVRAM_DISKETTE); /* XXX softc */	else#endif		type = -1;	timeout_set(&fdc->fdcpseudointr_to, fdcpseudointr, fdc);	/* physical limit: four drives per controller. */	for (fa.fa_drive = 0; fa.fa_drive < 4; fa.fa_drive++) {		fa.fa_flags = 0;		fa.fa_type = 0;#if NFD > 0		if (type >= 0 && fa.fa_drive < 2)			fa.fa_deftype = fd_nvtotype(fdc->sc_dev.dv_xname,			    type, fa.fa_drive);		else#endif			fa.fa_deftype = NULL;		/* unknown */		(void)config_found(self, (void *)&fa, fddprint);	}}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:59,


示例15: ieee80211_node_attach

voidieee80211_node_attach(struct ifnet *ifp){	struct ieee80211com *ic = (void *)ifp;#ifndef IEEE80211_STA_ONLY	int size;#endif	RB_INIT(&ic->ic_tree);	ic->ic_node_alloc = ieee80211_node_alloc;	ic->ic_node_free = ieee80211_node_free;	ic->ic_node_copy = ieee80211_node_copy;	ic->ic_node_getrssi = ieee80211_node_getrssi;	ic->ic_scangen = 1;	ic->ic_max_nnodes = ieee80211_cache_size;	if (ic->ic_max_aid == 0)		ic->ic_max_aid = IEEE80211_AID_DEF;	else if (ic->ic_max_aid > IEEE80211_AID_MAX)		ic->ic_max_aid = IEEE80211_AID_MAX;#ifndef IEEE80211_STA_ONLY	size = howmany(ic->ic_max_aid, 32) * sizeof(u_int32_t);	ic->ic_aid_bitmap = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO);	if (ic->ic_aid_bitmap == NULL) {		/* XXX no way to recover */		printf("%s: no memory for AID bitmap!/n", __func__);		ic->ic_max_aid = 0;	}	if (ic->ic_caps & (IEEE80211_C_HOSTAP | IEEE80211_C_IBSS)) {		ic->ic_tim_len = howmany(ic->ic_max_aid, 8);		ic->ic_tim_bitmap = malloc(ic->ic_tim_len, M_DEVBUF,		    M_NOWAIT | M_ZERO);		if (ic->ic_tim_bitmap == NULL) {			printf("%s: no memory for TIM bitmap!/n", __func__);			ic->ic_tim_len = 0;		} else			ic->ic_set_tim = ieee80211_set_tim;		timeout_set(&ic->ic_rsn_timeout,		    ieee80211_gtk_rekey_timeout, ic);		timeout_set(&ic->ic_inact_timeout,		    ieee80211_inact_timeout, ic);		timeout_set(&ic->ic_node_cache_timeout,		    ieee80211_node_cache_timeout, ic);	}#endif}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:46,


示例16: ifinit

/* * Network interface utility routines. * * Routines with ifa_ifwith* names take sockaddr *'s as * parameters. */voidifinit(){	static struct timeout if_slowtim;	timeout_set(&if_slowtim, if_slowtimo, &if_slowtim);	if_slowtimo(&if_slowtim);}
开发者ID:NKSG,项目名称:INTER_MANET_NS3,代码行数:15,


示例17: lpt_attach_common

voidlpt_attach_common(struct lpt_softc *sc){	printf("/n");	bus_space_write_1(sc->sc_iot, sc->sc_ioh, lpt_control, LPC_NINIT);	timeout_set(&sc->sc_wakeup_tmo, lptwakeup, sc);}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:9,


示例18: cmd_received

/* * The common entry for processing command. */static voidcmd_received(cmd_t *cmd, boolean_t *quit, struct timespec *timeout){	boolean_t badcmd, execute;	int cmd_id = CMD_ID(cmd);	execute = B_TRUE;	*quit = B_FALSE;	switch (cmd_id) {	case CMD_QUIT_ID:		*quit = B_TRUE;		return;	case CMD_RESIZE_ID:		/*		 * The screen resize signal would trigger this		 * command. Destroy existing screen and curses		 * resources and then re-init the curses resources.		 */		win_fix_fini();		page_win_destroy();		reg_curses_fini();		if (reg_curses_init(B_FALSE)) {			win_fix_init();		} else {			execute = B_FALSE;		}		timeout_set(timeout, DISP_DEFAULT_INTVAL);		break;	case CMD_REFRESH_ID:		/*		 * User hit the hotkey 'R' to refresh current window.		 */		timeout_set(timeout, DISP_DEFAULT_INTVAL);		break;	}	if (execute) {		cmd_execute(cmd, &badcmd);	}}
开发者ID:antoniogi,项目名称:numatop,代码行数:47,


示例19: ledattach

voidledattach(struct device *parent, struct device *self, void *aux){	struct led_softc *sc = (void *)self;#if VAX49 || VAX53 || VXT	vaddr_t pgva;#endif	printf("/n");	switch (vax_boardtype) {#if VAX46	case VAX_BTYP_46:	{		extern struct vs_cpu *ka46_cpu;		sc->sc_reg = (volatile u_short *)(&ka46_cpu->vc_diagdsp);		sc->sc_pat = led_pattern8;	}		break;#endif#if VAX48	case VAX_BTYP_48:	{		extern struct vs_cpu *ka48_cpu;		sc->sc_reg = (volatile u_short *)(&ka48_cpu->vc_diagdsp);		sc->sc_pat = led_pattern8;	}		break;#endif#if VAX49	case VAX_BTYP_49:		pgva = vax_map_physmem(0x25800000, 1);		sc->sc_reg = (volatile u_short *)(pgva + 4);		sc->sc_pat = led_pattern8;		break;#endif#if VAX53	case VAX_BTYP_1303:		pgva = vax_map_physmem(0x20140000, 1);		sc->sc_reg = (volatile u_short *)(pgva + 0x30);		sc->sc_pat = led_pattern4;		break;#endif#if VXT	case VAX_BTYP_VXT:		pgva = vax_map_physmem(0x200c1000, 1);		sc->sc_reg = (volatile u_short *)pgva;		sc->sc_pat = led_pattern8;		break;#endif	}	sc->sc_patpos = sc->sc_pat;	timeout_set(&sc->sc_tmo, led_blink, sc);	led_blink(sc);}
开发者ID:avsm,项目名称:openbsd-xen-sys,代码行数:56,


示例20: viewer

/*----------------------------------------------------------------------------*/void viewer(view_get_t get, void *data, int string_count){  view_data.get = get;  view_data.data = data;  view_data.string_count = string_count;  view_data.index = 0;  view_data.cursor_active = 1;  view_data.active_key = 0;  timeout_set(&view_data.timeout, CURSOR_TIME, sys_tick_count());  push_event_handler();  set_event_handler(view_handler, 0);}
开发者ID:olegyurchenko,项目名称:dda-control,代码行数:13,


示例21: mainloop_modify_timeout

int mainloop_modify_timeout(int id, unsigned int seconds){	if (seconds > 0) {		if (timeout_set(id, seconds) < 0)			return -EIO;	}	if (mainloop_modify_fd(id, EPOLLIN | EPOLLONESHOT) < 0)		return -EIO;	return 0;}
开发者ID:520lly,项目名称:bluez,代码行数:12,


示例22: ykbec_attach

voidykbec_attach(device_t parent, device_t self, void *aux){	struct isa_attach_args *ia = aux;	struct ykbec_softc *sc = device_private(self);	int i;	sc->sc_iot = ia->ia_iot;	if (bus_space_map(sc->sc_iot, ia->ia_iobase, ia->ia_iosize, 0,	    &sc->sc_ioh)) {		aprint_error(": couldn't map I/O space");		return;	}	/* Initialize sensor data. */	strlcpy(sc->sc_sensordev.xname, device_xname(self),	    sizeof(sc->sc_sensordev.xname));	if (sensor_task_register(sc, ykbec_refresh, 5) == NULL) {		aprint_error(", unable to register update task/n");		return;	}#ifdef DEBUG	ykbec_print_bat_info(sc);#endif	aprint_normal("/n");	for (i = 0; i < YKBEC_NSENSORS; i++) {		sc->sc_sensor[i].type = ykbec_table[i].type; 		if (ykbec_table[i].desc) 			strlcpy(sc->sc_sensor[i].desc, ykbec_table[i].desc,			    sizeof(sc->sc_sensor[i].desc));		sensor_attach(&sc->sc_sensordev, &sc->sc_sensor[i]);	}	sensordev_install(&sc->sc_sensordev);#if NAPM > 0	/* make sure we have the apm state initialized before apm attaches */	ykbec_refresh(sc);	apm_setinfohook(ykbec_apminfo);#endif#if NPCKBD > 0 || NHIDKBD > 0	timeout_set(&sc->sc_bell_tmo, ykbec_bell_stop, sc);#if NPCKBD > 0	pckbd_hookup_bell(ykbec_bell, sc);#endif#if NHIDKBD > 0	hidkbd_hookup_bell(ykbec_bell, sc);#endif#endif	ykbec_sc = sc;}
开发者ID:krytarowski,项目名称:netbsd-current-src-sys,代码行数:53,


示例23: ieee80211_setup_node

voidieee80211_setup_node(struct ieee80211com *ic,	struct ieee80211_node *ni, const u_int8_t *macaddr){	int s;	DPRINTF(("%s/n", ether_sprintf((u_int8_t *)macaddr)));	IEEE80211_ADDR_COPY(ni->ni_macaddr, macaddr);	ieee80211_node_newstate(ni, IEEE80211_STA_CACHE);	ni->ni_ic = ic;	/* back-pointer */#ifndef IEEE80211_STA_ONLY	IFQ_SET_MAXLEN(&ni->ni_savedq, IEEE80211_PS_MAX_QUEUE);	timeout_set(&ni->ni_eapol_to, ieee80211_eapol_timeout, ni);	timeout_set(&ni->ni_sa_query_to, ieee80211_sa_query_timeout, ni);#endif	s = splnet();	RB_INSERT(ieee80211_tree, &ic->ic_tree, ni);	ic->ic_nnodes++;	splx(s);}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:21,


示例24: prv_redraw_parameters

static voidprv_redraw_parameters (void){	if (redraw_timeout)	{		timeout_reset (redraw_timeout, redraw_delay);	}	else	{		timeout_set (redraw_delay, prv_redraw_parameters_callback, 0);	}}
开发者ID:jondo2010,项目名称:pbr_steering,代码行数:12,


示例25: nmeaopen

intnmeaopen(dev_t dev, struct tty *tp, struct proc *p){	struct nmea *np;	int error;	if (tp->t_line == NMEADISC)		return (ENODEV);	if ((error = suser(p, 0)) != 0)		return (error);	np = malloc(sizeof(struct nmea), M_DEVBUF, M_WAITOK | M_ZERO);	snprintf(np->timedev.xname, sizeof(np->timedev.xname), "nmea%d",	    nmea_nxid++);	nmea_count++;	np->time.status = SENSOR_S_UNKNOWN;	np->time.type = SENSOR_TIMEDELTA;	np->time.flags = SENSOR_FINVALID;	sensor_attach(&np->timedev, &np->time);	np->signal.type = SENSOR_INDICATOR;	np->signal.status = SENSOR_S_UNKNOWN;	np->signal.value = 0;	strlcpy(np->signal.desc, "Signal", sizeof(np->signal.desc));	sensor_attach(&np->timedev, &np->signal);	np->latitude.type = SENSOR_ANGLE;	np->latitude.status = SENSOR_S_UNKNOWN;	np->latitude.flags = SENSOR_FINVALID;	np->latitude.value = 0;	strlcpy(np->latitude.desc, "Latitude", sizeof(np->latitude.desc));	sensor_attach(&np->timedev, &np->latitude);	np->longitude.type = SENSOR_ANGLE;	np->longitude.status = SENSOR_S_UNKNOWN;	np->longitude.flags = SENSOR_FINVALID;	np->longitude.value = 0;	strlcpy(np->longitude.desc, "Longitude", sizeof(np->longitude.desc));	sensor_attach(&np->timedev, &np->longitude);	np->sync = 1;	tp->t_sc = (caddr_t)np;	error = linesw[TTYDISC].l_open(dev, tp, p);	if (error) {		free(np, M_DEVBUF, sizeof(*np));		tp->t_sc = NULL;	} else {		sensordev_install(&np->timedev);		timeout_set(&np->nmea_tout, nmea_timeout, np);	}	return (error);}
开发者ID:orumin,项目名称:openbsd-efivars,代码行数:52,


示例26: nep_attach

voidnep_attach(struct device *parent, struct device *self, void *aux){	struct nep_softc *sc = (struct nep_softc *)self;	struct pci_attach_args *pa = aux;	struct ifnet *ifp = &sc->sc_ac.ac_if;	struct mii_data *mii = &sc->sc_mii;	pcireg_t memtype;	uint64_t cfg;	sc->sc_dmat = pa->pa_dmat;	memtype = PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT;	if (pci_mapreg_map(pa, PCI_MAPREG_START, memtype, 0,	    &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_mems, 0)) {		printf(": can't map registers/n");		return;	}	sc->sc_port = pa->pa_function;#ifdef __sparc64__	if (OF_getprop(PCITAG_NODE(pa->pa_tag), "local-mac-address",	    sc->sc_ac.ac_enaddr, ETHER_ADDR_LEN) <= 0)		myetheraddr(sc->sc_ac.ac_enaddr);#endif	printf(", address %s/n", ether_sprintf(sc->sc_ac.ac_enaddr));	cfg = nep_read(sc, MIF_CONFIG);	cfg &= ~MIF_CONFIG_INDIRECT_MODE;	nep_write(sc, MIF_CONFIG, cfg);	strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, sizeof(ifp->if_xname));	ifp->if_softc = sc;	ifp->if_ioctl = nep_ioctl;	mii->mii_ifp = ifp;	mii->mii_readreg = nep_mii_readreg;	mii->mii_writereg = nep_mii_writereg;	mii->mii_statchg = nep_mii_statchg;	ifmedia_init(&mii->mii_media, 0, nep_mediachange, nep_mediastatus);	mii_attach(&sc->sc_dev, mii, 0xffffffff, MII_PHY_ANY, sc->sc_port, 0);	ifmedia_set(&mii->mii_media, IFM_ETHER|IFM_AUTO);	if_attach(ifp);	ether_ifattach(ifp);	timeout_set(&sc->sc_tick_ch, nep_tick, sc);}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:52,



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


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