|
@@ -29,6 +29,7 @@
|
|
|
#include "MainTask.h"
|
|
|
#include "GpsTask.h"
|
|
|
#include "TcpTask.h"
|
|
|
+#include "Signal.h"
|
|
|
//全局变量区输入
|
|
|
extern volatile BOOL Sleep_flag;
|
|
|
extern AppDataBody AppDataInfo;
|
|
@@ -37,7 +38,7 @@ extern UINT8 WorkFlag;
|
|
|
UINT8 GpsData[20];
|
|
|
osMutexId_t GpsMutex = NULL;
|
|
|
//线程定义区
|
|
|
-#define GPS_TASK_STACK_SIZE (512)
|
|
|
+#define GPS_TASK_STACK_SIZE (1024)
|
|
|
static QueueHandle_t norGpsHandle = NULL;
|
|
|
static osThreadId_t gpsTaskHandle = NULL;
|
|
|
static StaticTask_t gpsTask = NULL;
|
|
@@ -46,9 +47,15 @@ static UINT8 gpsTaskStack[GPS_TASK_STACK_SIZE];
|
|
|
//函数声明区
|
|
|
void strdel(char * str,char c);
|
|
|
UINT32 location_handle(char *in1);
|
|
|
-
|
|
|
+UINT8 Aoi1Event = 0;
|
|
|
+UINT8 Aoi2Event = 0;
|
|
|
static void GpsTask(void* arg)
|
|
|
{
|
|
|
+ UINT8 xyzCounter = 0;
|
|
|
+ INT16 xData[3] = {0};
|
|
|
+ INT16 yData[3] = {0};
|
|
|
+ INT16 zData[3] = {0};
|
|
|
+ INT16 xyzData[3] = {0};
|
|
|
gpsReqMsg msg;
|
|
|
char *p=NULL;
|
|
|
const char *delim = "\n";
|
|
@@ -66,7 +73,7 @@ static void GpsTask(void* arg)
|
|
|
while(1)
|
|
|
{
|
|
|
//char temp[] = "$GNRMC,082626.000,A,2939.91801,N,10637.09500,E,0.543,30.254,261120,,,A,V*17";
|
|
|
- osStatus_t ret = osMessageQueueGet(norGpsHandle, &msg, 0, osWaitForever);
|
|
|
+ osStatus_t ret = osMessageQueueGet(norGpsHandle, &msg, 0, 100);
|
|
|
if(ret==0)
|
|
|
{
|
|
|
if (msg.dataPtr)
|
|
@@ -147,6 +154,28 @@ static void GpsTask(void* arg)
|
|
|
free(msg.dataPtr);
|
|
|
msg.dataPtr=NULL;
|
|
|
}
|
|
|
+ if(Aoi1Event||Aoi2Event||Timer_count%10==0)
|
|
|
+ {
|
|
|
+ Aoi1Event=0;
|
|
|
+ Aoi2Event=0;
|
|
|
+ //SL_SC7A20_Reg_read_all();
|
|
|
+ UINT8 ret = SL_SC7A20_Read_XYZ_Data(xyzData);
|
|
|
+ xData[xyzCounter] = xyzData[0];
|
|
|
+ yData[xyzCounter] = xyzData[1];
|
|
|
+ zData[xyzCounter] = xyzData[2];
|
|
|
+ xyzCounter++;
|
|
|
+ if(xyzCounter>3)
|
|
|
+ {
|
|
|
+ xyzCounter=0;
|
|
|
+ }
|
|
|
+ xzyDataSend[0] = (xData[0] + xData[1] + xData[2])/3;
|
|
|
+ xzyDataSend[1] = (yData[0] + yData[1] + yData[2])/3;
|
|
|
+ xzyDataSend[2] = (zData[0] + zData[1] + zData[2])/3;
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("\n%d %d %d \r\n", xzyDataSend[0],xzyDataSend[1],xzyDataSend[2]);
|
|
|
+ #endif
|
|
|
+
|
|
|
+ }
|
|
|
if (Sleep_flag)
|
|
|
{
|
|
|
posGGAServiceStop();
|