예제 #1
0
 static void AutoPowerDown()
{
	long set_date;
	char set_buf[16];
	 uchar temp;
	Disp_Clear();
	set_date=Inputdate("请输入自动关机时间(秒) ",0,set_buf,0,3,-1,-1);
	
	if(set_date!=-1)
	{
	    temp=*((uchar*)&set_date+1);          
		WriteParameter(E_AutoSleepAddr,&temp,1);
		temp=*((uchar*)&set_date);
		WriteParameter(E_AutoSleepAddr+1,&temp,1);
		memset(set_buf,0x00,16);
		memset(set_buf,0x00,16);
		sprintf(set_buf,"自动关机时间为%d秒",set_date);
		DispStr_CE(0,4,set_buf,DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		delay_and_wait_key (DISP_OK_DELAY_TIME,EXIT_KEY_F1,120);
		WaringBeep(OK_WARNING_BEEP);
		Sys_Auto_Poweroff_Set((ushort)temp);
	}
	else
	{
		DispStr_CE(0,4,"取消输入! ",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		WaringBeep(ERR_WARNING_BEEP);
		delay_and_wait_key (DISP_ESC_DELAY_TIME,EXIT_KEY_F1,120);
	}
	return ;
	
}
예제 #2
0
static void SetKeyBoard()
{
	char str[]=" 1.按键音开启"
			  " 2.按键音关闭";
	int select;
	uchar DateBuf;
	BROWINFO bi;
	bi.lPtr = 0;
	bi.cPtr = 0;
	bi.iStr = str;
	while(1)
	{
	   DispStr_CE(0,1,"按键音设置菜单",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
	   bi.mInt=2;//显示总行数
	   bi.lineMax=13;//每行显示最大字符数 
	   bi.startLine=3;//起始行 
	   bi.dispLines=2;//
	   bi.sFont=0;	//0 -大字体
	   bi.numEnable=1;//是否允许键盘方向键 1-允许
	   bi.qEvent=(EXIT_KEY_F1);
	   bi.autoexit =120;
		 
	   select=EXT_Brow_Select(&bi);
	   switch(select)
	   {
		  case 0:
				DateBuf=1;
			   G_KeySound=1;
			   KEY_Init(KEY_BEEP_KEY|KEY_AUTO_EL_ON);
			   WriteParameter(E_KeySondAddr,&DateBuf,1);
			   DispStr_CE(0,4,"按键音已开启",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
			   delay_and_wait_key (DISP_OK_DELAY_TIME,EXIT_KEY_F1,120);
			   WaringBeep(OK_WARNING_BEEP);
			   break;
		  case 1:
			   DateBuf=0;
			   G_KeySound=0;
			   KEY_Init(KEY_AUTO_EL_ON);
			   WriteParameter(E_KeySondAddr,&DateBuf,1);
			   DispStr_CE(0,4,"按键音已关闭",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
			   delay_and_wait_key (DISP_OK_DELAY_TIME,EXIT_KEY_F1,120);
			   WaringBeep(OK_WARNING_BEEP);
			   break;
		  default :
			   return;
	   }
	 }
}
예제 #3
0
static void SetElAutoTime()
{
	long set_date;
	char set_buf[16];
	uchar temp;
	Disp_Clear();
	set_date=Inputdate("请输入背光持续时间(秒) ",0,set_buf,0,2,-1,-1);
	
	if(set_date!=-1)
	{
	    temp=(uchar)set_date;          
		WriteParameter(E_AutoElCloseAddr,&temp,1);
		memset(set_buf,0x00,16);
		sprintf(set_buf,"背光持续时间为%d秒",set_date);
		DispStr_CE(0,4,set_buf,DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		delay_and_wait_key (DISP_OK_DELAY_TIME,EXIT_KEY_F1,120);
		WaringBeep(OK_WARNING_BEEP);
		EL_Set_Timeout((ushort)temp);
	}
	else
	{
		DispStr_CE(0,4,"取消输入! ",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		WaringBeep(ERR_WARNING_BEEP);
		delay_and_wait_key (DISP_ESC_DELAY_TIME,EXIT_KEY_F1,120);
	}
	
	return ;
}
예제 #4
0
/********************************************************************************************

  >	INT32 HTMLExportFilter::WriteParameter(UINT32 uiParameter, UINT32 uiValue, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

	Author:		Graham_Walmsley (Xara Group Ltd) <*****@*****.**>
	Created:	18/4/97
	Inputs:		uiParameter		The resource of the parameter to write (e.g. SHAPE)
				uiValue			The resource of the value of the parameter (e.g. RECTANGLE)
				pfileToWrite	The file to write to (may be NULL)
				pcBuffer		The text buffer to write to (may be NULL)
	Returns:	The number of TCHARs written
	Purpose:	Writes out a parameter, e.g. SHAPE=RECTANGLE

********************************************************************************************/
INT32 HTMLExportFilter::WriteParameter(UINT32 uiParameter, UINT32 uiValue, CCLexFile* pfileToWrite, TCHAR* pcBuffer)
{
	//Get our two strings
	String_256 strParameterToWrite(uiParameter);
	String_256 strValueToWrite(uiValue);
	
	//Then call our sister function to write out the string
	return WriteParameter((TCHAR*) strParameterToWrite, (TCHAR*) strValueToWrite, pfileToWrite, pcBuffer);
}
static
bool
WriteParameter(BFile& file, const BMessage& parameter, int32 level)
{
	const char *name;
	if(parameter.FindString(MDSU_NAME, &name) != B_OK || !name)
		return false;
	
	BString line, word(name);
	EscapeWord(word);
	bool needsEscaping = word.FindFirst(' ') >= 0;
	line.SetTo('\t', level);
	if(needsEscaping)
		line << '\"';
	line << word;
	if(needsEscaping)
		line << '\"';
	
	for(int32 index = 0; parameter.FindString(MDSU_VALUES, index, &name) == B_OK;
			index++)
		if(name) {
			line << ' ';
			word = name;
			EscapeWord(word);
			needsEscaping = word.FindFirst(' ') >= 0;
			if(needsEscaping)
				line << '\"';
			line << word;
			if(needsEscaping)
				line << '\"';
		}
	
	type_code type;
	int32 parameterCount;
	parameter.GetInfo(MDSU_PARAMETERS, &type, &parameterCount);
	
	if(parameterCount > 0)
		line << " {";
	
	line << '\n';
	file.Write(line.String(), line.Length());
	
	if(parameterCount > 0) {
		BMessage subParameter;
		for(int32 index = 0; parameter.FindMessage(MDSU_PARAMETERS, index,
				&subParameter) == B_OK; index++)
			WriteParameter(file, subParameter, level + 1);
		
		line.SetTo('\t', level);
		line << "}\n";
		file.Write(line.String(), line.Length());
	}
	
	return true;
}
예제 #6
0
static void SetLocalSite()
{
	char site_str[]=" ";
	char site_pstr[10];
	int ret;
	char tempstr[16];
	GETSTR_PARAM g_Site;
	g_Site.qx=100;//提示语句x坐标
     g_Site.qy=12;//提示语句y坐标
     g_Site.pPrompt=site_str;//提示语句缓冲区的指针
     g_Site.sFont=0;//0:使用7x9的大字体
     g_Site.alpha=0;//0:不允许输入字母、符号
     g_Site.nullEnable=0;//0:不允许无输入按Enter返回
     g_Site.pStr=site_pstr;//输入时存放初始默认字符串,函数退出是存放键入的字符串。
     g_Site.csChar='_';//光标显示字符
     g_Site.pwChar=0;//密码显示字符,为0则无效
     g_Site.minNum=0; //最少接收的字符个数
     g_Site.spChar='.';//数字分隔符
     g_Site.maxNum=3;
     g_Site.minValue=-1;
     g_Site.maxValue=255;
     g_Site.retNum=strlen(site_pstr);
     g_Site.qEvent=EXIT_KEY_F1;
	 DispStr_CE(0,8,"请输入本机站点号(0~255)",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
     if(GetStr_E(&g_Site))
     {
     	DispStr_CE(0,12,"取消设置!",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		delay_and_wait_key (DISP_ESC_DELAY_TIME,EXIT_KEY_F1,120);
		WaringBeep(ERR_WARNING_BEEP);
		return;
	 }
	ret=WriteParameter(E_LocalSiteAddr,(uchar*)&g_Site.retValue,1);
	if(!ret)
	{
		G_LocalSite=(uchar)g_Site.retValue;
		sprintf(tempstr,"本机站点号设置成%d",G_LocalSite);
		DispStr_CE(0,12,tempstr,DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		delay_and_wait_key (DISP_OK_DELAY_TIME,EXIT_KEY_F1,120);
		WaringBeep(OK_WARNING_BEEP);
		
	}
	else
	{
		DispStr_CE(0,12,"本机站点号设置失败!",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		delay_and_wait_key (DISP_OK_DELAY_TIME,EXIT_KEY_F1,120);
		WaringBeep(ERR_WARNING_BEEP);
	}
	return;
}
예제 #7
0
static void ClosePassWord()
{
	int ret;
	uchar status;
	status=0;
	ret=WriteParameter(E_PassWordStatusAddr,&status,1);
	if(!ret)
	{
		G_PassWordStatus=0;
		DispStr_CE(0,4,"开机密码已禁止",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		delay_and_wait_key (DISP_OK_DELAY_TIME,EXIT_KEY_F1,120);
		WaringBeep(OK_WARNING_BEEP);
	}
	return;
}
bool
WriteMessageDriverSettings(BFile& file, const BMessage& message)
{
	if(file.InitCheck() != B_OK || !file.IsWritable())
		return false;
	
	file.SetSize(0);
	file.Seek(0, SEEK_SET);
	
	BMessage parameter;
	for(int32 index = 0; message.FindMessage(MDSU_PARAMETERS, index, &parameter) == B_OK;
			index++) {
		if(index > 0)
			file.Write("\n", 1);
		WriteParameter(file, parameter, 0);
	}
	
	return true;
}
예제 #9
0
int standby(u8 enable)	//***enable =1 means suspend, 0 means resume 
{
	if (enable) {
		mutex_lock(&lcd_mutex);
		rk29_lcd_spim_spin_lock();
		if(gLcd_info)
			gLcd_info->io_init();

		WriteCommand(0X2800); 
		WriteCommand(0X1100); 
		msleep(5);
		WriteCommand(0X4f00); 
		WriteParameter(0x01);
		if(gLcd_info)
			gLcd_info->io_deinit();

		rk29_lcd_spim_spin_unlock();
		mutex_unlock(&lcd_mutex);
	} else {
		flush_workqueue(lcd_resume_wq);
	}
	return 0;
}
예제 #10
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeStrCompare (void)
{
	WriteParameter (StrCompare, sizeof(void*), pStrCompare);
}
예제 #11
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeStrCat (void)
{
	WriteParameter (StrCat, sizeof(void*), pStrCat);
}
예제 #12
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharSize (void)
{
	WriteParameter (TxtCharSize, sizeof(void*), pTxtCharSize);
}
예제 #13
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsSpace (void)
{
	WriteParameter (TxtCharIsSpace, sizeof(void*), pTxtCharIsSpace);
}
예제 #14
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsHex (void)
{
	WriteParameter (TxtCharIsHex, sizeof(void*), pTxtCharIsHex);
}
예제 #15
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsDigit (void)
{
	WriteParameter (TxtCharIsDigit, sizeof(void*), pTxtCharIsDigit);
}
예제 #16
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsCntrl (void)
{
	WriteParameter (TxtCharIsCntrl, sizeof(void*), pTxtCharIsCntrl);
}
예제 #17
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsDelim (void)
{
	WriteParameter (TxtCharIsDelim, sizeof(void*), pTxtCharIsDelim);
}
예제 #18
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeSysLibFind (void)
{
	WriteParameter (SysLibFind, sizeof(void*), pSysLibFind);
}
예제 #19
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsGraph (void)
{
	WriteParameter (TxtCharIsGraph, sizeof(void*), pTxtCharIsGraph);
}
예제 #20
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeSysRandom (void)
{
	WriteParameter (SysRandom, sizeof(void*), pSysRandom);
}
예제 #21
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsPrint (void)
{
	WriteParameter (TxtCharIsPrint, sizeof(void*), pTxtCharIsPrint);
}
예제 #22
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeSysTaskDelay (void)
{
	WriteParameter (SysTaskDelay, sizeof(void*), pSysTaskDelay);
}
예제 #23
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsUpper (void)
{
	WriteParameter (TxtCharIsUpper, sizeof(void*), pTxtCharIsUpper);
}
예제 #24
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeSysTicksPerSecond (void)
{
	WriteParameter (SysTicksPerSecond, sizeof(void*), pSysTicksPerSecond);
}
예제 #25
0
파일: servapi8.c 프로젝트: ycheng/APDA
////////////////////////////////////////////////////////////
// String Manager Library, completed 19/19 functions now.
////////////////////////////////////////////////////////////
void PipeStrAToI(void)
{
	WriteParameter (StrAToI, sizeof(void*), pStrAToI);
}
예제 #26
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeSysUIAppSwitch (void)

{
	WriteParameter (SysUIAppSwitch, sizeof(void*), pSysUIAppSwitch);
}
예제 #27
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeStrChr(void)
{
	WriteParameter (StrChr, sizeof(void*), pStrChr);
}
예제 #28
0
파일: servapi8.c 프로젝트: ycheng/APDA
////////////////////////////////////////////////////////////
// Text Manager Library, completed 38/38 functions now.
////////////////////////////////////////////////////////////
void PipeTxtCharIsAlNum (void)
{
	WriteParameter (TxtCharIsAlNum, sizeof(void*), pTxtCharIsAlNum);
}
예제 #29
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeStrCopy (void)
{
	WriteParameter (StrCopy, sizeof(void*), pStrCopy);
}
예제 #30
0
파일: servapi8.c 프로젝트: ycheng/APDA
void PipeTxtCharIsAlpha (void)
{
	WriteParameter (TxtCharIsAlpha, sizeof(void*), pTxtCharIsAlpha);
}