当前位置: 首页>>代码示例>>C++>>正文


C++ serial_printf函数代码示例

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


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

示例1: musb_peri_ep0_stall

static void musb_peri_ep0_stall(void)
{
	u16 csr0;

	csr0 = readw(&musbr->ep[0].ep0.csr0);
	csr0 |= MUSB_CSR0_P_SENDSTALL;
	writew(csr0, &musbr->ep[0].ep0.csr0);
	if ((debug_setup) && (debug_level > 1))
		serial_printf("INFO : %s stall\n", __PRETTY_FUNCTION__);
}
开发者ID:AeroGirl,项目名称:u-boot-kern3.2,代码行数:10,代码来源:musb_udc.c

示例2: cmd_tasks

void cmd_tasks(SerialDevice *io, int argc, char *argv[])
{
    serial_printf(io, "name: priority, mode, stack: used/size\r\n");
    serial_printf(io, "static tasks:\r\n");
    // static tasks
    Task_Object *task;
    int i;
    for (i = 0; i < Task_Object_count(); i++) {
        task = Task_Object_get(NULL, i);
        task_print(io, task);
    }
    // dymanmically allocated tasks
    serial_printf(io, "dynamic tasks:\r\n");
    task = Task_Object_first();
    while (task) {
        task_print(io, task);
        task = Task_Object_next(task);
    }
}
开发者ID:Octanis1,项目名称:Octanis1-Mainboard-Firmware_MSP_EXP432P401RLP,代码行数:19,代码来源:cli.c

示例3: sim800_send_http

void sim800_send_http(char * tx_buffer, int tx_size, SIM800_MIME mime_type){
	if(!sim800_initialised){
		serial_printf(cli_stdout, "sim800 not initialised",0);
	}else{
		sim800_locked = 1;
		sim800_init_http(mime_type);
		sim800_buffermessage_http(tx_buffer, tx_size);
		sim800_locked = 0;
	}
}
开发者ID:Octanis1,项目名称:Octanis1-Mainboard-Firmware_MSP_EXP432P401RLP,代码行数:10,代码来源:sim800.c

示例4: debug_urb_buffer

static void debug_urb_buffer(char *prefix, struct usb_endpoint_instance *ep)
{
#ifdef DEBUG
	int num;
	static char buf[128];

	if (!ep->tx_urb) {
		serial_printf("no tx_urb\n");
		return;
	}

	num = MIN(ep->tx_urb->actual_length - ep->sent, ep->tx_packetSize);

	memset(buf, 0, sizeof(buf));
	strncpy(buf, ep->tx_urb->buffer + ep->sent, num);

	serial_printf("%s(%d:%s)\n", prefix, num, buf);
#endif
}
开发者ID:feedcafe,项目名称:u-boot-2010.09,代码行数:19,代码来源:s3c2410_udc.c

示例5: udc_endpoint_write

int udc_endpoint_write(struct usb_endpoint_instance *endpoint)
{
	int ret = 0;

	/* Transmit only if the hardware is available */
	if (endpoint->tx_urb && endpoint->state == 0) {
		unsigned int ep = endpoint->endpoint_address &
			USB_ENDPOINT_NUMBER_MASK;

		u16 peri_txcsr = readw(&musbr->ep[ep].epN.txcsr);

		/* Error conditions */
		if (peri_txcsr & MUSB_TXCSR_P_UNDERRUN) {
			peri_txcsr &= ~MUSB_TXCSR_P_UNDERRUN;
			writew(peri_txcsr, &musbr->ep[ep].epN.txcsr);
		}

		if (debug_level > 1)
			musb_print_txcsr(peri_txcsr);

		/* Check if a packet is waiting to be sent */
		if (!(peri_txcsr & MUSB_TXCSR_TXPKTRDY)) {
			u32 length;
			u8 *data;
			struct urb *urb = endpoint->tx_urb;
			unsigned int remaining_packet = urb->actual_length -
				endpoint->sent;

			if (endpoint->tx_packetSize < remaining_packet)
				length = endpoint->tx_packetSize;
			else
				length = remaining_packet;

			data = (u8 *) urb->buffer;
			data += endpoint->sent;

			/* common musb fifo function */
			write_fifo(ep, length, data);

			musb_peri_tx_ready(ep);

			endpoint->last = length;
			/* usbd_tx_complete will take care of updating 'sent' */
			usbd_tx_complete(endpoint);
		}
	} else {
		if (debug_level > 0)
			serial_printf("ERROR : %s Problem with urb %p "
				      "or ep state %d\n",
				      __PRETTY_FUNCTION__,
				      endpoint->tx_urb, endpoint->state);
	}

	return ret;
}
开发者ID:0xFelix,项目名称:u-boot-edminiv2,代码行数:55,代码来源:musb_udc.c

示例6: serial_print_header

void serial_print_header(char *board,char *cpu_revision)
{
	for(int i = 0; i < 8; i++)
		serial_printf("----------");
	serial_printf("\n");
	serial_printf("Beryllium %s - version %s (from %s)\n",BERYLLIUM_RELEASE,BERYLLIUM_VERSION,BERYLLIUM_SOURCE);
	serial_printf("Output Device: Serial\n");
	serial_printf("Architecture: %s (%s)\n",ARCH_STRING,board);
	serial_printf("Processor: %s\n",cpu_revision);
	for(int i = 0; i < 8; i++)
		serial_printf("----------");
	serial_printf("\n");
}
开发者ID:Lionel07,项目名称:Beryllium,代码行数:13,代码来源:common.c

示例7: vmmngr_create_address_space

pdirectory* vmmngr_create_address_space()
{
	pdirectory* dir = (pdirectory*)pmmngr_alloc_block();
	if (!dir)
		return 0;

	serial_printf("creating addr space at: %h\n", dir);

	memset(dir, 0, sizeof(pdirectory));
	return dir;
}
开发者ID:megis7,项目名称:Me-Operating-System,代码行数:11,代码来源:mmngr_virtual.cpp

示例8: setup

irom void setup()
{
	serial_begin(115200);

	//disable the wifi
	wifi_set_opmode(NULL_MODE);

	pinMode(ledPower,OUTPUT);
	digitalWrite(ledPower,HIGH);
	serial_printf("Sharp GP2Y1010AU0F Particle Sensor Example\r\n");
}
开发者ID:icamgo,项目名称:noduino-sdk,代码行数:11,代码来源:main.c

示例9: serial_print_header

void serial_print_header(char *board,char *cpu_revision)
{
	for(int i = 0; i < 8; i++)
		serial_printf("----------");
	serial_printf("\n");
	serial_printf("Beryllium2 Kernel Version %s-%s:%s %s\n",SYSTEM_VERSION,SYSTEM_RELEASE,__DATE__,__TIME__);
	serial_printf("Output Device: Serial\n");
	serial_printf("Architecture: %s (%s)\n",ARCH_STRING,board);
	serial_printf("Processor: %s\n",cpu_revision);
	for(int i = 0; i < 8; i++)
		serial_printf("----------");
	serial_printf("\n");
}
开发者ID:Lionel07,项目名称:Beryllium2,代码行数:13,代码来源:common.c

示例10: vfs_run_tests

Uint32 vfs_run_tests()
{
    serial_string( "running VFS tests\n\r" );
    Uint32 test_failures = 0;
    test_failures += test_raw_read();

    serial_printf("==> VFS tests completed, %d failures.\n\r",
                  test_failures );

    return test_failures;
}
开发者ID:caltry,项目名称:Bikeshed,代码行数:11,代码来源:test_vfs.c

示例11: navigation_task

void navigation_task()
{
	bool logging_enabled = false;
	navigation_init();

#ifdef FLASH_ENABLED
	if (flash_init() == 0) {
		logging_enabled = true;
	}

    if (logging_enabled) {
        if (!log_init()) {
            serial_printf(cli_stdout, "log_init failed\n");
            log_reset();
        }
    }

    //We look if we have mavlink mission item logged, in case we just suffered a crash

    uint32_t time = 0;
    char name[4]; //Name is a 3 characters long string
    mission_item_list_t item_list;
    if(log_read_mavlink_item_list(&item_list, &time, &name, &pos_counter))
    	navigation_restore_mission_items(item_list);

#endif

    unsigned int loops_since_stop = 0;
	while(1){

//		navigation_update_target();
		navigation_update_current_target();
		navigation_update_position();
		navigation_update_state();
		navigation_arm_disarm();
		navigation_move();

		if(navigation_rover_moving() || loops_since_stop < 62) // trasmit messages after stop for a duration such that
																//at least one msg with speed zero is tx'd via LoRa
		{
			comm_mavlink_broadcast(navigation_pack_mavlink_hud());
			comm_mavlink_broadcast(navigation_pack_rc_channels_scaled());
		}

		if(!navigation_rover_moving())
			loops_since_stop++;
		else
			loops_since_stop = 0;


		Task_sleep(500);

	}
}
开发者ID:Octanis1,项目名称:Octanis1-Mainboard-Firmware_MSP_EXP432P401RLP,代码行数:54,代码来源:navigation.c

示例12: _show_msgQ_info

static OS_STATUS _show_msgQ_info (MSG_QUE *pMsgQ, int unused)
{
    serial_printf("ID: %8X  cur_num: %3d  max_num: %3d  wait_send_task: %d wait_recv_task: %d\n",
                  pMsgQ,
                  pMsgQ->cur_num,
                  pMsgQ->max_num,
                  dlist_count (&pMsgQ->wait_send_list),
                  dlist_count (&pMsgQ->wait_recv_list)
                 );
    return OS_STATUS_OK;
}
开发者ID:WangDongfang,项目名称:DfewOS,代码行数:11,代码来源:msgQ.c

示例13: musb_peri_ep0_set_address

static void musb_peri_ep0_set_address(void)
{
	u8 faddr;
	writeb(udc_device->address, &musbr->faddr);

	/* Verify */
	faddr = readb(&musbr->faddr);
	if (udc_device->address == faddr) {
		SET_EP0_STATE(IDLE);
		usbd_device_event_irq(udc_device, DEVICE_ADDRESS_ASSIGNED, 0);
		if ((debug_setup) && (debug_level > 1))
			serial_printf("INFO : %s Address set to %d\n",
				      __PRETTY_FUNCTION__, udc_device->address);
	} else {
		if (debug_level > 0)
			serial_printf("ERROR : %s Address missmatch "
				      "sw %d vs hw %d\n",
				      __PRETTY_FUNCTION__,
				      udc_device->address, faddr);
	}
}
开发者ID:0xFelix,项目名称:u-boot-edminiv2,代码行数:21,代码来源:musb_udc.c

示例14: musb_peri_softconnect

static void musb_peri_softconnect(void)
{
    u8 power, devctl;
    u8 intrusb;
    u16 intrrx, intrtx;

    /* Power off MUSB */
    power = readb(&musbr->power);
    power &= ~MUSB_POWER_SOFTCONN;
    writeb(power, &musbr->power);

    /* Read intr to clear */
    intrusb = readb(&musbr->intrusb);
    intrrx = readw(&musbr->intrrx);
    intrtx = readw(&musbr->intrtx);

    udelay(1000 * 1000); /* 1 sec */

    /* Power on MUSB */
    power = readb(&musbr->power);
    power |= MUSB_POWER_SOFTCONN;
    /*
     * The usb device interface is usb 1.1
     * Disable 2.0 high speed by clearring the hsenable bit.
     */
    power &= ~MUSB_POWER_HSENAB;
    writeb(power, &musbr->power);

    /* Check if device is in b-peripheral mode */
    devctl = readb(&musbr->devctl);
    if (!(devctl & MUSB_DEVCTL_BDEVICE) ||
            (devctl & MUSB_DEVCTL_HM)) {
        serial_printf("ERROR : Unsupport USB mode\n");
        serial_printf("Check that mini-B USB cable is attached "
                      "to the device\n");
    }

    if (debug_setup && (debug_level > 1))
        musb_db_regs();
}
开发者ID:patelhardik,项目名称:asp-u-boot,代码行数:40,代码来源:musb_udc.c

示例15: musb_peri_ep0_tx

static void musb_peri_ep0_tx(void)
{
	u16 csr0;
	int transfer_size = 0;
	unsigned int p, pm;

	csr0 = readw(&musbr->ep[0].ep0.csr0);

	/* Check for pending tx */
	if (csr0 & MUSB_CSR0_TXPKTRDY)
		goto end;

	/* Check if this is the last packet sent */
	if (ep0_endpoint->sent >= ep0_urb->actual_length) {
		SET_EP0_STATE(IDLE);
		goto end;
	}

	transfer_size = ep0_urb->actual_length - ep0_endpoint->sent;
	/* Is the transfer size negative ? */
	if (transfer_size <= 0) {
		if (debug_level > 0)
			serial_printf("ERROR : %s problem with the"
				      " transfer size %d\n",
				      __PRETTY_FUNCTION__,
				      transfer_size);
		SET_EP0_STATE(IDLE);
		goto end;
	}

	/* Truncate large transfers to the fifo size */
	if (transfer_size > ep0_endpoint->tx_packetSize)
		transfer_size = ep0_endpoint->tx_packetSize;

	write_fifo(0, transfer_size, &ep0_urb->buffer[ep0_endpoint->sent]);
	ep0_endpoint->sent += transfer_size;

	/* Done or more to send ? */
	if (ep0_endpoint->sent >= ep0_urb->actual_length)
		musb_ep0_tx_ready_and_last();
	else
		musb_ep0_tx_ready();
	
	/* Wait a bit */
	musb_peri_wait_tx_done(0);

	if ((ep0_endpoint->sent >= ep0_urb->actual_length) && (p < pm))
		SET_EP0_STATE(IDLE);

end:
	return;
}
开发者ID:MeiDahua,项目名称:uboot-tuna,代码行数:52,代码来源:musb_udc.c


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