⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gps_moto_ea_interpreter.c

📁 uCOS2 for 51系列
💻 C
📖 第 1 页 / 共 2 页
字号:
													case 2	:	break;
													case 3	:	current_state = GPS_MOTO_Ea_SPEED_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;			

//*********************************************************************************************************
//**************************************	seg spd.value 	***********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_SPEED_SEG			:	switch(cnt)
												{
													case 0	:	gpsdata_buf.spd.value = rx<<8;
																break;
													case 1	:	gpsdata_buf.spd.value += rx;
																current_state = GPS_MOTO_Ea_SPEED_DIR_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;				
//**************************************	seg spd.dir 	***********************************************
		case GPS_MOTO_Ea_SPEED_DIR_SEG		:	switch(cnt)
												{
													case 0	:	gpsdata_buf.spd.dir = rx<<8;
																break;
													case 1	:	gpsdata_buf.spd.dir += rx;
																current_state = GPS_MOTO_Ea_GEOMETRY_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;
					
//*********************************************************************************************************
//***********************************		seg geometry	  *********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_GEOMETRY_SEG		:	switch(cnt)
												{
													case 0	:	break;
													case 1	:	break;
													case 2	:	current_state = GPS_MOTO_Ea_SAT_STATE_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;	
//*********************************************************************************************************
//**************************************	seg mag.value 	***********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_SAT_STATE_SEG		:	switch(cnt)
												{
													case 0	:	gpsdata_buf.sat_state.visible = rx;
																break;
													case 1	:	gpsdata_buf.sat_state.tracked = rx;
																current_state = GPS_MOTO_Ea_CHANEL_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;			
//*********************************************************************************************************
//***************************************	seg chanel info 	*******************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_CHANEL_SEG			:	switch(cnt)
												{
													case 0	:	gpsdata_buf.chanel_state[0].sat_NO = rx;
																break;
													case 1	:	gpsdata_buf.chanel_state[0].track_mode = rx;
																break;
													case 2	:	gpsdata_buf.chanel_state[0].CN = rx;
																break;
													case 3	:	gpsdata_buf.chanel_state[0].chanel_state = rx;
																break;

													case 4	:	gpsdata_buf.chanel_state[1].sat_NO = rx;
																break;
													case 5	:	gpsdata_buf.chanel_state[1].track_mode = rx;
																break;
													case 6	:	gpsdata_buf.chanel_state[1].CN = rx;
																break;
													case 7	:	gpsdata_buf.chanel_state[1].chanel_state = rx;
																break;

													case 8	:	gpsdata_buf.chanel_state[2].sat_NO = rx;
																break;
													case 9	:	gpsdata_buf.chanel_state[2].track_mode = rx;
																break;
													case 10	:	gpsdata_buf.chanel_state[2].CN = rx;
																break;
													case 11	:	gpsdata_buf.chanel_state[2].chanel_state = rx;
																break;

													case 12	:	gpsdata_buf.chanel_state[3].sat_NO = rx;
																break;
													case 13	:	gpsdata_buf.chanel_state[3].track_mode = rx;
																break;
													case 14	:	gpsdata_buf.chanel_state[3].CN = rx;
																break;
													case 15	:	gpsdata_buf.chanel_state[3].chanel_state = rx;
																break;

													case 16	:	gpsdata_buf.chanel_state[4].sat_NO = rx;
																break;
													case 17	:	gpsdata_buf.chanel_state[4].track_mode = rx;
																break;
													case 18	:	gpsdata_buf.chanel_state[4].CN = rx;
																break;
													case 19	:	gpsdata_buf.chanel_state[4].chanel_state = rx;
																break;

													case 20	:	gpsdata_buf.chanel_state[5].sat_NO = rx;
																break;
													case 21	:	gpsdata_buf.chanel_state[5].track_mode = rx;
																break;
													case 22	:	gpsdata_buf.chanel_state[5].CN = rx;
																break;
													case 23	:	gpsdata_buf.chanel_state[5].chanel_state = rx;
																break;

													case 24	:	gpsdata_buf.chanel_state[6].sat_NO = rx;
																break;
													case 25	:	gpsdata_buf.chanel_state[6].track_mode = rx;
																break;
													case 26	:	gpsdata_buf.chanel_state[6].CN = rx;
																break;
													case 27	:	gpsdata_buf.chanel_state[6].chanel_state = rx;
																break;

													case 28	:	gpsdata_buf.chanel_state[7].sat_NO = rx;
																break;
													case 29	:	gpsdata_buf.chanel_state[7].track_mode = rx;
																break;
													case 30	:	gpsdata_buf.chanel_state[7].CN = rx;
																break;
													case 31	:	gpsdata_buf.chanel_state[7].chanel_state = rx;
																current_state = GPS_MOTO_Ea_STATE_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;
//*********************************************************************************************************
//***************************************	seg active satae  *********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_STATE_SEG		:		switch(cnt)
												{
													case 0	:	gpsdata_buf.state = rx;
																current_state = GPS_MOTO_Ea_CHECKSUM_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;			
	
//*********************************************************************************************************
//******************************************	seg checksum	*******************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_CHECKSUM_SEG		:	switch(cnt)
												{
													case 0	:	gpsdata_buf.checksum = rx ;
																current_state = GPS_MOTO_Ea_END_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;

	}

	if(current_state != GPS_MOTO_Ea_END_SEG)
		checksum ^= rx;

	if(current_state == GPS_MOTO_Ea_END_SEG)
	{
		if(checksum == gpsdata_buf.checksum)
			memcpy(&GpsData,&gpsdata_buf,sizeof(GPS_DATA));

		seg_offset = 0;
		checksum = 0;
		current_state = GPS_MOTO_TYPE_SEG;
	}



}


/*********************************************************************************************************
                            End Of File
**********************************************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -