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

C++ EI函数代码示例

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

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



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

示例1: ei_x_encode_error_tuple_atom

int ei_x_encode_error_tuple_atom(ei_x_buff *buff, char *atom) {
    EI(ei_x_encode_version(buff));
    EI(ei_x_encode_tuple_header(buff, 2));
    EI(ei_x_encode_atom(buff, "error"));
    EI(ei_x_encode_atom(buff, atom));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:7,代码来源:ei_util.c


示例2: k_set_prio

int
k_set_prio (char prio)
{
    int i;

    if (!k_running) {
        return (-1);
    }

    DI ();

    if ((prio <= 0) || (DMY_PRIO <= prio)) {
        // not legal value my friend
        EI ();
        return (-2);
    }
    i = pRun->prio;

    pRun->prio = prio;
    prio_enQ (pAQ, deQ (pRun));
    ki_task_shift ();

    EI ();

    return (i);
}
开发者ID:carycode,项目名称:krnl,代码行数:26,代码来源:krnl.c


示例3: imalloc

/*
 * Get memory 
 */
LOCAL void* imalloc( size_t size, IMACB *imacb )
{
	QUEUE	*q;
	VP	mem;
	UW	imask;

	/* If it is smaller than the minimum fragment size,
	   allocate the minimum size to it. */
	if ( size < MIN_FRAGMENT ) {
		size = MIN_FRAGMENT;
	}
	size = ROUND(size);

	DI(imask);  /* Exclusive control by interrupt disable */
	SpinLock(&MemLockObj);

	/* Search FreeQue */
	q = searchFreeArea(size, imacb);
	if ( q != &imacb->freeque ) {
		/* There is free area: Split from FreeQue once */
		removeFreeQue(q);

		q = q - 1;
	} else {
		/* Reserve new pages because there is no free space */
		QUEUE	*e;
		size_t	n;

		/* Reserve pages */
		SpinUnlock(&MemLockObj);
		EI(imask);
		n = PageCount(size + sizeof(QUEUE) * 2);
		q = GetSysMemBlk(n, imacb->mematr);
		if ( q == NULL ) {
			goto err_ret;  /* Insufficient memory */
		}
		DI(imask);
		SpinLock(&MemLockObj);

		/* Register on AreaQue */
		e = (QUEUE*)((VB*)q + n * pagesz) - 1;
		insertAreaQue(&imacb->areaque, e);
		insertAreaQue(&imacb->areaque, q);
		setAreaFlag(q, AREA_TOP);
		setAreaFlag(e, AREA_END);
	}

	/* Allocate memory */
	mem = mem_alloc(q, size, imacb);

	SpinUnlock(&MemLockObj);
	EI(imask);
	return mem;

err_ret:
	BMS_DEBUG_PRINT(("imalloc error\n"));
	return NULL;
}
开发者ID:kidasan,项目名称:tkernel,代码行数:61,代码来源:imalloc.c


示例4: ei_x_encode_time

int ei_x_encode_time(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    EI(ei_x_encode_atom(types, "time"));
    int v = r->i;
    if(opts->day_seconds_is_q_time) {
        v = msec_to_sec(v);
    }
    EI(ei_x_encode_ki_val(values, v));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:9,代码来源:q2e.c


示例5: ei_x_encode_kstring

int ei_x_encode_kstring(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    EI(ei_x_encode_atom(types, "string"));
    if(r->n == 0) {
        EI(ei_x_encode_empty_list(values));
    } else {
        EI(ei_x_encode_string_len(values, (const char*)kC(r), r->n));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:9,代码来源:q2e.c


示例6: ei_x_encode_dict_impl

int ei_x_encode_dict_impl(ei_x_buff* types, ei_x_buff* values, const char* t, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(types, r->n+1));
    EI(ei_x_encode_atom(types, t));
    EI(ei_x_encode_tuple_header(values, r->n));
    int i;
    for(i=0; i<r->n; ++i) {
        EI(ei_x_encode_k_tv(types, values, kK(r)[i], opts));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:10,代码来源:q2e.c


示例7: ei_x_encode_unknown

int ei_x_encode_unknown(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(types, r->n+1));
    EI(ei_x_encode_long(types, r->t));
    EI(ei_x_encode_tuple_header(values, r->n));
    int i;
    for(i=0; i<r->n; ++i) {
        EI(ei_x_encode_k_tv(types, values, kK(r)[i], opts));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:10,代码来源:q2e.c


示例8: ei_x_encode_datetime

int ei_x_encode_datetime(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    if(opts->unix_timestamp_is_q_datetime) {
        long v = datetime_to_unix_timestamp(r->f);
        EI(ei_x_encode_atom(types, "datetime"));
        EI(ei_x_encode_long(values, v));
    } else {
        EI(ei_x_encode_kf(types, values, "datetime", r, opts));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:10,代码来源:q2e.c


示例9: ei_x_encode_same_list_byte

int ei_x_encode_same_list_byte(ei_x_buff* types, ei_x_buff* values, const char* t, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(types, 2));
    EI(ei_x_encode_atom(types, "list"));
    EI(ei_x_encode_atom(types, t));
    if(r->n == 0) {
        EI(ei_x_encode_empty_list(values));
    } else {
        EI(ei_x_encode_string_len(values, (const char*)kG(r), r->n));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:11,代码来源:q2e.c


示例10: _SifCmdIntHandler

int _SifCmdIntHandler()
{
	u128 packet[8];
	u128 *pktbuf;
	struct cmd_data *cmd_data = &_sif_cmd_data;
	SifCmdHeader_t *header;
	SifCmdHandlerData_t *cmd_handlers;
	int size, pktquads, id, i = 0;

	EI();

	header = (SifCmdHeader_t *)cmd_data->pktbuf;

	if (!(size = (header->size & 0xff)))
		goto out;

	/* TODO: Don't copy anything extra */
	pktquads = (size + 30) >> 4;
	header->size = 0;
	if (pktquads) {
		pktbuf = (u128 *)cmd_data->pktbuf;
		while (pktquads--) {
			packet[i] = pktbuf[i];
			i++;
		}
	}

	iSifSetDChain();

	header = (SifCmdHeader_t *)packet;
	/* Get the command handler id and determine which handler list to
	   dispatch from.  */
	id = header->cid & ~SYSTEM_CMD;

	if (id < CMD_HANDLER_MAX) {
		if (header->cid & SYSTEM_CMD) {
			cmd_handlers = cmd_data->sys_cmd_handlers;
		}
		else {
			cmd_handlers = cmd_data->usr_cmd_handlers;
		}
	} else {
		goto out;
	}

	if (cmd_handlers[id].handler)
		cmd_handlers[id].handler(packet, cmd_handlers[id].harg);

out:
	EE_SYNC();
	EI();
	return 0;
}
开发者ID:EvertonSilva,项目名称:ps2sdk,代码行数:53,代码来源:sifcmd.c


示例11: ei_x_encode_kf_val

int ei_x_encode_kf_val(ei_x_buff* values, double f) {
    EI_X_ENCODE_NULL_OR_INF(f, nf, wf);
    if(f == nf || q2e_isnan(f)) {
        EI(ei_x_encode_atom(values, "null"));
        return 0;
    } else if(f == wf) {
        EI(ei_x_encode_atom(values, "infinity"));
        return 0;
    }
    EI(ei_x_encode_double(values, f));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:12,代码来源:q2e.c


示例12: ei_x_encode_k

int ei_x_encode_k(ei_x_buff* x, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(x, 2));
    ei_x_buff* types = x;
    ei_x_buff values;
    EI(ei_x_new(&values));
    EIC(ei_x_encode_k_tv(types, &values, r, opts),
            ei_x_free(&values)); // cleanup expression
    // TODO - JMS - is there a way to do this without deep copying data?
    EIC(ei_x_append(types, &values),
            ei_x_free(&values)); // cleanup expression
    EI(ei_x_free(&values));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:13,代码来源:q2e.c


示例13: main

int main(){
	DI();//disable interrupts or hell breaks loose during hardware config
	construct_system();//bind device addresses
	init_system();//init devices
		//clear all interrupts
	clearall_interrupts();
	EI();//enable interrupts: we have UART_recieve
	
	//set the lcd contrast
	//lcd_contrast(0x42);
	lcd_contrast(0x32);
	//clear the lcd
	clearram();
	//show boot up message
	show_bootup();
	//clear boot message
	clearram();
	//screen layout
	screen_layout();
	send(1, 225);
	send(1, 255);
	send(1, 2);
	while(1)
	{
		get_temperature1();
		get_temperature2();
		get_light();
		get_pressure();
		get_humidity();
		get_soilwetness();
		display();
		delay_ms(800);		
	}
	return 0;
}
开发者ID:Muriukidavid,项目名称:z8_64k,代码行数:35,代码来源:main.c


示例14: uart_putchar

int uart_putchar(unsigned char c)
{
    int buffer_loc;

    if(c == '\n') {
        while(uart_putchar('\r')) {
            ;
        }
    }

    if(trans_buffer_size < BUFFER_SIZE) {
        DI();

        buffer_loc = (trans_buffer_current + trans_buffer_size) % BUFFER_SIZE;
        trans_buffer[buffer_loc] = c;
        trans_buffer_size++;

        //trigger the interrupt if already ready to transmit
        if((U0STAT0 & UART_TRAN_RDY) &&
                ((IRQ0SET & UART_IRQ_TRAN) == 0)) {
            IRQ0SET |= UART_IRQ_TRAN;
        }

        EI();
    }
    else {
        return 1;
    }

    return 0;
}
开发者ID:mharlan,项目名称:embedded-labs,代码行数:31,代码来源:uart.c


示例15: knl_Ifree

/*
 * Free memory
 *	It may be called during interrupt disable. In this case, need to wait
 *	 until interrupt is enabled and until free.
 */
EXPORT void  knl_Ifree( void *ptr )
{
	QUEUE	*aq;
	UINT	imask;

	DI(imask);  /* Exclusive control by interrupt disable */

	aq = (QUEUE*)ptr - 1;
	clrAreaFlag(aq, AREA_USE);

	if ( !chkAreaFlag(aq->next, AREA_USE) ) {
		/* Merge with free area in after location */
		knl_removeFreeQue(aq->next + 1);
		knl_removeAreaQue(aq->next);
	}

	if ( !chkAreaFlag(aq->prev, AREA_USE) ) {
		/* Merge with free area in front location */
		aq = aq->prev;
		knl_removeFreeQue(aq + 1);
		knl_removeAreaQue(aq->next);
	}

	knl_appendFreeArea(knl_imacb, aq);

	EI(imask);
}
开发者ID:chenyifu,项目名称:utkernel-pi,代码行数:32,代码来源:memory.c


示例16: print_lcd

void print_lcd(volatile uint8_t *message) {
    uint8_t len = strlen(message);
    lcd_clear();
    delay(1000);

    volatile uint8_t i = 0;
    //if (len > lcd_message_max) len = lcd_message_max;
    for (i = 0; i < len; i++)
    {
        if (message[i] <= 0x7F) {
            writeByteLcd(1, message[i]);
        }
        else {
            writeByteLcd(1, ' ');
        }
        delay(100);
        if (i == 7) {
//			int k;
//			for (k = 0; k < 32; k++)
//			{
//				writeByteLcd(0U, LCD_CURSOR_RIGHT);
//				delay(100);
//			}
            writeByteLcd(0U, 0xC0);
            delay(100);
        }
    }

    // scroll one right
    //writeByteLcd(0U, 0x1C);
    //	delay(100);
    EI();
}
开发者ID:daniel-leonard-robinson,项目名称:Wireless-Gate-Controller,代码行数:33,代码来源:lcd.c


示例17: ei_x_encode_table

int ei_x_encode_table(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {

    EI(ei_x_encode_tuple_header(types, 2));
    EI(ei_x_encode_atom(types, "table"));

    EI(ei_x_encode_tuple_header(values, 2));

    ei_x_buff column_types;
    ei_x_new_with_version(&column_types);
    EIC(ei_x_encode_k_tv(&column_types, values, kK(r->k)[0], opts),
            ei_x_free(&column_types));
    ei_x_free(&column_types);

    EI(ei_x_encode_k_tv(types, values, kK(r->k)[1], opts));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:16,代码来源:q2e.c


示例18: led_init

void led_init()
{
	PEADDR = 0x02;		//set alternative function (port E)
	PECTL = 0x00;
	PEADDR = 0x01;		//set datadirection to output (port E)
	PECTL = 0x00;

	PGADDR = 0x02;		//set alternative function (port G)
	PGCTL = 0x00;
	PGADDR = 0x01;		//set datadirection to output (port G)
	PGCTL = 0x00;

	T0CTL = 0x01;		//Disable Timer0 and set it to continous mode
	T0CTL |= 0x38;		//Set the prescale value
	
	T0H = 0x00;		
	T0L = 0x01;			//reset timer

	T0RH = 0x00;
//	T0RH = 0x02;
	T0RL = 0xD0;		//set reload value (0.5 ms)

	IRQ0ENH &= 0xDF;
	IRQ0ENL |= 0x20;	 //enable Timer0 interrupt, and set low priority

	T0CTL |= 0x80;		//enable Timer0
	EI();				//enable interrupts

	SET_VECTOR(TIMER0, drawtimer);		//set timer interrupt function

	led_clear();		//clear the LEDs
	led_onall();	
}
开发者ID:hdweiss,项目名称:arkanoid-z8,代码行数:33,代码来源:led.c


示例19: R_Systeminit

/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    DI();

    /* Enable writing to registers related to operating modes, LPC, CGC and ATCM */
    SYSTEM.PRCR.LONG = 0x0000A50BU;

    /* Enable writing to MPC pin function control registers */
    MPC.PWPR.BIT.B0WI = 0U;
    MPC.PWPR.BIT.PFSWE = 1U;

    r_set_exception_handler();

    /* Set peripheral settings */
    R_CGC_Create();
    R_ICU_Create();
    R_PORT_Create();
    R_TPU_Create();
    R_RSPI1_Create();
    R_MPC_Create();
	R_SCIFA2_Create();

    /* Disable writing to MPC pin function control registers */
    MPC.PWPR.BIT.PFSWE = 0U;
    MPC.PWPR.BIT.B0WI = 1U;

    /* Enable protection */
    SYSTEM.PRCR.LONG = 0x0000A500U;
    EI();
}
开发者ID:bleuelotus,项目名称:SweepRobot_Testing_Host,代码行数:36,代码来源:r_cg_systeminit.c


示例20: CPU_RTC_Interrupt

//内部RTC闹铃,中断等级--------INTER_GRADE_LOWERST (默认:INTRTC_vect)
void CPU_RTC_Interrupt(void)
{
#if ALL_LOSS_TYPE EQ ALL_LOSS_HARD_SINGLE 
  EI();
#endif
  
#if ALL_LOSS_TYPE EQ ALL_LOSS_HARD_MULTI 
  EI();
  Clear_CPU_Dog();
  //醒来了,根据唤醒源马上切换高速晶振-----------PUCK
  Switch_Main_Osc(RUN_MODE);
  Hard_All_Loss_Proc();  
  Switch_Main_Osc(HALT_MODE);
  Clear_CPU_Dog();  
#endif 
}
开发者ID:Tulga11201,项目名称:meter-645-2007,代码行数:17,代码来源:InterrAbs.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ EIF_NON_GENERIC函数代码示例发布时间:2022-05-30
下一篇:
C++ EH函数代码示例发布时间: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