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


C++ serial_getc函数代码示例

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


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

示例1: main

//__attribute__((naked)) //To avoid gcc from putting garbage before and after main function, especially with stuffs using stack...
int main(int argc, char **argv)
{
  serial_init();
  serial_puts("\r\n\r\nHello world!\n\r\n\rBrought to you by Florent Guignabert & Axel Schumacher\r\n\r\n");
  char c = serial_getc();
  while (c != 27 /*echap*/)
  {
    serial_putc(c);
    c = serial_getc();
  }
  serial_puts("\n\r");
  return EXIT_SUCCESS;
}
开发者ID:Rekamux,项目名称:Boot-Loader,代码行数:14,代码来源:helloWorld.c

示例2: console_wait_for_key

int
console_wait_for_key(void)
{
	union key key;
	key.ax = serial_getc(true);
	return key.code.ascii;
}
开发者ID:RTOSkit,项目名称:haiku,代码行数:7,代码来源:console.cpp

示例3: TaskStart

void TaskStart (void *data)
{
	unsigned char i;
	char key;
	data = data;                            /* Prevent compiler warning */
	
	JZ_StartTicker(OS_TICKS_PER_SEC);	/* os_cfg.h */
	printf("uC/OS-II, The Real-Time Kernel MIPS Ported version\n");
	printf("EXAMPLE #1 %s %s\n",__DATE__,__TIME__);
	while(0)
	{
		if(serial_tstc())
		{
			key = serial_getc();
			printf("you pressed: %c\n",key);
			if(key == 0x1B) 
			{        /* see if it's the ESCAPE key */
				printf(" Escape display of statistic\n");
				os_TaskDelete(TASK_START_PRIO);
			}
		}
		printf("time: %d\n",os_TimeGet());
		os_TimeDelayHMSM(0, 0, 1, 0);     /* Wait one second */
	}
	NandTest();
}
开发者ID:Stadtpirat,项目名称:open-p3go,代码行数:26,代码来源:main_16bit.c

示例4: do_ramdump

int do_ramdump(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{

	exynos_usbd_dn_addr = USBD_DOWN_ADDR;	/* Default Address */

	exynos_receive_done = 0;

	exynos_usbctl_init();
	exynos_usbc_activate();

	printf("Now, Waiting for USB RAMDUMP\n");

	while (1) {
		if (EXYNOS_USBD_DETECT_IRQ()) {
			exynos_udc_int_hndlr();
			EXYNOS_USBD_CLEAR_IRQ();
		}

		if (exynos_receive_done)
			break;

		if (serial_tstc()) {
			serial_getc();
			break;
		}
	}

	/* when operation is done, usbd must be stopped */
	exynos_usb_stop();

	printf("Finished RAMDUMP\n");

	return 0;
}
开发者ID:monojo,项目名称:xu3,代码行数:34,代码来源:cmd_usbd3.c

示例5: gets

void gets(char *s)
{
	char c;
	while((c = serial_getc()) != '\n')
		*s++ = c;
	*s = 0;
}
开发者ID:yumm007,项目名称:C,代码行数:7,代码来源:serial.c

示例6: getDebugChar

int getDebugChar(void)
{
	if (kgdb_debugport == 0)
		kgdb_debugport = serial_init(KGDB_PORT, NULL);

	return(serial_getc(kgdb_debugport));
}
开发者ID:sarnobat,项目名称:knoppix,代码行数:7,代码来源:gen550_kgdb.c

示例7: main

int main() {
	
	//initialize all necessary sensors and utilities
	lcd_init();
	timer1_init();
	timer3_init();
	move_servo(90);
 	ADC_init();
	USART_Init(MYUBRR);
	init_push_buttons();
	
	oi_t *sensor_data = oi_alloc();
	oi_init(sensor_data);
	
	audioInit(sensor_data);
	//oi_play_song(1);
	
	while(1) {
		//empty currentObjects before proceeding by setting all stored objects to "invalid" - ignored by later checks
		for (int i = 0; i < 20; i++) {
			currentObjects[i].isValid = 0;
		}
		char received = serial_getc(); //take keyboard input from putty
		takeDirectionInput(received, currentObjects); //translate keyboard input into functionality
	}
	
	return 0;
}
开发者ID:robideau,项目名称:Rover,代码行数:28,代码来源:Rover.c

示例8: main

int main(int argc)
{
	// Allocate memory and setup sensorData struct
	sensorData = oi_alloc();
	initAll(sensorData);


	serial_puts("Press 's' to initiate connection with robot\n\r");
	while(start != 's') // Wait for Start Command
	{
		start = serial_getc();
	}
	serial_puts("Robot communication initiated.\n\r\n\r");
	display_help();
	running_LED();
	while(1)
	{
		read_user_input_string(sensorData);
	}
	//START TRAVERSING CODE

	while("NOT DONE") //While the robot is not in the Final Zone
	{
		//TODO Interface and Movement
	}

	//TODO FLASH LEDS WHEN DONE


}
开发者ID:jwfehr,项目名称:Cyclone1,代码行数:30,代码来源:test.c

示例9: mdm_readline

/* 'inline' - We have to do it fast */
static inline void mdm_readline(char *buf, int bufsiz)
{
	char c;
	char *p;
	int n;

	n = 0;
	p = buf;
	for(;;) {
		c = serial_getc();

		/*		dbg("(%c)", c); */

		switch(c) {
		case '\r':
			break;
		case '\n':
			*p = '\0';
			return;

		default:
			if(n++ > bufsiz) {
				*p = '\0';
				return; /* sanity check */
			}
			*p = c;
			p++;
			break;
		}
	}
}
开发者ID:0s4l,项目名称:u-boot-xlnx,代码行数:32,代码来源:modem.c

示例10: serial_isr_func

static void serial_isr_func(int n)
{
	uint32_t c;
	
	c = serial_getc();
	mbox_post(&console_mbox, &c);
}
开发者ID:phuuix,项目名称:probability,代码行数:7,代码来源:console.c

示例11: do_pause

int do_pause (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
	int pause_time;
	unsigned int delay_time;
	int break_loop = 0;

	/* display value if no argument */
	if (argc < 2) {
		pause_time = 1;
	}

	else if (argc > 2) {
		printf ("Too many arguments\n");
		return -1;
	} else {
		pause_time = simple_strtoul (argv[1], NULL, 0);
	}

	printf ("Pausing with a poll time of %d, press any key to reactivate\n", pause_time);
	delay_time = pause_time * ONE_SECOND;
	while (break_loop == 0) {
		udelay (delay_time);
		if (serial_tstc () != 0) {
			break_loop = 1;
			/* eat user key presses */
			while (serial_tstc () != 0) {
				serial_getc ();
			}
		}
	}

	return 0;
}
开发者ID:cmp1084,项目名称:u-boot,代码行数:33,代码来源:ap1000.c

示例12: serial_init

/*
 *  * Initialise the serial port with the given baudrate. The settings
 *   * are always 8 data bits, no parity, 1 stop bit, no start bits.
 *    *
 *     */
int serial_init (void)
{
    SIO_Open(&gUart1Channel, 115200);
    /* clear input buffer */
    if(serial_tstc())
        serial_getc();
    return 0;
}
开发者ID:dhs-shine,项目名称:sprd_project,代码行数:13,代码来源:serial_sc8800x.c

示例13: jshIdle

void jshIdle() {
  /*static bool foo = false;
  foo = !foo;
  jshPinSetValue(LED1_PININDEX, foo);*/

  while (serial_readable(&mbedSerial[0])>0)
        jshPushIOCharEvent(EV_SERIAL1, serial_getc(&mbedSerial[0]));
}
开发者ID:vmcpherson,项目名称:Espruino,代码行数:8,代码来源:jshardware.cpp

示例14: spl_start_uboot

int spl_start_uboot(void)
{
	/* break into full u-boot on 'c' */
	if (serial_tstc() && serial_getc() == 'c')
		return 1;

	return 0;
}
开发者ID:CogSystems,项目名称:u-boot,代码行数:8,代码来源:spl.c

示例15: getc

int getc (void)
{
	if (gd->flags & GD_FLG_DEVINIT) {
		
		return fgetc (stdin);
	}

	return serial_getc ();
}
开发者ID:Joelone,项目名称:u-boot-omap4-optimus,代码行数:9,代码来源:console.c


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