📄 predictools.c
字号:
/****************************************************************
** *
** FILE : PredicTools.c *
** *
** By : Cyb 2007.01.05 *
****************************************************************/
#include "includes.h"
#include "errcode.h"
#include "errtask.h"
#include "tools.h"
#include "public.h"
#include "GpsTool.h"
#include "flash.h"
#include "portdrv.h"
#include "SimuSteer.h"
#include "GpsRecer.h"
#include "Flash.h"
#include "SimuSteer.h"
#include "PredicTools.h"
#define LEDPARA_GPSVALID PORT_LEDGREEN,10,10
static BOOLEAN LedParaSet;
BOOLEAN IsWorkAuto(void)
{
if(( GetSimuStatus() ==SIMU_OPEN_)||(GpsDataValid()))
{
return TRUE;
}
else
{
return FALSE;
}
}
void DirectorbyLedLight(void)
{
if (IsWorkAuto())
{
if(!LedParaSet)
{
LedParaSet = TRUE;
InstallPermnentPort(LEDPARA_GPSVALID);
}
}
else
{
if(LedParaSet)
{
LedParaSet = FALSE;
RemovePermnentPort(PORT_LEDGREEN);
}
}
}
BOOLEAN GetGpsData(DATUM_STRUCT *datum)
{
if(GetSimuStatus() == SIMU_OPEN_)
{
GetSimuData(datum);
}
else
{
if(!GpsDataValid())
{
return FALSE;
}
GetDatumData(datum);
}
return TRUE;
}
void GetCurTime_Time(TIME_STRUCT *time)
{
if(GetSimuStatus()== SIMU_OPEN_)
{
GetSimuTime_Time((INT8U *)time);
}
else
{
GetSysTime_Time(time);
}
}
void InitLedLightPara(void)
{
LedParaSet = FALSE;
}
INT16U CountObjectDots(INT16U type)
{
INT16U nums;
ReadTableCellFromFlash(type,0,0,(INT8U*)&nums);
if (nums == 0xFFFF)
{
return 0;
}
return nums;
}
INT16U GetLastPot(CELL_STRUCT *cell, INT16U index)
{
return cell[index].last;
}
INT16U GetCurPot(CELL_STRUCT *cell, INT16U index)
{
return cell[index].cur;
}
INT16U GetNextPot(CELL_STRUCT *cell,INT16U index)
{
return cell[index].next;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -