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

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

51自学网 2021-06-01 20:31:48
  C++
这篇教程C++ EI函数代码示例写得很实用,希望能帮到您。

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

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


示例2: k_set_prio

intk_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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例21: Inter_Up_Key

//UP Key,中断等级--------INTER_GRADE_LOWERSTvoid Inter_Up_Key(void){  EI();  Resume_Src.Src_Flag|=KEY_RESUME;  Key_WkUP_Ms_Timr=Ms_Timer_Pub;  Key_Value_Pub.Key.Bit.UpKey=1;}
开发者ID:Tulga11201,项目名称:meter-645-2007,代码行数:8,


示例22: timer_isr

/*	Interrupt for timer events.	Used for updating the LED, polling the buttons, and responding	to note change events for the speaker.. */void interrupt timer_isr(void){	//enable interrupts for speaker interrupt	EI();		button_events();}
开发者ID:mharlan,项目名称:MIDI_out_example,代码行数:13,


示例23: TxThread

static void TxThread(void *arg){	int ThreadToWakeUp;	while(1)	{		SleepThread();		if(PacketReqs.count > 0)		{			while(PacketReqs.count > 0)			{				WaitSema(NetManIOSemaID);				while(SifCallRpc(&NETMAN_rpc_cd, NETMAN_IOP_RPC_FUNC_SEND_PACKETS, 0, &PacketReqs, sizeof(PacketReqs), &ReceiveBuffer, sizeof(ReceiveBuffer.result), &TxEndCallback, NULL) < 0){};				SignalSema(NetManIOSemaID);			}		}		else		{			if(NetmanTxWaitingThread >= 0)			{				DI();				ThreadToWakeUp=NetmanTxWaitingThread;				NetmanTxWaitingThread=-1;				EI();				WakeupThread(ThreadToWakeUp);			}		}	}}
开发者ID:AKuHAK,项目名称:ps2sdk,代码行数:30,


示例24: SifRegisterRpc

SifRpcServerData_t *SifRegisterRpc(SifRpcServerData_t *sd, 		int sid, SifRpcFunc_t func, void *buff, SifRpcFunc_t cfunc,		void *cbuff, SifRpcDataQueue_t *qd){	SifRpcServerData_t *server;	DI();	sd->link  = NULL;	sd->next  = NULL;	sd->sid   = sid;	sd->func  = func;	sd->buff  = buff;	sd->cfunc = cfunc;	sd->cbuff = cbuff;	sd->base  = qd;	if (!(server = qd->link)) {		qd->link = sd;	} else {		while ((server = server->next))			;		server->next = sd;	}	EI();	return server;}
开发者ID:EvertonSilva,项目名称:ps2sdk,代码行数:31,


示例25: R_MAIN_UserInit

/************************************************************************************************************************ Function Name: R_MAIN_UserInit* Description  : This function adds user code before implementing main function.* Arguments    : None* Return Value : None***********************************************************************************************************************/void R_MAIN_UserInit(void){    /* Start user code. Do not edit comment generated here */    	EI();	u_timer_Init();	u_g_param_Init();	TDR02	= 0x07FF;		TDR00	= 0x03FF;		/* 24MHz / (1023+1)  nearly  24kHz , PWM master */	TDR01	= 0x0200;		/* PWM slave */	IICE0	= 0;	SO0	|= 0x0001;	SOE0	&= 0xFFF0;	PM6.0	= 0;	PM6.1	= 0;		ADIF	= 0;	set_kind_param(SPEED);	ADS	= _02_AD_INPUT_CHANNEL_2;	R_ADC_Set_OperationOn();    /* End user code. Do not edit comment generated here */}
开发者ID:littlebits,项目名称:i36-microSequencer,代码行数:35,


示例26: SifSetRpcQueue

SifRpcDataQueue_t *SifSetRpcQueue(SifRpcDataQueue_t *qd, int thread_id){	SifRpcDataQueue_t *queue = NULL;	DI();	qd->thread_id = thread_id;	qd->active = 0;	qd->link   = NULL;	qd->start  = NULL;	qd->end    = NULL;	qd->next   = NULL;	if (!_sif_rpc_data.active_queue) {		_sif_rpc_data.active_queue = qd;	} else {		queue = _sif_rpc_data.active_queue;		while ((queue = queue->next))			;		queue->next = qd;	}	EI();	return queue;}
开发者ID:EvertonSilva,项目名称:ps2sdk,代码行数:29,


示例27: timer1_setup

void timer1_setup(int difficulty){	T1CTL = 0x01;	//Disable Timer1 and set it to continous mode	T1CTL |= 0x38;	//Set the prescale value		T1H = 0x00;		//...	T1L = 0x01;		//reset timer		if(difficulty > 0xFF)	//set timer reload value	{	    T1RH = difficulty - 0xFF;	    T1RL = 0xFF;	}	else	{	    T1RH = 0x00;	    T1RL = difficulty;	} 		IRQ0ENH |= 0x40; 	//enable Timer1 interrupt, and set nominal priority	IRQ0ENL &= 0xBF;	SET_VECTOR(TIMER1, timer1int);	T1CTL |= 0x80;		//enable Timer1	EI();				//enable interrupts}
开发者ID:hdweiss,项目名称:arkanoid-z8,代码行数:31,


示例28: PS2CamReadPacket

int PS2CamReadPacket(int handle){	int *ret;	int *iop_addr;	WaitSema(sem);	ret = (int *)&data[0];	ret[0] = handle;	SifCallRpc(&cdata, PS2CAM_RPC_READPACKET, 0, (void*)(&data[0]),4,(void*)(&data[0]),4*2,0,0);	if(ret[0] < 0) return ret[0];	DI();	ee_kmode_enter();	iop_addr = (int *)(0xbc000000+ret[1]);	memcpy(&campacket[0],iop_addr, ret[0]);	ee_kmode_exit();	EI();	//if i add a printf here, the ps2 will exit to sony's explorer	SignalSema(sem);	return ret[0];}
开发者ID:AKuHAK2,项目名称:ps2sdk,代码行数:31,


示例29: led_display_text

void led_display_text(const unsigned char *msg){	char *new_msg;	msg_size = strlen(msg);	new_msg = malloc(sizeof(*new_msg) * (msg_size + 2));	//+2 for space pad and null terminator	if(!new_msg) {		msg_size = 0;	}	else {		memcpy(new_msg, msg, msg_size);		//space pads the wrap-around		if(msg_size > 4) {			new_msg[msg_size] = ' ';			++msg_size;		}		new_msg[msg_size] = '/0';		DI();				if(led_msg != NULL) {			free(led_msg);		}				led_msg = new_msg;		msg_pos = 0;		row_pos = 0;		led_set_draw_chars();		EI();	}}
开发者ID:mharlan,项目名称:UltrasonicMIDI,代码行数:33,



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


C++ EIF_NON_GENERIC函数代码示例
C++ EH函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。