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


C++ put_char函数代码示例

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


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

示例1: in_process

PUBLIC	void	in_process(TTY * p_tty,u32 key)
{
	//u8 out_buf[2] = {'\0','\0'};
	u32 raw_code;
	
	if(!(key & FLAG_EXT))
	{
		//out_buf[0] = key_code & 0xFF;
		put_char(p_tty,key);
	}
	else
	{
		raw_code = key & KEY_CODE_MASK;
		switch(raw_code)
		{
			case	F1:
			case	F2:
			case	F3:
				//disp_int(key);
				if((key & FLAG_LALT) || (key & FLAG_RALT))
				{
					switch_console((raw_code - F1) >> 16);
				}
				break;
			default:
				put_char(p_tty,raw_code);
		}
	}
开发者ID:defsky,项目名称:FunOS,代码行数:28,代码来源:keyboard.c

示例2: retry_transmit

static void retry_transmit(struct r3964_info *pInfo)
{
   if(pInfo->nRetry<R3964_MAX_RETRIES)
   {
      TRACE_PE("transmission failed. Retry #%d", 
             pInfo->nRetry);
      pInfo->bcc = 0;
      put_char(pInfo, STX);
      flush(pInfo);
      pInfo->state = R3964_TX_REQUEST;
      pInfo->count_down = R3964_TO_QVZ;
      pInfo->nRetry++;
   }
   else
   {
      TRACE_PE("transmission failed after %d retries", 
             R3964_MAX_RETRIES);

      remove_from_tx_queue(pInfo, R3964_TX_FAIL);
      
      put_char(pInfo, NAK);
      flush(pInfo);
      pInfo->state = R3964_IDLE;

      trigger_transmit(pInfo);
   }
}
开发者ID:archith,项目名称:camera_project,代码行数:27,代码来源:n_r3964.c

示例3: sys_handler

// system interrupt handler
extern void sys_handler(void) {
    unsigned st_status = AT91C_BASE_ST->ST_SR & AT91C_BASE_ST->ST_IMR;
    unsigned rtc_status = AT91C_BASE_RTC->RTC_SR & AT91C_BASE_RTC->RTC_IMR;
    unsigned dbgu_status = AT91C_BASE_DBGU->DBGU_CSR & AT91C_BASE_DBGU->DBGU_IMR;
    static unsigned char counter = '0';

    if (dbgu_status & AT91C_US_RXRDY) {
        // disable RXRDY interrupt in DBGU
        AT91C_BASE_DBGU->DBGU_IDR |= AT91C_US_RXRDY;
        // disable rtt interrupt flag
        AT91C_BASE_ST->ST_IDR = AT91C_ST_RTTINC;
        if (wait_status == 1) {
            wait_status = 0;
        }
        else {
            transfer_size = dbgu_xmod_recv((void *)LINUX_BASE_ADDRESS);
            run_kernel();
        }
    }

    // handler of rtt - rttinc
    if (st_status & AT91C_ST_RTTINC) {
        AT91C_BASE_PIOB->PIO_ODSR ^= AT91C_PIO_PB27;
        if (wait_status == 1) {
            put_char(counter);
            counter++;
            if (counter == '6')
                run_kernel();
            put_char(' ');
        }
        else
            put_char('C');
    }
}
开发者ID:no111u3,项目名称:arm_my_learn,代码行数:35,代码来源:main.c

示例4: while

/**
 * Construct the "pretty-printed" representation of the name in a short directory entry.
 *
 * @param[in]    fixed  Pointer to name[0] of a DIR_ENT
 *
 * @return  Pointer to static string containing pretty "8.3" equivalent of the
 *          name in the directory entry.
 */
char *file_name(unsigned char *fixed)
{
    static char path[MSDOS_NAME * 4 + 2];
    char *p;
    int i, j;

    p = path;
    for (i = j = 0; i < 8; i++)
	if (fixed[i] != ' ') {
	    while (j++ < i)
		*p++ = ' ';
	    put_char(&p, fixed[i]);
	}
    if (strncmp((const char *)(fixed + 8), "   ", 3)) {
	*p++ = '.';
	for (i = j = 0; i < 3; i++)
	    if (fixed[i + 8] != ' ') {
		while (j++ < i)
		    *p++ = ' ';
		put_char(&p, fixed[i + 8]);
	    }
    }
    *p = 0;
    return path;
}
开发者ID:XperiaMultiROM,项目名称:android_bootable_recovery,代码行数:33,代码来源:file.c

示例5: main

int main(void)
{
	char c;
	int term[2], result;
	unsigned int current_term;

	lcd_init();
	keymatrix_init();

	while (1) {
		put_char('>');
		term[0] = 0;
		term[1] = 0;
		current_term = 0;
		while (1) {
			c = get_char();
			put_char(c);
			if ('0' <= c && c <= '9') {
				term[current_term] = (term[current_term] * 10) + (c - '0');
			} else if (c == '*') {
				current_term++;
			} else if (c == '\n') {
				result = term[0] * term[1];
				put_dec(result);
				get_char();	/* 演算結果表示後、何らかのキー入力を待つ */
				break;
			}
		}
		put_char('\n');
	}

	return 0;
}
开发者ID:cupnes,项目名称:avr_pocket_computer,代码行数:33,代码来源:main.c

示例6: print_simple_condition

void print_simple_condition (STREAM stream, D instance, BOOL escape_p, int print_depth) {
  D format_string = dylan_simple_condition_format_string(instance);
  D format_args = dylan_simple_condition_format_args(instance);
  ignore(print_depth);
  if (escape_p) put_char('"', stream);
  dylan_format(stream, format_string, format_args);
  if (escape_p) put_char('"', stream);
}
开发者ID:h2oota,项目名称:opendylan,代码行数:8,代码来源:debug-print.c

示例7: _arch_debug_serial_putchar

static void
_arch_debug_serial_putchar(const char c)
{
    if (c == '\n') {
        put_char('\r');
        put_char('\n');
    } else if (c != '\r')
        put_char(c);
}
开发者ID:nielx,项目名称:haiku-serviceskit,代码行数:9,代码来源:arch_debug_console.cpp

示例8: do_filter

 void do_filter()
 {
     int c;
     while ((c = std::cin.get()) != EOF) {
         if (c != '\n' && col_no_ >= line_length_)
             put_char('\n');
         put_char(c);
     }
 }
开发者ID:EricAlex,项目名称:PDAL,代码行数:9,代码来源:line_wrapping_filter.hpp

示例9: echo_char

static void echo_char(unsigned char c, struct tty_struct *tty)
{
	if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t') {
		put_char('^', tty);
		put_char(c ^ 0100, tty);
		tty->column += 2;
	} else
		opost(c, tty);
}
开发者ID:benbee,项目名称:Learning,代码行数:9,代码来源:n_tty.c

示例10: process_command

void process_command() {
  int command_ptr  = 0;

  initialize_array(command, 80, 0);
  copy_string(command, buffer + C(current_line, 2));
  initialize_array(argument, ARGUMENT_HEAP_SIZE, 0);

  send_rs(command, 10);
  next_line();

  if (str_equal(c_exit, command, 4)) {
    put_char('b');
    put_char('y');
    put_char('e');
    send_display(buffer);
    halt();

  } else if (str_equal(c_cd, command, 3)) {
    int length = copy_string(argument, command + 3);
    change_directory(argument, length);

  } else if (command[0] == 0) {
    return;

  } else {
    int ptr = 0;
    while (command[command_ptr] != ' '
           && command[command_ptr] != 0
           && command_ptr < COLS) {
      int byte = command[command_ptr];
      if (byte >= 'a' && byte <= 'z') {
        byte -= 0x20;
      }
      program_name[ptr] = byte;
      command_ptr += 1;
      ptr += 1;
    }
    program_name[ptr] = 0;

    while (command[command_ptr] == ' ' && command_ptr < COLS) {
      command_ptr += 1;
    }

    ptr = 0;
    while (command[command_ptr] != ' '
           && command[command_ptr] != 0
           && command_ptr < COLS) {
      argument[ptr] = command[command_ptr];
      command_ptr += 1;
      ptr += 1;
    }
    argument[ptr] = 0;
    argument[ARGUMENT_HEAP_SIZE-1] = current_directory_id;
    execute_bin(program_name, argument);
  }
}
开发者ID:tomykaira,项目名称:mips,代码行数:56,代码来源:okarin.c

示例11: put_uint64

void put_uint64(uint64_t i)
{
  char str[32];
  int n = 0;
  while (i > 0) { str[n] = '0' + (i % 10); i /= 10; n++; }
  if (n == 0)
    put_char('0');
  else
    while (n > 0) { n--; put_char(str[n]); }
}
开发者ID:CTSRD-CHERI,项目名称:CHERI-Litmus,代码行数:10,代码来源:io.c

示例12: console_write

acoral_32 console_write(void *data,acoral_u32 size,acoral_time tm_out){
	acoral_u32 i;
  	char p;
	for(i=0;i<size;i++){
		p=*((acoral_char *)data+i);
		if(p=='\n')
			put_char('\r');
		put_char(p);
	}
}
开发者ID:ChenZewei,项目名称:acoral,代码行数:10,代码来源:console.c

示例13: put_short

Boolean
CDR::put_bytes (const Short len, const Ptr data)
{
    Char *tmp = (Char *)data;
    int i;
    put_short (len + 1);
    for (i = 0; i < len; i++)
      put_char (*tmp++);
    put_char ((Char) 0);
    return CDR_TRUE;
}
开发者ID:ForNeVeR,项目名称:interclient,代码行数:11,代码来源:CDR.cpp

示例14: main

void main(void) {
  uart_init();
  led_init();
  put_string("boot\r\n");
  while (1) {
    led_toggle();
    char c = get_char();
    put_char(c);
    if (c == '\r')
      put_char('\n');
  }
}
开发者ID:westrup,项目名称:stm32,代码行数:12,代码来源:main.c

示例15: do_filter

 void do_filter()
 {
     int c;
     while ((c = std::cin.get()) != EOF) {
         if (c == '\t') {
             int spaces = tab_size_ - (col_no_ % tab_size_);
             for (; spaces > 0; --spaces)
                 put_char(' ');
         } else {
             put_char(c);
         }
     }
 }
开发者ID:AsherBond,项目名称:PDAL,代码行数:13,代码来源:tab_expanding_filter.hpp


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