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

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

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

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

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

示例1: bench_main

int bench_main(int argc, char *argv[]){     double tmin = 0.0;     double tol;     int repeat = 0;     int rounds = 10;     int iarounds = 0;     int arounds = 1; /* this is too low for precise results */     int c;     report = report_verbose; /* default */     verbose = 0;     tol = SINGLE_PRECISION ? 1.0e-3 : (QUAD_PRECISION ? 1e-29 : 1.0e-10);     main_init(&argc, &argv);     bench_srand(1);     while ((c = my_getopt (argc, argv, options)) != -1) {	  switch (c) {	      case 't' :		   tmin = strtod(my_optarg, 0);		   break;	      case 'r':		   repeat = atoi(my_optarg);		   break;	      case 's':		   timer_init(tmin, repeat);		   speed(my_optarg, 0);		   break;	      case 'S':		   timer_init(tmin, repeat);		   speed(my_optarg, 1);		   break;	      case 'd':		   report_can_do(my_optarg);		   break;	      case 'o':		   useropt(my_optarg);		   break;	      case 'v':		   if (verbose >= 0) { /* verbose < 0 disables output */			if (my_optarg)			     verbose = atoi(my_optarg);			else			     ++verbose;		   }		   break;	      case 'y':		   verify(my_optarg, rounds, tol);		   break;	      case 'a':		   accuracy(my_optarg, arounds, iarounds);		   break;	      case 'i':		   report_info(my_optarg);		   break;	      case 'I':		   report_info_all();		   break;	      case 'h':		   if (verbose >= 0) my_usage(argv[0], options);		   break;	      case 300: /* --report-mflops */		   report = report_mflops;		   break;	      case 310: /* --report-time */		   report = report_time;		   break; 	      case 320: /* --report-benchmark */		   report = report_benchmark;		   break; 	      case 330: /* --report-verbose */		   report = report_verbose;		   break;	      case 400: /* --print-time-min */		   timer_init(tmin, repeat);		   ovtpvt("%g/n", time_min);		   break;	      case 401: /* --verify-rounds */		   rounds = atoi(my_optarg);		   break;	      case 402: /* --print-precision */		   if (SINGLE_PRECISION)			ovtpvt("single/n");		   else if (QUAD_PRECISION)			ovtpvt("quad/n");		   else if (LDOUBLE_PRECISION)			ovtpvt("long-double/n");		   else if (DOUBLE_PRECISION)			ovtpvt("double/n");		   else //.........这里部分代码省略.........
开发者ID:376473984,项目名称:fftw3,代码行数:101,


示例2: main

void main(void){	u32 rootfs;	char *rfs_txt;	u32 image = 0;	struct jffs2_raw_inode *node, *mfg_node;	char *cmdline = 0, *altcmdline = 0;	u32 kernel_nand_addr = 0, alt_kernel_nand_addr = 0;	int board_id;	int done = 0;	u32 ret = 0;#ifdef CPU_LF1000	/* disable the USB controller */	BIT_SET(REG16(LF1000_UDC_BASE+UDC_PCR), PCE);#endif	adc_init();	board_id = load_board_id();	display_backlight(board_id);	clock_init();	db_init();	display_init();	fbcon_init();	db_displaytee(1);		db_puts("************************************************/n");	db_puts("*                                              */n");	db_puts("* OpenDidj lightning-boot 1.1  /  12 Mar 2010  */n");	db_puts("*                                              */n");	db_puts("************************************************/n");	db_puts("/n/n");	#ifdef CONFIG_MACH_LF_LF1000	/* now that backlight is on, see if we have enough battery to boot */	if(gpio_get_val(LOW_BATT_PORT, LOW_BATT_PIN) == 0 && 		ADC_TO_MV(adc_get_reading(LF1000_ADC_VBATSENSE)) < BOOT_MIN_MV){		db_puts("PANIC: battery voltage too low!/n");		die();	}#endif /* CONFIG_MACH_LF_LF1000 */#ifdef UBOOT_SUPPORT	if(((REG32(LF1000_GPIO_BASE+GPIOCPAD) & BUTTON_MSK) == BUTTON_MSK)) {		do {			db_puts("xmodem download mode/n");			timer_init();			offset = 0;			xmodemInit(db_putchar,db_getc_async);			tmr_poll_start(2000);			db_puts("Switch to 115200 baud and press any button/n");			db_puts("to start XModem download.../n");	/* set the baud rate */#define UART16(r)       REG16(LF1000_SYS_UART_BASE+r)	UART16(BRD) = 1; /* FIXME (for now "1"  sets 115200 baud , "11" sets 19200 baud) */	UART16(UARTCLKGEN) = ((UARTDIV-1)<<UARTCLKDIV)|(UART_PLL<<UARTCLKSRCSEL);			if(tfs_load_summary(sum_buffer, BOOT0_ADDR) != 0) {				db_puts("trying BOOT1/n");				if(tfs_load_summary(sum_buffer, BOOT1_ADDR)) {					db_puts("u-boot not found/n");					break;				}			}			while (!done)			{							if (tmr_poll_has_expired()){					if(((REG32(LF1000_GPIO_BASE+GPIOCPAD) & BUTTON_MSK) != BUTTON_MSK)) 					{						db_displaytee(0);						ret = xmodemReceive(ubcopy);						db_displaytee(1);						if ( ret >= 0 ) break;					}					if (ret == -1) 					db_puts("XMODEM_ERROR : REMOTECANCEL/n");										if (ret == -2)					db_puts("XMODEM_ERROR : OUTOFSYNC/n");										if (ret == -3)					db_puts("XMODEM_ERROR : RETRYEXCEED/n");					if ( ret < 0 ) continue;						/*							db_puts("Loaded : ");					db_int(ret);					db_puts("bytes/n");					*/					}			}						db_puts("/n/nXModem download complete./n");			db_puts("Transferring control to U-Boot./n");					/* jump to u-boot */			((void (*)( int r0, int r1, int r2))UBOOT_ADDR) 				(0, MACH_TYPE_LF1000, 0);						/* never get here! */			die();		} while(0);//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:opendidj,代码行数:101,


示例3: HariMain

void HariMain(void){  int i;  struct BOOTINFO *binfo = (struct BOOTINFO *)0x0ff0;  int xsize = (*binfo).scrnx;  int ysize = (*binfo).scrny;  char *vram = (*binfo).vram;  char msg[40], mcursor[256];  int mx = xsize/2;  int my = ysize/2;  int fifobuf[128];  struct MOUSE_DEC mdec;  unsigned char s[32];  unsigned int memtotal, count = 0;  struct MEMMAN *memman = (struct MEMMAN *)MEMMAN_ADDR;  int cursor_x, cursor_c;    struct SHTCTL *shtctl;  struct SHEET *sht_back, *sht_mouse, *sht_win;  unsigned char *buf_back, buf_mouse[256], *buf_win;  struct TIMER *timer1, *timer2, *timer3;  struct FIFO32 fifo;  static char keytable[0x54] = {    0,   0,   '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '^', 0,   0,    'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '@', '[', 0,   0,   'A', 'S',    'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', ':', 0,   0,   ']', 'Z', 'X', 'C', 'V',    'B', 'N', 'M', ',', '.', '/', 0,   '*', 0,   ' ', 0,   0,   0,   0,   0,   0,    0,   0,   0,   0,   0,   0,   0,   '7', '8', '9', '-', '4', '5', '6', '+', '1',    '2', '3', '0', '.'  };  init_gdtidt ();  init_pic ();  io_sti ();  fifo32_init(&fifo, 32, fifobuf);  init_pit();  io_out8(PIC0_IMR, 0xf8); /* Allow PIT and Keyboard (11111000) */  io_out8(PIC1_IMR, 0xef); /* Allow Mouse (11101111) */  init_keyboard (&fifo, 256);  enable_mouse (&fifo, 512, &mdec);  timer1 = timer_alloc();  timer_init(timer1, &fifo, 10);  timer_settime(timer1, 1000);  timer2 = timer_alloc();  timer_init(timer2, &fifo, 3);  timer_settime(timer2, 300);  timer3 = timer_alloc();  timer_init(timer3, &fifo, 1);  timer_settime(timer3, 50);    memtotal = memtest(0x00400000, 0xbfffffff);  memman_init (memman);  memman_free (memman, 0x00001000, 0x009e000);   /* 0x00001000 - 0x0009efff */  memman_free (memman, 0x00400000, memtotal - 0x00400000);  init_pallete();  shtctl = shtctl_init (memman, binfo->vram, binfo->scrnx, binfo->scrny);  sht_back  = sheet_alloc(shtctl);  sht_mouse = sheet_alloc(shtctl);  sht_win   = sheet_alloc(shtctl);  buf_back = (unsigned char *)memman_alloc_4k (memman, binfo->scrnx * binfo->scrny);  buf_win  = (unsigned char *)memman_alloc_4k (memman, 160 * 52);  sheet_setbuf (sht_back,  buf_back, binfo->scrnx, binfo->scrny, -1);  sheet_setbuf (sht_mouse, buf_mouse, 16, 16, 99);  sheet_setbuf (sht_win,   buf_win,   160, 52, -1);  init_screen (buf_back, xsize, ysize);  init_mouse_cursor8 (buf_mouse, 99);  make_window8(buf_win, 160, 52, "counter");    sprintf (s, "(%d, %d)", mx, my);  putfonts8_asc (buf_back, binfo->scrnx, 0, 0, COL8_FFFFFF, s);  sprintf (s, "Memory %dMB, free : %dKB",            memtotal / (1024 * 1024), memman_total(memman) / 1024);  putfonts8_asc(buf_back, binfo->scrnx, 0, 32, COL8_FFFFFF, s);  make_textbox8 (sht_win, 8, 28, 144, 16, COL8_FFFFFF);  cursor_x = 8;  cursor_c = COL8_FFFFFF;    sheet_slide (sht_back,  0, 0);  sheet_slide (sht_mouse, mx, my);  sheet_slide (sht_win,   80, 72);  sheet_updown (sht_back,  0);  sheet_updown (sht_win,   1);  sheet_updown (sht_mouse, 2);  sheet_refresh (sht_back, 0, 0, binfo->scrnx, 48);  //=====================  // Task Settings  //=====================    struct TSS32 tas_a, tas_b;//.........这里部分代码省略.........
开发者ID:msyksphinz,项目名称:sicp_exercise,代码行数:101,


示例4: main

int main(int argc,char *argv[]){   vm_instance_t *vm;#ifdef PROFILE   atexit(profiler_savestat);#endif   printf("Cisco Router Simulation Platform (version %s)/n",sw_version);   printf("Copyright (c) 2005-2007 Christophe Fillot./n");   printf("Build date: %s %s/n/n",__DATE__,__TIME__);   /* Register platforms */   register_default_platforms();   /* Initialize timers */   timer_init();   /* Initialize object registry */   registry_init();      /* Initialize ATM module (for HEC checksums) */   atm_init();   /* Initialize CRC functions */   crc_init();   /* Initialize NetIO code */   netio_rxl_init();   /* Initialize NetIO packet filters */   netio_filter_load_all();   /* Initialize VTTY code */   vtty_init();      /* Parse standard command line */   if (!run_hypervisor(argc,argv))      parse_std_cmd_line(argc,argv);   /* Create general log file */   create_log_file();   /* Periodic tasks initialization */   if (ptask_init(0) == -1)      exit(EXIT_FAILURE);   /* Create instruction lookup tables */   mips64_jit_create_ilt();   mips64_exec_create_ilt();   ppc32_jit_create_ilt();   ppc32_exec_create_ilt();      setup_signals();   if (!hypervisor_mode) {      /* Initialize the default instance */      vm = vm_acquire("default");      assert(vm != NULL);      if (vm->platform->init_instance(vm) == -1) {         fprintf(stderr,"Unable to initialize router instance./n");         exit(EXIT_FAILURE);      }      /* Start GDB server before the image to allow debugging from         the begining of it's execution */       if (vm->gdb_server_running)      {        /* Stop main CPU */        vm_suspend(vm);//         cpu_stop(vm->boot_cpu);              if (gdb_server_start_listener(vm) < 0) {            fprintf(stderr,"GDB server unable to create TCP sockets./n");            exit(EXIT_FAILURE);        }      }#if (DEBUG_INSN_PERF_CNT > 0) || (DEBUG_BLOCK_PERF_CNT > 0)      {         m_uint32_t counter,prev = 0,delta;         while(vm->status == VM_STATUS_RUNNING) {            counter = cpu_get_perf_counter(vm->boot_cpu);            delta = counter - prev;            prev = counter;            printf("delta = %u/n",delta);            sleep(1);         }      }#else      /* Start instance monitoring */      vm_monitor(vm);#endif      // FIXME: remove this kludge      if (vm->gdb_server_running)      {         //while (vm->gdb_conn->active)         //   usleep(1000000);//.........这里部分代码省略.........
开发者ID:Groundworkstech,项目名称:dynamips-gdb-mod,代码行数:101,


示例5: HariMain

void HariMain(void){	struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO;	struct SHTCTL *shtctl;	char s[40];	struct FIFO32 fifo, keycmd;	int fifobuf[128], keycmd_buf[32];	int mx, my, i, cursor_x, cursor_c;	unsigned int memtotal;	struct MOUSE_DEC mdec;	struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;	unsigned char *buf_back, buf_mouse[256], *buf_win, *buf_cons;	struct SHEET *sht_back, *sht_mouse, *sht_win, *sht_cons;	struct TASK *task_a, *task_cons;	struct TIMER *timer;	static char keytable0[0x80] = {		0,   0,   '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '^', 0,   0,		'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '@', '[', 0,   0,   'A', 'S',		'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', ':', 0,   0,   ']', 'Z', 'X', 'C', 'V',		'B', 'N', 'M', ',', '.', '/', 0,   '*', 0,   ' ', 0,   0,   0,   0,   0,   0,		0,   0,   0,   0,   0,   0,   0,   '7', '8', '9', '-', '4', '5', '6', '+', '1',		'2', '3', '0', '.', 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,		0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,		0,   0,   0,   0x5c, 0,  0,   0,   0,   0,   0,   0,   0,   0,   0x5c, 0,  0	};	static char keytable1[0x80] = {		0,   0,   '!', 0x22, '#', '$', '%', '&', 0x27, '(', ')', '~', '=', '~', 0,   0,		'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '`', '{', 0,   0,   'A', 'S',		'D', 'F', 'G', 'H', 'J', 'K', 'L', '+', '*', 0,   0,   '}', 'Z', 'X', 'C', 'V',		'B', 'N', 'M', '<', '>', '?', 0,   '*', 0,   ' ', 0,   0,   0,   0,   0,   0,		0,   0,   0,   0,   0,   0,   0,   '7', '8', '9', '-', '4', '5', '6', '+', '1',		'2', '3', '0', '.', 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,		0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,		0,   0,   0,   '_', 0,   0,   0,   0,   0,   0,   0,   0,   0,   '|', 0,   0	};	int key_to = 0, key_shift = 0, key_leds = (binfo->leds >> 4) & 7, keycmd_wait = -1;	init_gdtidt();	init_pic();	io_sti(); /* IDT/PICの初期化が
C++ timer_irq_handler函数代码示例
C++ timer_get_fixed_seconds函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。