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


C++ MODE函数代码示例

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


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

示例1: am335x_pinmux_spi0

void am335x_pinmux_spi0(void)
{
	writel(MODE(0) | RXACTIVE | PULLUDEN, &regs->spi0_sclk);
	writel(MODE(0) | RXACTIVE | PULLUDEN | PULLUP_EN, &regs->spi0_d0);
	writel(MODE(0) | RXACTIVE | PULLUDEN, &regs->spi0_d1);
	writel(MODE(0) | RXACTIVE | PULLUDEN | PULLUP_EN, &regs->spi0_cs0);
}
开发者ID:0ida,项目名称:coreboot,代码行数:7,代码来源:pinmux.c

示例2: am335x_pinmux_i2c1

void am335x_pinmux_i2c1(void)
{
	// I2C_DATA
	writel(MODE(2) | RXACTIVE | PULLUDEN | SLEWCTRL, &regs->spi0_d1);
	// I2C_SCLK
	writel(MODE(2) | RXACTIVE | PULLUDEN | SLEWCTRL, &regs->spi0_cs0);
}
开发者ID:0ida,项目名称:coreboot,代码行数:7,代码来源:pinmux.c

示例3: am335x_pinmux_uart2

void am335x_pinmux_uart2(void)
{
	// UART2_RXD
	writel(MODE(1) | PULLUP_EN | RXACTIVE, &regs->spi0_sclk);
	// UART2_TXD
	writel(MODE(1) | PULLUDEN, &regs->spi0_d0);
}
开发者ID:0ida,项目名称:coreboot,代码行数:7,代码来源:pinmux.c

示例4: am335x_pinmux_uart3

void am335x_pinmux_uart3(void)
{
	// UART3_RXD
	writel(MODE(1) | PULLUP_EN | RXACTIVE, &regs->spi0_cs1);
	// UART3_TXD
	writel(MODE(1) | PULLUDEN, &regs->ecap0_in_pwm0_out);
}
开发者ID:0ida,项目名称:coreboot,代码行数:7,代码来源:pinmux.c

示例5: am335x_pinmux_uart4

void am335x_pinmux_uart4(void)
{
	// UART4_RXD
	writel(MODE(6) | PULLUP_EN | RXACTIVE, &regs->gpmc_wait0);
	// UART4_TXD
	writel(MODE(6) | PULLUDEN, &regs->gpmc_wpn);
}
开发者ID:0ida,项目名称:coreboot,代码行数:7,代码来源:pinmux.c

示例6: am335x_pinmux_uart5

void am335x_pinmux_uart5(void)
{
	// UART5_RXD
	writel(MODE(4) | PULLUP_EN | RXACTIVE, &regs->lcd_data9);
	// UART5_TXD
	writel(MODE(4) | PULLUDEN, &regs->lcd_data8);
}
开发者ID:0ida,项目名称:coreboot,代码行数:7,代码来源:pinmux.c

示例7: obio_iomem_add_mapping

int
obio_iomem_add_mapping(bus_addr_t bpa, bus_size_t size, int type,
    bus_space_handle_t *bshp)
{
	u_long pa, endpa;
	vaddr_t va;
	pt_entry_t *pte;
	unsigned int m = 0;
	int io_type = type & ~OBIO_IOMEM_PCMCIA_8BIT;

	pa = trunc_page(bpa);
	endpa = round_page(bpa + size);

#ifdef DIAGNOSTIC
	if (endpa <= pa)
		panic("obio_iomem_add_mapping: overflow");
#endif

	va = uvm_km_valloc(kernel_map, endpa - pa);
	if (va == 0)
		return (ENOMEM);

	*bshp = (bus_space_handle_t)(va + (bpa & PGOFSET));

#define MODE(t, s)							\
	((t) & OBIO_IOMEM_PCMCIA_8BIT) ?				\
		_PG_PCMCIA_ ## s ## 8 :					\
		_PG_PCMCIA_ ## s ## 16
	switch (io_type) {
	default:
		panic("unknown pcmcia space.");
		/* NOTREACHED */
	case OBIO_IOMEM_PCMCIA_IO:
		m = MODE(type, IO);
		break;
	case OBIO_IOMEM_PCMCIA_MEM:
		m = MODE(type, MEM);
		break;
	case OBIO_IOMEM_PCMCIA_ATT:
		m = MODE(type, ATTR);
		break;
	}
#undef MODE

	for (; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) {
		pmap_kenter_pa(va, pa, PROT_READ | PROT_WRITE);
		pte = __pmap_kpte_lookup(va);
		KDASSERT(pte);
		*pte |= m;  /* PTEA PCMCIA assistant bit */
		sh_tlb_update(0, va, *pte);
	}

	return (0);
}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:54,代码来源:obio.c

示例8: display_result

bool display_result(state *s, const TCHAR * fn, const char * sum)
{
  // Only spend the extra time to make a Filedata object if we need to
  if (MODE(mode_match_pretty) or MODE(mode_match) or MODE(mode_directory))
  {
    Filedata * f;

    try 
    {
      f = new Filedata(fn, sum);
    } 
    catch (std::bad_alloc)
    {
      fatal_error("%s: Unable to create Filedata object in engine.cpp:display_result()", __progname);
    }

    if (MODE(mode_match_pretty)) 
    {
      if (match_add(s,f))
	print_error_unicode(s,fn,"Unable to add hash to set of known hashes");
    }
    else
    {
      // This block is for MODE(mode_match) or MODE(mode_directory)
      match_compare(s,f);

      if (MODE(mode_directory))
	if (match_add(s,f))
	  print_error_unicode(s,
			      fn,
			      "Unable to add hash to set of known hashes");
    }
  }
  else
  {
    // No special options selected. Display the hash for this file
    if (s->first_file_processed)
    {
      print_status("%s", OUTPUT_FILE_HEADER);
      s->first_file_processed = false;
    }

    printf ("%s,\"", sum);
    display_filename(stdout,fn,TRUE);
    print_status("\"");
  }

  return false;
}
开发者ID:mklauber,项目名称:python-ssdeep,代码行数:49,代码来源:engine.cpp

示例9: rounded_rectangles

void
rounded_rectangles (cairo_perf_t *perf, cairo_t *cr, int width, int height)
{
    int i;

    srand (8478232);
    for (i = 0; i < RECTANGLE_COUNT; i++) {
        rects[i].x = rand () % width;
        rects[i].y = rand () % height;
        rects[i].width  = (rand () % (width / 10)) + 1;
        rects[i].height = (rand () % (height / 10)) + 1;
    }

    MODE (perf, "one-rounded-rectangle", do_rectangle);
    MODE (perf, "rounded-rectangles", do_rectangles);
}
开发者ID:3oyka,项目名称:cairo2,代码行数:16,代码来源:rounded-rectangles.c

示例10: test_config

int test_config(void) {
	printf("\n\tTouch in the mouse\n\n");
	unsigned long data, res;
	unsigned char a[3];
	mouse_subscribe();
	mouse_write(MOUSE_STATUS);
	mouse_read(&data);
	while (1) {
		mouse_read(&data);
		if ((BIT(7) & data) && (BIT(3) & res))
			break;
	}
	a[0] = data;
	while (1) {
		mouse_read(&data);
		if (data <= 3)
			break;
	}
	a[1] = data;
	tickdelay(micros_to_ticks(DELAY_US));
	if (mouse_read(&data) != 0)
		return -1;
	a[2] = data;
	printf("\n\tCONFIGURATION\n");
	printf(
			"\tMode: %s\n\tEnable: %d\n\tScaling: %s\n\tLB: %d\n\tMB: %d\n\tRB: %d\n\tResolution: %d count/mm\n\tSample Rate: %d\n",
			MODE(a[0]) ? "Remote" : "Stream", ENABLE(a[0]),
			SCALING(a[0]) ? "1:1" : "2:1", LEFT(a[0]), MIDDLE(a[0]),
			RIGHT(a[0]), RESOLUTION(a[1]), RATE(a[2]));
	mouse_unsubscribe();
	printf("\n\tpress ANY KEY to continue\n");
	mouse_read(&res); /* clear out buffer */
}
开发者ID:joaofidalgo23,项目名称:LCOM,代码行数:33,代码来源:test4.c

示例11: MODE

void DSPC::handleMessage(IBusMessage *m) {
	if(m->data[0]==0x01) {
		if(reset) {
			ibus.sendMessage(DEVICE_DSPC,DEVICE_LOC,DEVICE_STATUS_READY_AFTER_RESET,sizeof(DEVICE_STATUS_READY_AFTER_RESET));
			reset=false;
		} else {
			ibus.sendMessage(DEVICE_DSPC,DEVICE_LOC,DEVICE_STATUS_READY,sizeof(DEVICE_STATUS_READY));
		}
		return;
	}

	if(m->data[0]==0x35) {
		needMemoryInfo=false;
		// update from DSP
		mode = MODE(m->data[1] - 1);
		reverb = m->data[2] & 0x0F;
		if(m->data[2]&0x10)
			reverb*=-1;
		roomsize = m->data[3] & 0x0F;
		if(m->data[3]&0x10)
			roomsize*=-1;
		for(int f = 0; f < 7; f++) {
			boost[f] = m->data[4+f] & 0x0F;
			if(m->data[4+f] & 0x10)
				boost[f]*=-1;
		}
	}
}
开发者ID:jemmicat,项目名称:HK_Enabler_Plus,代码行数:28,代码来源:DSPC.cpp

示例12: print_ntp_control_message

void print_ntp_control_message(const ntp_control_message *p){
	int i=0, numpeers=0;
	const ntp_assoc_status_pair *peer=NULL;

	printf("control packet contents:\n");
	printf("\tflags: 0x%.2x , 0x%.2x\n", p->flags, p->op);
	printf("\t  li=%d (0x%.2x)\n", LI(p->flags), p->flags&LI_MASK);
	printf("\t  vn=%d (0x%.2x)\n", VN(p->flags), p->flags&VN_MASK);
	printf("\t  mode=%d (0x%.2x)\n", MODE(p->flags), p->flags&MODE_MASK);
	printf("\t  response=%d (0x%.2x)\n", (p->op&REM_RESP)>0, p->op&REM_RESP);
	printf("\t  more=%d (0x%.2x)\n", (p->op&REM_MORE)>0, p->op&REM_MORE);
	printf("\t  error=%d (0x%.2x)\n", (p->op&REM_ERROR)>0, p->op&REM_ERROR);
	printf("\t  op=%d (0x%.2x)\n", p->op&OP_MASK, p->op&OP_MASK);
	printf("\tsequence: %d (0x%.2x)\n", ntohs(p->seq), ntohs(p->seq));
	printf("\tstatus: %d (0x%.2x)\n", ntohs(p->status), ntohs(p->status));
	printf("\tassoc: %d (0x%.2x)\n", ntohs(p->assoc), ntohs(p->assoc));
	printf("\toffset: %d (0x%.2x)\n", ntohs(p->offset), ntohs(p->offset));
	printf("\tcount: %d (0x%.2x)\n", ntohs(p->count), ntohs(p->count));
	numpeers=ntohs(p->count)/(sizeof(ntp_assoc_status_pair));
	if(p->op&REM_RESP && p->op&OP_READSTAT){
		peer=(ntp_assoc_status_pair*)p->data;
		for(i=0;i<numpeers;i++){
			printf("\tpeer id %.2x status %.2x",
			       ntohs(peer[i].assoc), ntohs(peer[i].status));
			if (PEER_SEL(peer[i].status) >= PEER_INCLUDED){
				if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){
					printf(" <-- current sync source");
				} else {
					printf(" <-- current sync candidate");
				}
			}
			printf("\n");
		}
	}
}
开发者ID:AstroProfundis,项目名称:nagios-plugins,代码行数:35,代码来源:check_ntp.c

示例13: CHgetEvalTime

unsigned
SOP_PrimGroupCentroid::disableParms()
{
    fpreal                      t = CHgetEvalTime();
    unsigned                    changed;
    int                         mode;

    OP_Node                     *bind_input;

    // Partitioning mode.
    mode = MODE(t);

    // Try to get the 2nd input.
    bind_input = getInput(1);

    // Only use the 'group' parm when doing a group operation.
    changed = enableParm("group", mode == 0 && bind_input == NULL);

    // Enable the 'store' parm when there is no 2nd input.
    changed += enableParm("store", bind_input == NULL);

    // Enable thavior' parm when there is a 2nd input.
    changed += enableParm("behavior", bind_input != NULL);

    changed += enableParm("attributes", bind_input == NULL);
    changed += enableParm("bind_attributes", bind_input != NULL);

    return changed;
}
开发者ID:larsbijl,项目名称:Houdini-Toolbox,代码行数:29,代码来源:SOP_PrimGroupCentroid.C

示例14: I18N_PLAY_FUNCTION

I18N_PLAY_FUNCTION(en, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
{
  if (number < 0) {
    PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS);
    number = -number;
  }

  if (unit) {
    unit--;
    convertUnit(number, unit);
    if (IS_IMPERIAL_ENABLE()) {
      if (unit == UNIT_DIST) {
        unit = UNIT_FEET;
      }
      if (unit == UNIT_SPEED) {
    	unit = UNIT_KTS;
      }
    }
    unit++;
  }

  int8_t mode = MODE(att);
  if (mode > 0) {
    // we assume that we are PREC1
    div_t qr = div(number, 10);
    if (qr.rem) {
      PLAY_NUMBER(qr.quot, 0, 0);
      PUSH_NUMBER_PROMPT(EN_PROMPT_POINT_BASE + qr.rem);
      number = -1;
    }
    else {
      number = qr.quot;
    }
  }

  int16_t tmp = number;

  if (number >= 1000) {
    PLAY_NUMBER(number / 1000, 0, 0);
    PUSH_NUMBER_PROMPT(EN_PROMPT_THOUSAND);
    number %= 1000;
    if (number == 0)
      number = -1;
  }
  if (number >= 100) {
    PUSH_NUMBER_PROMPT(EN_PROMPT_HUNDRED + (number/100)-1);
    number %= 100;
    if (number == 0)
      number = -1;
  }
  if (number >= 0) {
    PUSH_NUMBER_PROMPT(EN_PROMPT_ZERO + number);
  }
  
  if (unit) {
    EN_PUSH_UNIT_PROMPT(tmp, EN_PROMPT_UNITS_BASE + unit*2);
  }
}
开发者ID:Ingwie,项目名称:NextStepRc-2.18,代码行数:58,代码来源:tts_en.cpp

示例15: mdlOutputs

static void mdlOutputs(SimStruct *S, int_T tid)
{
	double sp_original;
    double meas_scaled;
    double manip_original_in;
    double xi_in;
    int mode;
    double K;
    double Ti;
    double h;
    double LO_y;
    double HI_y;
    double LO_u;
    double HI_u;
    int action;
    int P_only;
    double rel_lo;
    double rel_hi;
    double hys;
    double hi_flag_in;

    double *manip_original;
    double *xi;
    double *hi_flag;
#ifdef DEBUG
	debug("mdlOutputs entered.\n");
#endif
	sp_original = SETPOINT(S);
	meas_scaled = INPUT(S);
	manip_original_in = MV(S);
	xi_in = XI(S);
	mode = MODE(S);
	K = GAIN(S);
	Ti = RESET(S);
	h = SAMPLING(S);
	LO_y = LOWMEAS(S);
	HI_y = HIGHMEAS(S);
	LO_u = LOWMV(S);
	HI_u = HIGHMV(S);
	action = PGAIN(S);
	P_only = PONLY(S);
	rel_lo = RELLO(S);
	rel_hi = RELHI(S);
	hys = HYS(S);
	hi_flag_in = HIFLAG(S);
	
	manip_original = &OUTPUT(S);
	xi = &XO(S);
	hi_flag = &FLAG(S);
	
	controller(manip_original, xi, hi_flag, sp_original, meas_scaled, manip_original_in, xi_in, mode, K, Ti, h, LO_y, HI_y, LO_u, HI_u, action, P_only, rel_lo, rel_hi, hys, hi_flag_in);

#ifdef DEBUG
	debug("mdlOutputs left.\n");
#endif
} /* mdlOutputs */
开发者ID:sk4ld,项目名称:DVCP-VAM,代码行数:56,代码来源:contrmex.c


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