downtimes.c

来自「在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LE」· C语言 代码 · 共 53 行

C
53
字号
/****************************************************************
**                                                              *
**  FILE         :  DownTimes.C                                   *
**  COPYRIGHT    :  (c) 2001 .Xiamen Yaxon NetWork CO.LTD       *
**                                                              *
**                                                              *
**  By : qzc 2004.10.08                                          *
****************************************************************/
#include "includes.h"
#include "public.h"
#include "tools.h"
#include "ItemMenu.h"
#include "Prompt.h"

#if EN_HANDSET > 0

static PROMPT_STRUCT DownTimesPrompt;
static buf[2];

static void GetDownTimes(void)
{
	if(PubParaValid(DOWNTIMES_))
	 {
	 	//buf[0]=downtimes.times;
	 	HexToAscii((INT8U *)buf, (INT8U *)&downtimes.times, 1);
		DownTimesPrompt.Mode        = 0;
    	DownTimesPrompt.LiveTime    = 0;
    	DownTimesPrompt.TextPtr     = (INT8U *)buf;
    	DownTimesPrompt.TextLen     = sizeof(buf);
    	DownTimesPrompt.ExitProc    = 0;
    	DownTimesPrompt.ExitKeyProc = 0;
    	ActivatePrompt(&DownTimesPrompt);
	 }
	else ActivateStringPrompt("数据无效");
}

static void ClearTimes(void)
{
	downtimes.times = 0;
	StorePubPara(DOWNTIMES_);
	ActivateStringPrompt("清楚完毕");
}

static ITEMMENU_STRUCT MENU_CHECK	= {ITEM_FCN,  "查看",GetDownTimes,0,0};
static ITEMMENU_STRUCT MENU_CLEAR	= {ITEM_FCN,  "清除",ClearTimes,0,0};

static ITEMMENU_STRUCT *MENU_DOWNTIMES_CHILD[] = { &MENU_CHECK,
																	&MENU_CLEAR
																 };

ITEMMENU_STRUCT MENU_DOWNTIMES = {ITEM_FMENU,"RAM掉电次数",0,2,MENU_DOWNTIMES_CHILD};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?