• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MODE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: rectangles

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

    if (! cairo_perf_can_run (perf, "rectangles", NULL))
	return;

    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-rectangle", do_rectangle);
    MODE (perf, "rectangles", do_rectangles);
    MODE (perf, "rectangles-once", do_rectangles_once);
}
开发者ID:ghub,项目名称:NVprSDK,代码行数:21,代码来源:rectangles.c


示例17: sig_file_open

/// Open a file of known hashes and determine if it's valid
///
/// @param s State variable
/// @param fn filename to open
/// 
/// @return Returns false success, true on error
bool sig_file_open(state *s, const char * fn)
{
  if (NULL == s or NULL == fn)
    return true;

  s->known_handle = fopen(fn,"rb");
  if (NULL == s->known_handle)
  {
    if ( ! (MODE(mode_silent)) )
      perror(fn);
    return true;
  }

  // The first line of the file should contain a valid ssdeep header. 
  char buffer[MAX_STR_LEN];
  if (NULL == fgets(buffer,MAX_STR_LEN,s->known_handle))
  {
    if ( ! (MODE(mode_silent)) )
      perror(fn);
    fclose(s->known_handle);
    return true;
  }

  chop_line(buffer);

  if (strncmp(buffer,SSDEEPV1_0_HEADER,MAX_STR_LEN) and 
      strncmp(buffer,SSDEEPV1_1_HEADER,MAX_STR_LEN)) 
  {
    if ( ! (MODE(mode_silent)) )
      print_error(s,"%s: Invalid file header.", fn);
    fclose(s->known_handle);
    return true;
  }

  // We've now read the first line
  s->line_number = 1;
  s->known_fn = strdup(fn);

  return false;
}
开发者ID:chrisoei,项目名称:ssdeep,代码行数:46,代码来源:match.cpp


示例18: fix_gmode

int
fix_gmode(sccs *s, int gflags)
{
	ser_t	d;

	/*
	 * Do not fix mode of symlink target, the file may not be 
	 * under BK control.
	 */
	if (S_ISLNK(s->mode)) return (0);

	if ((gflags&GET_EDIT) && WRITABLE(s))  return (0);
	if (!(gflags&GET_EDIT) && !WRITABLE(s))  return (0);

	d = sccs_top(s);
	if (MODE(s, d)) s->mode = MODE(s, d);
	unless (gflags&GET_EDIT) {
		s->mode &= ~0222;	/* turn off write mode */
	}

	if (chmod(s->gfile, s->mode)) return (1);
	return (0);
}
开发者ID:AlexShiLucky,项目名称:bitkeeper,代码行数:23,代码来源:delta.c


示例19: timeout

bool SansgridRadio::timeout(void) {
	bool timeout_flag = false;
	if (!on_network || MODE(ROUTER)) return timeout_flag;
	timeout_counter++;
	if (timeout_counter == 0) {
		timeout_flag = true;
		SpiData->control = SG_SERIAL_CTRL_VALID_DATA;
		memcpy(ip, router_ip, IP_LENGTH);
		memset(router_ip, 0, IP_LENGTH);
		SpiData->payload[0] = SG_CHIRP_NETWORK_DISCONNECTS_SENSOR;
		on_network = false;
	}
	return timeout_flag;
}
开发者ID:branstem,项目名称:SansGrid,代码行数:14,代码来源:sgRadio.cpp


示例20: error

OP_ERROR
SOP_PrimGroupCentroid::cookMySop(OP_Context &context)
{
    fpreal                      now;
    int                       method, mode;

    now = context.getTime();

    if (lockInputs(context) >= UT_ERROR_ABORT)
        return error();

    // The partitioning mode.
    mode = MODE(now);

    // Find out which calculation method we are attempting.
    method = METHOD(now);

    // Binding geometry.
    if (nConnectedInputs() == 2)
    {
        // Duplicate the source.
        duplicateSource(0, context);

        // Bind to the centroids.  If the function returns 1, unlock
        // the inputs and return.
        if (bindToCentroids(now, mode, method))
        {
            unlockInputs();
            return error();
        }
    }
    // Creating centroids.
    else
    {
        // Clear out any previous data.
        gdp->clearAndDestroy();

        // Build the centroids.  If the function returns 1, unlock
        // the inputs and return.
        if (buildCentroids(now, mode, method))
        {
            unlockInputs();
            return error();
        }
    }

    unlockInputs();
    return error();
}
开发者ID:larsbijl,项目名称:Houdini-Toolbox,代码行数:49,代码来源:SOP_PrimGroupCentroid.C



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MODEL_RESET函数代码示例发布时间:2022-05-30
下一篇:
C++ MOD函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap