|
@@ -14,6 +14,7 @@ uint32 location_handle(char *in1);
|
|
void GpsDataDecode(uint8 *msg);
|
|
void GpsDataDecode(uint8 *msg);
|
|
uint8 GpsRecvPtr[1024];
|
|
uint8 GpsRecvPtr[1024];
|
|
uint32 timerCounterGetdata = 0;
|
|
uint32 timerCounterGetdata = 0;
|
|
|
|
+uint32 LedCounter = 0;
|
|
static void vtimerCallback(TimerHandle_t pxTimer)
|
|
static void vtimerCallback(TimerHandle_t pxTimer)
|
|
{
|
|
{
|
|
uint32 ulTimerID;
|
|
uint32 ulTimerID;
|
|
@@ -44,6 +45,19 @@ void GpsTask(void *pvParameters)
|
|
{
|
|
{
|
|
GpsDataDecode(GpsRecvPtr);
|
|
GpsDataDecode(GpsRecvPtr);
|
|
}
|
|
}
|
|
|
|
+ /*LED控制*/
|
|
|
|
+ if(timerCounterGetdata - LedCounter>200)
|
|
|
|
+ {
|
|
|
|
+ LedCounter = timerCounterGetdata;
|
|
|
|
+ if(DeviceSpeed>0)
|
|
|
|
+ {
|
|
|
|
+ Dio_FlipChannel(DioConf_DioChannel_PTE9_GPIO_OUT_MCU_LED5);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ Dio_WriteChannel(DioConf_DioChannel_PTE9_GPIO_OUT_MCU_LED5,STD_OFF);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if (timerCounterGetdata % 10 == 0)
|
|
if (timerCounterGetdata % 10 == 0)
|
|
{
|
|
{
|
|
SL_SC7A20_Read_XYZ_Data(xyzData);
|
|
SL_SC7A20_Read_XYZ_Data(xyzData);
|
|
@@ -95,8 +109,7 @@ void GpsDataDecode(uint8 *msg)
|
|
strdel(databuffer[5], '.');
|
|
strdel(databuffer[5], '.');
|
|
strdel(databuffer[7], '.');
|
|
strdel(databuffer[7], '.');
|
|
speedtemp = atol(databuffer[7]) * 1852 / 1e5; //节换算单位,1节=1.852km每小时
|
|
speedtemp = atol(databuffer[7]) * 1852 / 1e5; //节换算单位,1节=1.852km每小时
|
|
- GpsInfoData.speed[0] = (speedtemp >> 8) & 0xFF;
|
|
|
|
- GpsInfoData.speed[1] = speedtemp & 0xFF;
|
|
|
|
|
|
+ DeviceSpeed = speedtemp+1;
|
|
latitude = location_handle(databuffer[3]);
|
|
latitude = location_handle(databuffer[3]);
|
|
GpsInfoData.latitude[0] = latitude >> 24;
|
|
GpsInfoData.latitude[0] = latitude >> 24;
|
|
GpsInfoData.latitude[1] = latitude >> 16;
|
|
GpsInfoData.latitude[1] = latitude >> 16;
|
|
@@ -112,11 +125,15 @@ void GpsDataDecode(uint8 *msg)
|
|
direction = atol(databuffer[8]);
|
|
direction = atol(databuffer[8]);
|
|
GpsInfoData.direction[0] = direction >> 8;
|
|
GpsInfoData.direction[0] = direction >> 8;
|
|
GpsInfoData.direction[1] = direction;
|
|
GpsInfoData.direction[1] = direction;
|
|
|
|
+ GpsInfoData.speed[0] = (speedtemp >> 8) & 0xFF;
|
|
|
|
+ GpsInfoData.speed[1] = speedtemp & 0xFF;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- GpsInfoData.direction[0] = 0xff;
|
|
|
|
- GpsInfoData.direction[1] = 0xff;
|
|
|
|
|
|
+ GpsInfoData.direction[0] = 0;
|
|
|
|
+ GpsInfoData.direction[1] = 0;
|
|
|
|
+ GpsInfoData.speed[0] = 0;
|
|
|
|
+ GpsInfoData.speed[1] = 0;
|
|
}
|
|
}
|
|
if (speedtemp >= 50 && speedtemp <= 1500)
|
|
if (speedtemp >= 50 && speedtemp <= 1500)
|
|
{
|
|
{
|
|
@@ -128,6 +145,10 @@ void GpsDataDecode(uint8 *msg)
|
|
}
|
|
}
|
|
}//累计里程的累加
|
|
}//累计里程的累加
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ DeviceSpeed = 0;
|
|
|
|
+ }
|
|
GpsInfoData.AccMileage[0] = AppConfigInfo.AppDataInfo.AccMileage >> 24;
|
|
GpsInfoData.AccMileage[0] = AppConfigInfo.AppDataInfo.AccMileage >> 24;
|
|
GpsInfoData.AccMileage[1] = AppConfigInfo.AppDataInfo.AccMileage >> 16;
|
|
GpsInfoData.AccMileage[1] = AppConfigInfo.AppDataInfo.AccMileage >> 16;
|
|
GpsInfoData.AccMileage[2] = AppConfigInfo.AppDataInfo.AccMileage >> 8;
|
|
GpsInfoData.AccMileage[2] = AppConfigInfo.AppDataInfo.AccMileage >> 8;
|