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

📄 gps_moto_ea_interpreter.c

📁 uCOS2 for 51系列
💻 C
📖 第 1 页 / 共 2 页
字号:
/*********************************************************************************************************
**				                       uC/OS 2 FOR PHILIP LPC21XX
**                                   The Real-Time Kernel(For ADS1.2)
**
**                                  
**                                                V0.00.1
**
**
**--------------文件信息--------------------------------------------------------------------------------
**文   件   名: GPS_MOTO_Ea_Interpreter.H
**创   建   人: 龚树强
**最后修改日期: 2005年8月20日
**描        述: GPS_MOTO_Ea_Interpreter函数声明头文件
**
**--------------历史版本信息----------------------------------------------------------------------------
** 创建人: 龚树强
** 版  本: V0.01.1
** 日 期: 2005年8月20日
** 描 述: 原始版本
**
**------------------------------------------------------------------------------------------------------
** 修改人: 
** 版  本: 
** 日 期: 
** 描 述: 
**
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/


#include "..\source\Includes.h"

#include "..\driver\Drv_GPS\GPS_MOTO_Ea_Interpreter.h"


/*******************************************************************************
*********************			常	量	定	义			************************
********************************************************************************/


/*******************************************************************************
*********************			变	量	定	义			************************
********************************************************************************/
 
extern	INT8U 		current_state,seg_offset,checksum;

extern	GPS_DATA	gpsdata_buf;


/*********************************************************************************************************
** 函数名称: GPS_MOTO_Ea_Interpreter
** 功能描述: GPS MOTO格式Ea包解释函数
** 输 入: 无
** 输 出: 无
** 全局变量: 无
** 调用模块: 无
**
** 作 者: 龚树强
** 日 期: 2005年1月3日
**-------------------------------------------------------------------------------------------------------
** 修改人:
** 日 期:
**-------------------------------------------------------------------------------------------------------
********************************************************************************************************/ 

 		void	GPS_MOTO_Ea_Interpreter(INT8U rx,INT8U *prx_counter)		reentrant
{
	INT8U	cnt;

	cnt = *prx_counter - seg_offset;

	switch(current_state)
	{
		case GPS_MOTO_TYPE_SEG			:		current_state = GPS_MOTO_Ea_DATE_SEG;
												seg_offset = *prx_counter;
												cnt = *prx_counter - seg_offset;

//*********************************************************************************************************
//**************************************	seg date.date 	***********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_DATE_SEG		:		switch(cnt)
												{
													case 0	:	gpsdata_buf.date.month = rx;
																break;
//**************************************	seg date.month 	**********************************************
													case 1	:	gpsdata_buf.date.date = rx;
																break;
//**************************************	seg date.year 	**********************************************
													case 2	:	gpsdata_buf.date.year = rx<<8;
																break;
													case 3	:	gpsdata_buf.date.year += rx;

																current_state = GPS_MOTO_Ea_TIME_SEG;
																seg_offset = *prx_counter + 1;
																break;
											  	}
												break;
//*********************************************************************************************************
//***********************************	seg time.hour 	************************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_TIME_SEG		:		switch(cnt)
												{
													case 0	:	gpsdata_buf.time.hour = rx;
																break;
//***********************************	seg time.min 	************************************************
													case 1	:	gpsdata_buf.time.min = rx;
																break;
//***********************************	seg time.sec 	************************************************
													case 2	:	gpsdata_buf.time.sec = rx;
																break;
//***********************************	seg time.msec 	************************************************
													case 3	:	gpsdata_buf.time.msec = rx<<8;
																break;
													case 4	:	gpsdata_buf.time.msec += rx;
																break;
													case 5	:	gpsdata_buf.time.msec += rx<<8;
																break;
													case 6	:	gpsdata_buf.time.msec += rx;
																	
																current_state = GPS_MOTO_Ea_LATITUDE_SEG;
																seg_offset = *prx_counter + 1;
																break;
											  	}
												break;
//*********************************************************************************************************
//**********************************	seg latitude.dec 	***********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_LATITUDE_SEG	:		switch(cnt)
												{
													case 0	:	gpsdata_buf.latitude.mmin = rx;
																break;
													case 1	:	gpsdata_buf.latitude.mmin += rx<<8;
																break;
													case 2	:	gpsdata_buf.latitude.min = rx;
																break;
													case 3	:	gpsdata_buf.latitude.dec = rx;
																current_state = GPS_MOTO_Ea_LONGTITUDE_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;			


//*********************************************************************************************************
//**********************************	seg longitude.dec 	***********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_LONGTITUDE_SEG	:		switch(cnt)
												{
													case 0	:	gpsdata_buf.longitude.mmin = rx;
																break;
													case 1	:	gpsdata_buf.longitude.mmin += rx<<8;
																break;
													case 2	:	gpsdata_buf.longitude.min = rx;
																break;
													case 3	:	gpsdata_buf.longitude.dec = rx;
																current_state = GPS_MOTO_Ea_ALTITUDE_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;			

//*********************************************************************************************************
//**************************************	seg altitude	***********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_ALTITUDE_SEG	:		switch(cnt)
												{
													case 0	:	gpsdata_buf.altitude = (INT32U)rx<<24;
																break;
													case 1	:	gpsdata_buf.altitude += (INT32U)rx<<16;
																break;
													case 2	:	gpsdata_buf.altitude += (INT32U)rx<<8;
																break;
													case 3	:	gpsdata_buf.altitude += (INT32U)rx;
																current_state = GPS_MOTO_Ea_NOTUSE_SEG;
																seg_offset = *prx_counter + 1;
																break;
												}
												break;			

//*********************************************************************************************************
//**********************************	seg not used	 	***********************************************
//*********************************************************************************************************
		case GPS_MOTO_Ea_NOTUSE_SEG		:		switch(cnt)
												{
													case 0	:	
													case 1	:	

⌨️ 快捷键说明

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