Update E53_ST1.c
This commit is contained in:
@@ -116,7 +116,6 @@ void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle)
|
||||
HAL_GPIO_Init(ST1_Beep_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM16_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM16_MspPostInit 1 */
|
||||
}
|
||||
|
||||
@@ -225,7 +224,7 @@ void Init_E53_ST1(void)
|
||||
* 函数名称: NMEA_Comma_Pos
|
||||
* 函数功能:从buf里面得到第cx个逗号所在的位置
|
||||
* 输入值:
|
||||
* 返回值:0~0xFE,代表逗号所在位置的便宜
|
||||
* 返回值:0~0xFE,代表逗号所在位置偏移
|
||||
* 0xFF,代表不存在第cx个逗号
|
||||
\***************************************************/
|
||||
|
||||
@@ -308,7 +307,7 @@ void NMEA_BDS_GPRMC_Analysis(gps_msg *gpsmsg,uint8_t *buf)
|
||||
uint8_t posx;
|
||||
uint32_t temp;
|
||||
float rs;
|
||||
p4=(uint8_t*)strstr((const char *)buf,"$GPRMC");//"$GPRMC",经常有&和GPRMC分开的情况,故只判断GPRMC.
|
||||
p4=(uint8_t*)strstr((const char *)buf,"$GPRMC"); //"$GPRMC",经常有&和GPRMC分开的情况,故只判断GPRMC.
|
||||
posx=NMEA_Comma_Pos(p4,3); //得到纬度
|
||||
if(posx!=0XFF)
|
||||
{
|
||||
@@ -325,7 +324,7 @@ void NMEA_BDS_GPRMC_Analysis(gps_msg *gpsmsg,uint8_t *buf)
|
||||
temp=NMEA_Str2num(p4+posx,&dx);
|
||||
gpsmsg->longitude_bd=temp/NMEA_Pow(10,dx+2); //得到°
|
||||
rs=temp%NMEA_Pow(10,dx+2); //得到'
|
||||
gpsmsg->longitude_bd=gpsmsg->longitude_bd*NMEA_Pow(10,5)+(rs*NMEA_Pow(10,5-dx))/60;//转换为°
|
||||
gpsmsg->longitude_bd=gpsmsg->longitude_bd*NMEA_Pow(10,5)+(rs*NMEA_Pow(10,5-dx))/60; //转换为°
|
||||
}
|
||||
posx=NMEA_Comma_Pos(p4,6); //东经还是西经
|
||||
if(posx!=0XFF)gpsmsg->ewhemi_bd=*(p4+posx);
|
||||
@@ -346,8 +345,8 @@ void E53_ST1_Read_Data(void)
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* 函数名称: E53SF1_LED_StatusSet
|
||||
* 说 明: E53SF1开发板上的LED灯的亮灭控制
|
||||
* 函数名称: E53_ST1_LED_StatusSet
|
||||
* 说 明: E53 ST1开发板上的LED灯的亮灭控制
|
||||
* 参 数: status,LED灯的状态
|
||||
* 非1,关灯
|
||||
* 1,开灯
|
||||
@@ -359,8 +358,8 @@ void E53_ST1_LED_StatusSet(E53ST1_Status_ENUM status)
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* 函数名称: E53SF1_BEEP
|
||||
* 说 明: E53SF1蜂鸣器报警与否
|
||||
* 函数名称: E53_ST1_Beep
|
||||
* 说 明: E53 ST1蜂鸣器报警与否
|
||||
* 参 数: status,LED_ENUM枚举的数据
|
||||
* LED_OFF,关灯
|
||||
* LED_ON,开灯
|
||||
@@ -374,4 +373,3 @@ void E53_ST1_Beep(E53ST1_Status_ENUM status)
|
||||
HAL_TIM_PWM_Stop(&htim16,TIM_CHANNEL_1);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user