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

📄 predictools.c

📁 在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LEA_4S的驱动,位置速寻算法,语音芯片ISD4004的录放音驱动,LED页面管理等等.从启动代码到操作系统的移植以及到业
💻 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 + -