• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ reset_device函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: omap_dss_register_device

int omap_dss_register_device(struct omap_dss_device *dssdev)
{
	static int dev_num;
	static int panel_num;
	int r;

	WARN_ON(!dssdev->driver_name);

	reset_device(&dssdev->dev, 1);
	dssdev->dev.bus = &dss_bus_type;
	dssdev->dev.parent = &dss_bus;
	dssdev->dev.release = omap_dss_dev_release;
	dev_set_name(&dssdev->dev, "display%d", dev_num++);
	r = device_register(&dssdev->dev);
	if (r)
		return r;

	if (dssdev->ctrl.panel) {
		struct omap_dss_device *panel = dssdev->ctrl.panel;

		panel->panel.ctrl = dssdev;

		reset_device(&panel->dev, 1);
		panel->dev.bus = &dss_bus_type;
		panel->dev.parent = &dssdev->dev;
		panel->dev.release = omap_dss_dev_release;
		dev_set_name(&panel->dev, "panel%d", panel_num++);
		r = device_register(&panel->dev);
		if (r)
			return r;
	}

	return 0;
}
开发者ID:macroliu,项目名称:samsung_kernel_nowplus,代码行数:34,代码来源:core.c


示例2: update_device_status

static void update_device_status(struct device *dev)
{
	
	if (dev->desc->status == 0)
		reset_device(dev);
	else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) {
		warnx("Device %s configuration FAILED", dev->name);
		if (dev->running)
			reset_device(dev);
	} else {
		if (dev->running)
			err(1, "Device %s features finalized twice", dev->name);
		start_device(dev);
	}
}
开发者ID:mjduddin,项目名称:B14CKB1RD_kernel_m8,代码行数:15,代码来源:lguest.c


示例3: printk

VOID unregister_client
(
 	INT32 cli_id
)
{
	p_atheros_dev dev;

	printk("DK::Unregsitering client %d \n",cli_id);
	
	dev = &dev_table[cli_id];

	if (!VALID_CLIENT(dev)) {
		printk("DK::unregister_client:Invalid client \n");
	 	return;
    }
	if (!BUSY_CLIENT(dev)) {
		printk("DK::unregister_client:Client not registered \n");
		return;
	}
	
	reset_device(dev->cli_id);
	
	deleteEventQueue(&dev->isr_event_q);
	deleteEventQueue(&dev->trigered_event_q);
#if defined(OWL_PB42) || defined(PYTHON_EMU)	
	bus_dev_exit(dev->bus_dev);
#endif
	dev->dev_busy = 0;
	
	return;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:31,代码来源:client.c


示例4: trace_device_console

static int trace_device_console(void)
{
    int result;
    int count = 0;
    time_t base = time(0);

    if ((result = reset_device(0)))
        return result;

    while (count < trace_size)
    {
        if (time(0) - base > trace_time)
            break;

        if ((result = read_serial_port(device_buffer, 1)))
        {
            if (result == NO_DEVICE_REPLY)
                continue;

            return result;
        }

        fprintf(stdout, isprint(device_buffer[0]) || isspace(device_buffer[0]) ? TTY_NONE "%c" : TTY_NONE "[%02X]", device_buffer[0]);
        fflush(stdout);
        count++;
        base = time(0);
    }

    return DONE;
}
开发者ID:rksdna,项目名称:swamp-boot,代码行数:30,代码来源:main.c


示例5: cleanup_devices

static void cleanup_devices(void)
{
	struct device *dev;

	for (dev = devices.dev; dev; dev = dev->next)
		reset_device(dev);

	
	if (orig_term.c_lflag & (ISIG|ICANON|ECHO))
		tcsetattr(STDIN_FILENO, TCSANOW, &orig_term);
}
开发者ID:mjduddin,项目名称:B14CKB1RD_kernel_m8,代码行数:11,代码来源:lguest.c


示例6: vhost_user_reset_owner

static int
vhost_user_reset_owner(struct virtio_net *dev)
{
	if (dev->flags & VIRTIO_DEV_RUNNING) {
		dev->flags &= ~VIRTIO_DEV_RUNNING;
		dev->notify_ops->destroy_device(dev->vid);
	}

	cleanup_device(dev, 0);
	reset_device(dev);
	return 0;
}
开发者ID:cleveritcz,项目名称:f-stack,代码行数:12,代码来源:vhost_user.c


示例7: omap_dss_register_device

static int omap_dss_register_device(struct omap_dss_device *dssdev)
{
	static int dev_num;

	WARN_ON(!dssdev->driver_name);

	reset_device(&dssdev->dev, 1);
	dssdev->dev.bus = &dss_bus_type;
	dssdev->dev.parent = &dss_bus;
	dssdev->dev.release = omap_dss_dev_release;
	dev_set_name(&dssdev->dev, "display%d", dev_num++);
	return device_register(&dssdev->dev);
}
开发者ID:richardxu,项目名称:panda-a4,代码行数:13,代码来源:core.c


示例8: init_device

/*
 * Reset and initialize the device
 */
static int init_device(struct device *dev)
{
	struct talitos_private *priv = dev_get_drvdata(dev);
	int ch, err;

	/*
	 * Master reset
	 * errata documentation: warning: certain SEC interrupts
	 * are not fully cleared by writing the MCR:SWR bit,
	 * set bit twice to completely reset
	 */
	err = reset_device(dev);
	if (err)
		return err;

	err = reset_device(dev);
	if (err)
		return err;

	/* reset channels */
	for (ch = 0; ch < priv->num_channels; ch++) {
		err = reset_channel(dev, ch);
		if (err)
			return err;
	}

	/* enable channel done and error interrupts */
	setbits32(priv->reg + TALITOS_IMR, TALITOS_IMR_INIT);
	setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT);

	/* disable integrity check error interrupts (use writeback instead) */
	if (priv->features & TALITOS_FTR_HW_AUTH_CHECK)
		setbits32(priv->reg + TALITOS_MDEUICR_LO,
		          TALITOS_MDEUICR_LO_ICE);

	return 0;
}
开发者ID:10x-Amin,项目名称:x10_Th_kernel,代码行数:40,代码来源:talitos.c


示例9: cv_read_block

/**
 * Get a block of data from the device.
 *
 * @param devc The struct containing private per-device-instance data. Must not
 *             be NULL. devc->ftdic must not be NULL either.
 *
 * @return SR_OK upon success, or SR_ERR upon errors.
 */
SR_PRIV int cv_read_block(struct dev_context *devc)
{
	int i, byte_offset, m, mi, p, q, index, bytes_read;
	gint64 now;

	/* Note: Caller checked that devc and devc->ftdic != NULL. */

	sr_spew("Reading block %d.", devc->block_counter);

	bytes_read = cv_read(devc, devc->mangled_buf, BS);

	/* If first block read got 0 bytes, retry until success or timeout. */
	if ((bytes_read == 0) && (devc->block_counter == 0)) {
		do {
			sr_spew("Reading block 0 (again).");
			/* Note: If bytes_read < 0 cv_read() will log errors. */
			bytes_read = cv_read(devc, devc->mangled_buf, BS);
			now = g_get_monotonic_time();
		} while ((devc->done > now) && (bytes_read == 0));
	}

	/* Check if block read was successful or a timeout occurred. */
	if (bytes_read != BS) {
		sr_err("Trigger timed out. Bytes read: %d.", bytes_read);
		(void) reset_device(devc); /* Ignore errors. */
		return SR_ERR;
	}

	/* De-mangle the data. */
	sr_spew("Demangling block %d.", devc->block_counter);
	byte_offset = devc->block_counter * BS;
	m = byte_offset / (1024 * 1024);
	mi = m * (1024 * 1024);
	for (i = 0; i < BS; i++) {
		if (devc->prof->model == CHRONOVU_LA8) {
			p = i & (1 << 0);
			index = m * 2 + (((byte_offset + i) - mi) / 2) * 16;
			index += (devc->divcount == 0) ? p : (1 - p);
		} else {
			p = i & (1 << 0);
			q = i & (1 << 1);
			index = m * 4 + (((byte_offset + i) - mi) / 4) * 32;
			index += q + (1 - p);
		}
		devc->final_buf[index] = devc->mangled_buf[i];
	}

	return SR_OK;
}
开发者ID:Matthias-Heidbrink,项目名称:libsigrok-mh,代码行数:57,代码来源:protocol.c


示例10: sighandler

/* #### sigcontext doesn't exist in Solaris.  This should be updated
   to be correct for Solaris. */
static SIGTYPE
sighandler (int sig)
{
  if (audio_fd > 0)
    {
      reset_device (0);
      close (audio_fd);
    }
  if (sig == SIGHUP && sighup_handler)
    sighup_handler (sig);
  else if (sig == SIGINT && sigint_handler)
    sigint_handler (sig);
  else
    exit (1);
}
开发者ID:boukeversteegh,项目名称:chise,代码行数:17,代码来源:sunplay.c


示例11: vhost_reset_owner

/*
 * Called from CUSE IOCTL: VHOST_RESET_OWNER
 */
int
vhost_reset_owner(struct vhost_device_ctx ctx)
{
	struct virtio_net *dev;

	dev = get_device(ctx);
	if (dev == NULL)
		return -1;

	if (dev->flags & VIRTIO_DEV_RUNNING)
		notify_ops->destroy_device(dev);

	cleanup_device(dev, 0);
	reset_device(dev);
	return 0;
}
开发者ID:RIFTIO,项目名称:dpdk,代码行数:19,代码来源:virtio-net.c


示例12: link_reset

int link_reset(link_phy_t handle){
	link_op_t op;
	link_debug(3, "try to reset--check bootloader\n");
	if( link_isbootloader(handle) ){
		//execute the request
		op.ioctl.cmd = LINK_CMD_IOCTL;
		op.ioctl.fildes = LINK_BOOTLOADER_FILDES;
		op.ioctl.request = I_BOOTLOADER_RESET;
		op.ioctl.arg = 0;
		link_protocol_masterwrite(handle, &op, sizeof(link_ioctl_t));
		link_phy_close(handle);
	} else {
		link_debug(3, "reset device with /dev/core\n");
		return reset_device(handle, false);
	}
	return 0;
}
开发者ID:GDXN,项目名称:CoActionOS-Public,代码行数:17,代码来源:link_bootloader.c


示例13: vhost_reset_owner

/*
 * Called from CUSE IOCTL: VHOST_RESET_OWNER
 */
int
vhost_reset_owner(int vid)
{
	struct virtio_net *dev;

	dev = get_device(vid);
	if (dev == NULL)
		return -1;

	if (dev->flags & VIRTIO_DEV_RUNNING) {
		dev->flags &= ~VIRTIO_DEV_RUNNING;
		notify_ops->destroy_device(vid);
	}

	cleanup_device(dev, 0);
	reset_device(dev);
	return 0;
}
开发者ID:ANLAB-KAIST,项目名称:dpdk,代码行数:21,代码来源:virtio-net.c


示例14: invoke_user_cmd

/*
 * Invoke user cmd
 *
 */
uint8_t invoke_user_cmd(const uint8_t * pData, const uint8_t len) {
    uint8_t user_cmd;

    user_cmd = nibble_to_bin(pData[0]);
    user_cmd <<= 4;
    user_cmd |= nibble_to_bin(pData[1]);

    DEBUG_PRINTF("user_cmd: 0x%2x\r\n", user_cmd);

    switch (user_cmd) {
        case CMD_RESET_DEVICE:
            reset_device();
            break;

        case CMD_GET_BL_VERS:
            serprintf(device_vers_tag);
            break;

        case CMD_UNLOCK_MCU:
            if (len == 10) {
                uint32_t unlock_code = 0;
                uint16_t idx = 2;

                while (idx < 10) {
                    unlock_code <<= 4;
                    unlock_code |= nibble_to_bin(pData[idx++]);
                    unlock_code <<= 4;
                    unlock_code |= nibble_to_bin(pData[idx++]);
                }

                clear_mcu_iap(unlock_code);
            }
            break;

        case CMD_DEBUG_ON:
            set_trace(get_trace() == 0 ? serprintf : 0);
            break;

        default:
            break;
    }

    return SDP_ACK_x06;
}
开发者ID:rupakd,项目名称:drift-sensor,代码行数:48,代码来源:sdp_handlers.c


示例15: pcm_in_cb

void pcm_in_cb(uint32_t opcode, uint32_t token,
		uint32_t *payload, void *priv)
{
	struct pcm *pcm = (struct pcm *) priv;
	unsigned long flags;

	spin_lock_irqsave(&pcm->dsp_lock, flags);
	switch (opcode) {
	case ASM_DATA_EVENT_READ_DONE:
		pcm_in_get_dsp_buffers(pcm, token, payload);
		break;
	case RESET_EVENTS:
		reset_device();
		break;
	default:
		break;
	}
	spin_unlock_irqrestore(&pcm->dsp_lock, flags);
}
开发者ID:1041574425,项目名称:Z5S_NX503A_KitKat_kernel,代码行数:19,代码来源:pcm_in.c


示例16: pre_render

    bool renderer::pre_render()
    {
        if (!resetter.ready() &&
            !reset_device(config))
        {
            return false;
        }

        pipeline.reset_view(0.0f, camera_height * camera_zoom, 400.0f * camera_zoom,
                            0.0f, 0.0, 0,
                            0, 1.0f, 0,
                            camera_rotation);

        scene.begin_frame();

        pipeline.reset_material(character_material);

        return true;
    }
开发者ID:dtbinh,项目名称:loci-extended,代码行数:19,代码来源:renderer.cpp


示例17: pcm_out_cb

void pcm_out_cb(uint32_t opcode, uint32_t token,
			uint32_t *payload, void *priv)
{
	struct pcm *pcm = (struct pcm *) priv;
	unsigned long flags;

	spin_lock_irqsave(&pcm->dsp_lock, flags);
	switch (opcode) {
	case ASM_DATA_EVENT_WRITE_DONE:
		atomic_inc(&pcm->out_count);
		wake_up(&pcm->write_wait);
		break;
	case RESET_EVENTS:
		reset_device();
		break;
	default:
		break;
	}
	spin_unlock_irqrestore(&pcm->dsp_lock, flags);
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:20,代码来源:pcm_out.c


示例18: m600_setup

void m600_setup(void)
{
  /* have to do configure the ports as digital
     io, otherwise they will be in analog mode
     esp. PORTA on my own pic18f...
   */

  ADCON0 = 0;
  ADCON1 = 0xf;
  ADCON2 = 0;

  SPPCON = 0;

  /* inputs */
  M600_TRIS_DATA_LOW = 1;
  M600_TRIS_DATA_HIGH = 1;
  M600_TRIS_ALARMS = 1;
  M600_TRIS_INDEX_MARK = 1;
  M600_TRIS_NOT_READY = 1;
  M600_TRIS_BUSY = 1;

  /* outputs */

  M600_TRIS_RESET_CMD = 0;
  M600_PIN_RESET_CMD = 1;

  /* note: must come after the
     alarm tris is set since this
     overlap with same register */

  M600_TRIS_PICK_CMD = 0;
  M600_PIN_PICK_CMD = 1;

  reset_device();

  /* automaton state */

  m600_request = M600_REQ_INVALID;
}
开发者ID:texane,项目名称:documation_m600,代码行数:39,代码来源:m600.c


示例19: connect_device

static int connect_device(const char *file)
{
    int result;

    fprintf(stdout, TTY_NONE "Connect \"%s\"...", file);

    if ((result = open_serial_port(file)))
        return result;

    if ((result = reset_device(1)))
        return result;

    if ((result = handshake_device()))
        return result;

    device_buffer[0] = 0x00;
    if ((result = device_request(1)))
        return result;

    if ((result = device_response(13)))
        return result;

    device_version = device_buffer[1];
    device_erase_command = device_buffer[8];
    fprintf(stdout, TTY_NONE "V%1X.%1X...", device_version >> 4, device_version & 0x0F);

    device_buffer[0] = 0x02;
    if ((result = device_request(1)))
        return result;

    if ((result = device_response(3)))
        return result;

    if ((result = select_device(device_buffer[1] << 8 | device_buffer[2])))
        return result;

    return DONE;
}
开发者ID:rksdna,项目名称:swamp-boot,代码行数:38,代码来源:main.c


示例20: reset_device

	void streambuf::device(io_device &d)
	{
		reset_device();
		device_ = &d;
	}
开发者ID:kienhdpr,项目名称:Talon,代码行数:5,代码来源:streambuf.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ reset_file_recovery函数代码示例发布时间:2022-05-30
下一篇:
C++ reset_cpu_stall_ticks函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap