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

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

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

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

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

示例1: CommHandler

void CommHandler(void) //UART4 Interrupt handler implementation{    int c = GetChar();    if (c >= 0)    {        //ConfigMode = 1;        LEDon();        //print("got char %02X/r/n", c);        switch (c)        {            case 'b':                print("rebooting into boot loader .../r/n");                Delay_ms(1000);                bootloader();                break;            case 'c':                debugCnt ^= 1;                print("counter messages %s/r/n", debugCnt ? "on" : "off");                break;            case 'd':                debugPrint ^= 1;                print("debug messages %s/r/n", debugPrint ? "on" : "off");                break;            case 'g':                Delay_ms(100);                PutChar('x');                for (int i = 0; i < CONFIGDATASIZE; i++)                {                    uint8_t data = configData[i];                    PutChar(data);                }                break;            case 'G':                printConfig();                break;#if 0            case 'H':                if (CharAvailable() >= CONFIGDATASIZE)                {                    for (int i = 0; i < CONFIGDATASIZE; i++)                    {                        uint8_t data = GetChar();                        if (data <= LARGEST_CONFIGDATA)                        {                            configData[i] = data;                        }                    }                    configSave();                }                else                {                    UnGetChar(c); // try again in next loop                }                break;#endif            case 'h':                for (int i = 0; i < CONFIGDATASIZE; i++)                {                    int data;                    while ((data = GetChar()) < 0)                        ;                    if (data <= LARGEST_CONFIGDATA)                    {                        configData[i] = data;                    }                }                configSave();                break;            case 'i':                ConfigMode = 1;                break;            case 'j':                ConfigMode = 0;                break;            case 'o':                debugOrient ^= 1;                print("Orientation messages %s/r/n", debugOrient ? "on" : "off");                break;            case 'p'://.........这里部分代码省略.........
开发者ID:jacekheli,项目名称:Firmware,代码行数:101,


示例2: GetLeadingChar

//------------------------------------------------------------------------------bool FBasicTokenParser::GetToken(FBasicToken& Token, bool bNoConsts/* = false*/){	// if the parser is in a bad state, then don't continue parsing (who 	// knows what will happen!?)	if (!IsValid())	{		return false;	}	Token.TokenName	= NAME_None;	TCHAR c = GetLeadingChar();	TCHAR p = PeekChar();	if( c == 0 )	{		UngetChar();		return 0;	}	Token.StartPos		= PrevPos;	Token.StartLine		= PrevLine;	if( (c>='A' && c<='Z') || (c>='a' && c<='z') || (c=='_') )	{		// Alphanumeric token.		int32 Length=0;		do		{			Token.Identifier[Length++] = c;			if( Length >= NAME_SIZE )			{				Length = ((int32)NAME_SIZE) - 1;				Token.Identifier[Length]=0; // need this for the error description				FText ErrorDesc = FText::Format(LOCTEXT("IdTooLong", "Identifer ({0}...) exceeds maximum length of {1}"), FText::FromString(Token.Identifier), FText::AsNumber((int32)NAME_SIZE));				SetError(FErrorState::ParseError, ErrorDesc);				break;			}			c = GetChar();		} while( ((c>='A')&&(c<='Z')) || ((c>='a')&&(c<='z')) || ((c>='0')&&(c<='9')) || (c=='_') );		UngetChar();		Token.Identifier[Length]=0;		// Assume this is an identifier unless we find otherwise.		Token.TokenType = FBasicToken::TOKEN_Identifier;		// Lookup the token's global name.		Token.TokenName = FName( Token.Identifier, FNAME_Find, true );		// If const values are allowed, determine whether the identifier represents a constant		if ( !bNoConsts )		{			// See if the identifier is part of a vector, rotation or other struct constant.			// boolean true/false			if( Token.Matches(TEXT("true")) )			{				Token.SetConstBool(true);				return true;			}			else if( Token.Matches(TEXT("false")) )			{				Token.SetConstBool(false);				return true;			}		}		return IsValid();	}	// if const values are allowed, determine whether the non-identifier token represents a const	else if ( !bNoConsts && ((c>='0' && c<='9') || ((c=='+' || c=='-') && (p>='0' && p<='9'))) )	{		// Integer or floating point constant.		bool  bIsFloat = 0;		int32 Length   = 0;		bool  bIsHex   = 0;		do		{			if( c==TEXT('.') )			{				bIsFloat = true;			}			if( c==TEXT('X') || c == TEXT('x') )			{				bIsHex = true;			}			Token.Identifier[Length++] = c;			if( Length >= NAME_SIZE )			{				Length = ((int32)NAME_SIZE) - 1;				Token.Identifier[Length]=0; // need this for the error description				FText ErrorDesc = FText::Format(LOCTEXT("IdTooLong", "Identifer ({0}...) exceeds maximum length of {1}"), FText::FromString(Token.Identifier), FText::AsNumber((int32)NAME_SIZE));				SetError(FErrorState::ParseError, ErrorDesc);				break;			}			c = FChar::ToUpper(GetChar());		} while ((c >= TEXT('0') && c <= TEXT('9')) || (!bIsFloat && c == TEXT('.')) || (!bIsHex && c == TEXT('X')) || (bIsHex && c >= TEXT('A') && c <= TEXT('F')));		Token.Identifier[Length]=0;//.........这里部分代码省略.........
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:101,


示例3: GetChar

	const Number FloatLiteralParser::Parse()	{		// Assert( NotAtEnd() && InClass(CharClass::NUMBER_HEAD) )		char c = GetChar();		NumberBuilder numberBuilder;		if (c == '0')		{			Advance();			if (AtEnd())			{				return Number::ZERO();			}			switch (GetChar())			{				case '.' : return ParseFractional(numberBuilder);				case 'e' :				case 'E' : return ParseExponent(numberBuilder);				case 'b' : return config_.parse_binary ? ParseBinary() : Number::ZERO();				case 'x' : return config_.parse_hexadecimal ? ParseHexadecimal() : Number::ZERO();			}			if (NotInClass(CharClass::DECIMAL))			{				return Number::ZERO();			}			if (config_.parse_octal)			{				return ParseOctal();			}		}		else if (c == '-')		{			numberBuilder.SetNegative();			Advance();			if (AtEnd() || NotInClass(CharClass::DECIMAL))			{				ThrowError("Decimal digit expected");			}		}		// Assert( NotAtEnd() && InClass(CharClass::DECIMAL) )		do		{			numberBuilder.OnIntegerDigit(GetChar() - '0');			Advance();			if (AtEnd())			{				return numberBuilder.Release();			}		}		while (InClass(CharClass::DECIMAL));		if (GetChar() == '.')		{			return ParseFractional(numberBuilder);		}		else if (GetChar() == 'e' || GetChar() == 'E')		{			return ParseExponent(numberBuilder);		}		return numberBuilder.Release();	}
开发者ID:haroldzmli,项目名称:cuboid,代码行数:69,


示例4: assert

void kGUIText::DrawSectionRot(int sstart,int slen,float x,float y,float angle,kGUIColor color,float alpha){	kGUIFace *face=kGUIFont::GetFace(GetFontID());	int glyph_index;	int font_height,font_above,font_below;	FT_Face ftface;	int size;	FT_Glyph   glyph2;	FT_Matrix  matrix;	FT_BitmapGlyph  bit;	float dx,dy,adv;	float advsin,advcos;	float fax,fay;	/* rotated font above */	unsigned int ch;	/* current character */	unsigned int nb;	/* number of bytes for current character */	ftface=face->GetFace();	size=GetFontSize();	if(!size)		return;	assert(size>0,"Cannot print size 0/n");	font_height=face->GetPixHeight(size);	font_above = face->GetPixAscHeight(size);	font_below = face->GetPixDescHeight(size);	kGUI::SelectFont(face,size);	matrix.xx = (FT_Fixed)( cos( angle ) * 0x10000L );	matrix.xy = (FT_Fixed)(-sin( angle ) * 0x10000L );	matrix.yx = (FT_Fixed)( sin( angle ) * 0x10000L );	matrix.yy = (FT_Fixed)( cos( angle ) * 0x10000L );	adv=0;	advsin=sin(angle);	advcos=cos(angle);	fax=sin(angle-(2*PI)*0.025f)*font_above;	fay=-(cos(angle-(2*PI)*0.025f)*font_above);	/* todo, handle underline */	while(slen>0)	{		ch=GetChar(sstart,&nb);		if(!ch)			return;		sstart+=nb;		slen-=nb;		/* todo, handle tabs, handle encoding  */		glyph_index = FT_Get_Char_Index( ftface, ch );		if(glyph_index>0)		{			FT_Load_Glyph(ftface,glyph_index,FT_LOAD_DEFAULT);			FT_Get_Glyph( ftface->glyph, &glyph2 );			FT_Glyph_Transform( glyph2, &matrix, 0 );			FT_Glyph_To_Bitmap( &glyph2, ft_render_mode_normal,0, 1);						/* draw to screen using writepixel */			bit = (FT_BitmapGlyph)glyph2;			dx=x+((advcos*adv)+fax);			dy=y-((advsin*adv)+fay);			DrawChar( (char *)bit->bitmap.buffer,						dx + bit->left,						dy -bit->top,						bit->bitmap.width, bit->bitmap.rows,						color,alpha);			adv+=ftface->glyph->advance.x/64.0f;			adv+=m_letterspacing;			FT_Done_Glyph(glyph2);		}	}	if(m_underline)		kGUI::DrawLine(x+fax,y-fay,x+((advcos*adv)+fax),y-((advsin*adv)+fay),color,alpha);}
开发者ID:CarlHuff,项目名称:kgui,代码行数:76,


示例5: OnValReadStart

CFSVar CJSONReader::ReadVal(const CFSAString &szKeyPath){	OnValReadStart(szKeyPath);	CFSVar Data;	if (m_cCh=='[') {		Data.Cast(CFSVar::VAR_ARRAY);		GetChar(true);		INTPTR ipPos=0;		for (;;) {			if (m_cCh==0) {				throw CJSONException(FSTSTR("Unexpetcted EOF"));			} else if (m_cCh==']') {				GetChar(true);				break;			} else if (ipPos>0) {				if (m_cCh==',') {					GetChar(true);				} else {					throw CJSONException(FSTSTR("Missing ',' in array"));				}			}			CFSAString szKey;			szKey.Format("%zd", ipPos);			CFSVar Data1=ReadVal(szKeyPath+"/"+szKey);			if (m_iCollectData>0) {				Data[ipPos]=Data1;			}			ipPos++;		}	} else if (m_cCh=='{') {		Data.Cast(CFSVar::VAR_MAP);		GetChar(true);		INTPTR ipPos=0;		for (;;) {			if (m_cCh==0) {				throw CJSONException(FSTSTR("Unexpetcted EOF"));			} else if (m_cCh=='}') {				GetChar(true);				break;			} else if (ipPos>0) {				if (m_cCh==',') {					GetChar(true);				} else {					throw CJSONException(FSTSTR("Missing ',' in map"));				}			}			CFSAString szKey;			if (m_cCh=='/"' || m_cCh=='/'') {				szKey=ReadString();			} else if (FSIsLetter(m_cCh)) {				szKey=ReadText();			} else {				throw CJSONException(FSTSTR("Expected key"));			}			if (m_cCh==':') {				GetChar(true);			} else {				throw CJSONException(FSTSTR("Expected ':'"));			}			CFSVar Data1=ReadVal(szKeyPath+"/"+szKey);			if (m_iCollectData>0) {				Data[szKey]=Data1;			}			ipPos++;		}	} else if (m_cCh=='/"' || m_cCh=='/'') {		Data=ReadString();	} else if ((m_cCh>='0' && m_cCh<='9') || FSStrChr("-+.", m_cCh)) {		Data=ReadNumber();	} else if (FSIsLetter(m_cCh)) {		Data=ReadConst();	} else if (!m_cCh) {	} else {		throw CJSONException(FSTSTR("Unknown value type"));	}	OnValReadEnd(szKeyPath, Data);	return Data;}
开发者ID:urdvr,项目名称:vabamorf,代码行数:82,


示例6: tchar

inline CField::operator tchar() const{	return GetChar();}
开发者ID:pyq881120,项目名称:MDBL,代码行数:4,


示例7: TK_Device2PC

 void TK_Device2PC(void) {    int count=0,i=0;	uint16_t len=0;	uint8_t test;			TK_CNANNEL_CONFIG tk_channel_config;	TK_CNANNEL_CONFIG *tkchconfig;	len=sizeof(TK_CNANNEL_CONFIG);				//get magic id	i=0;	count=0; 	while(1)	{			if(kbhit())			{					test=GetChar();			if(test!=MagicId[i++])			{														return;			}			if(i==sizeof(MagicId)) break;		}		else		{						count++;					}		if(count > DELAY_TIME_OUT) return;	} 			i=0;	count=0;	while(i<2)	{	 	if(kbhit())			{			((uint8_t *)&reclen)[i]=GetChar();			i++;		}	}	i=0;	count=0;	while(i<reclen)	{		 if(kbhit())			{			ReceiveBuf[i]=GetChar();			i++;		}	}	SendChars(MagicIdR,sizeof(MagicIdR));	count=0;	switch(ReceiveBuf[0])	{		case OP_AUTO_CHANNEL_CONFIG:		/*Send : MagicidR | len(16) | "START" | progess (5 time) |len<NEXT> (16) */			len=5+sizeof(len);							memcpy(SendBuf+count,&len,sizeof(len));			count+=sizeof(len);			memcpy(SendBuf+count,(uint8_t *)"START",5);			count+=5;			len=sizeof(TK_CNANNEL_CONFIG)+5 /*Used by Progress */;			memcpy(SendBuf+count,&len,2);			count+=sizeof(len);			SendChars((uint8_t *)SendBuf,count);															AutoChannelConfig(ReceiveBuf[1],&final_result);						tk_channel_config.channel=ReceiveBuf[1];								tk_channel_config.base=final_result.base;			tk_channel_config.diff=final_result.diff;			tk_channel_config.current=final_result.current;			tk_channel_config.div=final_result.div;											SendChars((uint8_t *)&tk_channel_config,sizeof(TK_CNANNEL_CONFIG));		break;		case OP_GET_CONFIG:							len=TK_CH_NUM*sizeof(TK_CNANNEL_CONFIG);						memcpy( SendBuf+count,(uint8_t *)&len,sizeof(len));				   	count+=sizeof(len);						for(i=0;i<TK_CH_NUM;i++)						{							tk_channel_config.channel=i;									tk_channel_config.base=cfg[i].base;				tk_channel_config.diff=cfg[i].diff;				tk_channel_config.current=cfg[i].current;				tk_channel_config.div=cfg[i].div;							memcpy(SendBuf+count,(uint8_t *)(&tk_channel_config),sizeof(TK_CNANNEL_CONFIG));				count+=sizeof(TK_CNANNEL_CONFIG);//.........这里部分代码省略.........
开发者ID:bimopraks,项目名称:tinythread,代码行数:101,


示例8: NotInClass

			bool NotInClass(const CharClass & charClass) const { return !charClass.Contains(GetChar()); }
开发者ID:haroldzmli,项目名称:cuboid,代码行数:1,


示例9: Set_Channel_Config

/*! /brief Extract the data packet from QTouch Studio and set channel config. * /note  Should only be called from the command handler. */void Set_Channel_Config(void){	touch_ret_t touch_ret = TOUCH_SUCCESS;#if ((DEF_TOUCH_QDEBUG_ENABLE_QM == 1)      ||/	(DEF_TOUCH_QDEBUG_ENABLE_QTA == 1) ||/	(DEF_TOUCH_QDEBUG_ENABLE_QTB == 1))	sensor_id_t sensor_id;	uint8_t type_aks_pos_hyst;#if (DEF_TOUCH_QDEBUG_ENABLE_QM == 1)	touch_qm_param_t touch_sensor_param;#endif#if ((DEF_TOUCH_QDEBUG_ENABLE_QTA == 1) || (DEF_TOUCH_QDEBUG_ENABLE_QTB == 1))	touch_qt_param_t touch_sensor_param;#endif	sensor_id = GetChar();	/* Read back and initialize the touch_sensor_param structure.	 * This is because not all the touch_sensor_param members are	 * updated by this API. */	touch_ret		= QDEBUG_GET_SENSOR_CONFIG_FUNC(sensor_id,			&touch_sensor_param);	if (touch_ret != TOUCH_SUCCESS) {		while (1) {		}	}	/* Update the necessary members of the touch_sensor_param structure	 * and write back. */	touch_sensor_param.detect_threshold = GetChar();	type_aks_pos_hyst = GetChar();	touch_sensor_param.aks_group		= (aks_group_t)((uint8_t)((type_aks_pos_hyst & 0x38u) >> 3u));	touch_sensor_param.detect_hysteresis		= (hysteresis_t)((uint8_t)(type_aks_pos_hyst & 0x03u));	touch_ret		= QDEBUG_UPDATE_SENSOR_CONFIG_FUNC(sensor_id,			&touch_sensor_param);	if (touch_ret != TOUCH_SUCCESS) {		while (1) {		}	}#endif#if DEF_TOUCH_QDEBUG_ENABLE_AT == 1	sensor_id_t sensor_id;	touch_at_param_t touch_sensor_param;	sensor_id = GetChar();  /* Dummy. To skip sensor_id. */	UNUSED(sensor_id);  /* Dummy. To avoid warning. */	/* Read back and initialize the touch_sensor_param structure.	 * This is because not all the touch_sensor_param members are	 * updated by this API. */	touch_ret = QDEBUG_GET_SENSOR_CONFIG_FUNC(&touch_sensor_param);	if (touch_ret != TOUCH_SUCCESS) {		while (1) {		}	}	/* Update the necessary members of the touch_sensor_param structure	 * and write back. */	touch_sensor_param.sense = GetChar();   /* Sense level (Detect	                                         *Threshold). */	touch_ret = QDEBUG_UPDATE_SENSOR_CONFIG_FUNC(&touch_sensor_param);	if (touch_ret != TOUCH_SUCCESS) {		while (1) {		}	}#endif}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:83,


示例10: AutoChannelConfig

void AutoChannelConfig(uint8_t ch,best_cfg* final_result){	uint16_t div, i;	uint16_t current = 1;	S_TK_CH_CFG ch_cfg = {1, 0, 0xFFFF, 0x0000};	uint8_t sen_level, sen_state,tmp_div;	uint16_t sen_data;		int8_t tmp_score;	uint8_t tmp_cur;	uint8_t progress=0;	final_result->current = 1;	final_result->div = 0;	final_result->base = 0;	final_result->diff = 0;	base_rank[0].val = 0xFFFF;								base_rank[0].div = 0;	base_rank[0].current = 1;	diff_rank[0].val = 0;	diff_rank[0].div = 0;	diff_rank[0].current = 1;				progress=20;			SendChars((uint8_t *)&progress,sizeof(progress));			for(div = 1; div < 12; div++) {							for(current = 1; current <= 15; current++) {					ch_cfg.u8Level = current;					ch_cfg.u8Div = div;					TK_ConfigChannel(ch, &ch_cfg);							result[div][current - 1].level_off = 0;						result[div][current - 1].data_off = 0;												for(i = 0; i < 2; i++) {						complete = 0;						TK_Start(1 << ch);						while(complete != 1);						TK_ReadStatus(&sen_level, &sen_state, NULL);						sen_data = TK_ReadData(ch);						if(sen_state != 0 || sen_data == 0 || sen_data == 0xFFFF) {							result[div][current - 1].level_off = 0;								result[div][current - 1].data_off = 0;							break;						} else {							result[div][current - 1].level_off += sen_level;							result[div][current - 1].data_off += (sen_data >> 1);												}														}					result[div][current - 1].level_off >>= 1;				}			}									progress=40;			SendChars((uint8_t *)&progress,sizeof(progress));			 	while(1)			{					if(kbhit())																	if(GetChar()==progress)																					break;							} 				for(div = 1; div < 12; div++) {								for(current = 1; current <= 15; current++) {					ch_cfg.u8Level = current;					ch_cfg.u8Div = div;					TK_ConfigChannel(ch, &ch_cfg);							result[div][current - 1].level_on = 0;						result[div][current - 1].data_on = 0;										if(result[div][current - 1].level_off == 0)						continue;					for(i = 0; i < 2; i++) {						complete = 0;						TK_Start(1 << ch);						while(complete != 1);						TK_ReadStatus(&sen_level, &sen_state, NULL);						sen_data = TK_ReadData(ch);						if(sen_state != 0 || sen_data == 0 || sen_data == 0xFFFF) {							result[div][current - 1].level_on = 0;								result[div][current - 1].data_on = 0;							break;						} else {							result[div][current - 1].level_on += sen_level;							result[div][current - 1].data_on += (sen_data >> 1);												}														}					result[div][current - 1].level_on >>= 1;				}			}			// calculate sense level, timer divider, and change current score			for(div = 1; div < 12; div++) {				for(current = 1; current <= 15; current++) {					result[div][current - 1].score = 0;//.........这里部分代码省略.........
开发者ID:bimopraks,项目名称:tinythread,代码行数:101,


示例11: Set_Global_Config

/*! /brief Extract the data packet from QTouch Studio and set global config. * /note  Should only be called from the command handler. */void Set_Global_Config(void){	touch_ret_t touch_ret = TOUCH_SUCCESS;#if ((DEF_TOUCH_QDEBUG_ENABLE_QM == 1)      ||/	(DEF_TOUCH_QDEBUG_ENABLE_QTA == 1) ||/	(DEF_TOUCH_QDEBUG_ENABLE_QTB == 1))	touch_global_param_t global_params;	global_params.recal_threshold = (recal_threshold_t)GetChar();	global_params.di = GetChar();	global_params.drift_hold_time = GetChar();	global_params.max_on_duration = GetChar();	global_params.neg_drift_rate = GetChar();	global_params.pos_drift_rate = GetChar();	global_params.pos_recal_delay = GetChar();	/* update the global parameter value inside the uc3l library */	touch_ret = QDEBUG_UPDATE_GLOBAL_PARAM_FUNC(&global_params);	if (touch_ret != TOUCH_SUCCESS) {		while (1) {		}	}#endif#if DEF_TOUCH_QDEBUG_ENABLE_AT == 1	touch_at_param_t touch_sensor_param;	uint8_t dummy_var;	/* Fill touch_sensor_param structure with default values.	 * This is because QTouch Studio does not provide sense and outsense	 * values.  So these values should not be overwritten by the update API.	 * */	touch_ret = QDEBUG_GET_GLOBAL_PARAM_FUNC(&touch_sensor_param);	if (touch_ret != TOUCH_SUCCESS) {		while (1) {		}	}	/* Update data from QTouch Studio. */	touch_sensor_param.pthr = (recal_threshold_t)GetChar();	touch_sensor_param.filter = GetChar();	dummy_var = GetChar();  /* Skip drift_hold_time. */	dummy_var = GetChar();  /* Skip max_on_duration. */	touch_sensor_param.ndrift = GetChar();	touch_sensor_param.pdrift = GetChar();	UNUSED(dummy_var);  /* Dummy. Avoid compiler warning. */	/* update the global parameter value inside the uc3l library */	touch_ret = QDEBUG_UPDATE_GLOBAL_PARAM_FUNC(&touch_sensor_param);	if (touch_ret != TOUCH_SUCCESS) {		while (1) {		}	}#endif}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:63,


示例12: AutoFlow_FunctionRxTest

/*---------------------------------------------------------------------------------------------------------*/void AutoFlow_FunctionRxTest(){    uint32_t u32i;    printf("/n");    printf("+-----------------------------------------------------------+/n");    printf("|     Pin Configure                                         |/n");    printf("+-----------------------------------------------------------+/n");    printf("|  ______                                            _____  |/n");    printf("| |      |                                          |     | |/n");    printf("| |Master|--UART1_TXD(PB.5)  <==>  UART1_RXD(PB.4)--|Slave| |/n");    printf("| |      |--UART1_nCTS(PB.7) <==> UART1_nRTS(PB.6)--|     | |/n");    printf("| |______|                                          |_____| |/n");    printf("|                                                           |/n");    printf("+-----------------------------------------------------------+/n");    printf("/n");    printf("+-----------------------------------------------------------+/n");    printf("|       AutoFlow Function Test (Slave)                      |/n");    printf("+-----------------------------------------------------------+/n");    printf("|  Description :                                            |/n");    printf("|    The sample code needs two boards. One is Master and    |/n");    printf("|    the other is slave. Master will send 1k bytes data     |/n");    printf("|    to slave.Slave will check if received data is correct  |/n");    printf("|    after getting 1k bytes data.                           |/n");    printf("|    Press any key to start...                              |/n");    printf("+-----------------------------------------------------------+/n");    GetChar();    /* Enable RTS and CTS autoflow control */    UART_EnableFlowCtrl(UART1);    /* Set RTS Trigger Level as 8 bytes */    UART1->FCR &= ~UART_FCR_RTS_TRI_LEV_Msk;    UART1->FCR |= UART_FCR_RTS_TRI_LEV_8BYTES;    /* Set RX Trigger Level as 8 bytes */    UART1->FCR &= ~UART_FCR_RFITL_Msk;    UART1->FCR |= UART_FCR_RFITL_8BYTES;    /* Set Timeout time 0x3E bit-time and time-out counter enable */    UART_SetTimeoutCnt(UART1, 0x3E);    /* Enable RDA/RLS/RTO Interrupt  */    UART_EnableInt(UART1, (UART_IER_RDA_IEN_Msk | UART_IER_RLS_IEN_Msk | UART_IER_TOUT_IEN_Msk));    printf("/n Starting to receive data.../n");    /* Wait for receive 1k bytes data */    while(g_i32pointer < RXBUFSIZE);    /* Compare Data */    for(u32i = 0; u32i < RXBUFSIZE; u32i++) {        if(g_u8RecData[u32i] != (u32i & 0xFF)) {            printf("Compare Data Failed/n");            while(1);        }    }    printf("/n Receive OK & Check OK/n");    /* Disable RDA/RLS/RTO Interrupt */    UART_DisableInt(UART1, (UART_IER_RDA_IEN_Msk | UART_IER_RLS_IEN_Msk | UART_IER_TOUT_IEN_Msk));}
开发者ID:OpenNuvoton,项目名称:NUC029xEE,代码行数:65,


示例13: while

bool wxSimpleHtmlParser::EatWhitespace(){    while (!Eof() && IsWhitespace(GetChar(m_pos)))        m_pos ++;    return TRUE;}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:6,


示例14: skapmot

int skapmot(void) {    struct ShortUser *shortUser;    int mad, setPermission, changed, ch, i, fidoDomainId, highestId;    struct FidoDomain *fidoDomain;    BPTR lock;    struct User user;    struct Mote tmpConf,*searchConf,*newConf;    memset(&tmpConf, 0, sizeof(struct Mote));    if(argument[0] == '/0') {        SendString("/r/n/nNamn p
C++ GetCharHeight函数代码示例
C++ GetChanceAgainst函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。