예제 #1
0
파일: monofan.c 프로젝트: turcoale/monofan
void main(void)
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  /* For example: for(;;) { } */

//Flash_Erase_Page(0xE000);
//Flash_Program_Byte(0xE002,0x03);

//valor minimo cero, valor maximo 600 ancho del pulso 31
mode = SETPOINT;


switch(mode)
{
  case NORMAL : 
  {
    PTCD_PTCD0 = 1;
    //Delay1s(TIMEINIT);
  
    for(;;){
            ReadInput(&interm);
            SetDisp(interm);
           } 
  
  }    break;
  
  case SETPOINT : 
  {
    PTCD_PTCD0 = 1;
    //Delay1s(5);
            ReadSetPoint(&interm);
            Flash_Erase_Page(0xE000);
            Flash_Program_Byte(0xE000, ADCRH);
            Flash_Program_Byte(0xE001, ADCRL);
            flash = u16Flash_ReadWord(0xE000);

    for(;;){
            //ReadSetPoint(&interm);
            SetDisp(interm);
           }
  
  }    break;
}

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
예제 #2
0
 void SetSysParameter()
 {
	 BROWINFO setpar_menu;
	 char parameter_str[]=" 1.时间设置    "
					      " 2.显示设置    "
					 " 3.按键设置    "
					 " 4.自动关机时间"
					 " 5.背光时间设置"
					 " 6.开机密码设置"
					 " 7.WIFI网络设置"
					 " 8.WIFI网络查询"
					 " 9.本机站点设置"
					 " 10.恢复出场设置";
	 
	 int select;
	 setpar_menu.iStr=parameter_str;//浏览字符串
	 setpar_menu.lPtr = 0;//起始显示行
	 setpar_menu.cPtr = 0;//初始选择项
	 while(1)
	 {
		DispStr_CE(0,1,"系统设置菜单",DISP_CENTER|DISP_NORMAL|DISP_CLRSCR);
		setpar_menu.mInt=10;//显示总行数
		setpar_menu.lineMax=15;//每行显示最大字符数 
		setpar_menu.startLine=3;//起始行 
		setpar_menu.dispLines=10;//
		setpar_menu.sFont=0;  //0 -大字体
		setpar_menu.numEnable=1;//是否允许键盘方向键 1-允许
		setpar_menu.qEvent=(EXIT_KEY_F1);
		setpar_menu.autoexit =120;
		select=EXT_Brow_Select(&setpar_menu);
		switch(select)
		{
			 case 0:
				 SetTime();
				 break;
			 case 1:
				 SetDisp();
				 break;
			 case 2:
				 SetKeyBoard();
				 break;
			 case 3:
				 AutoPowerDown();
				 break;
			 case 4:
				 SetElAutoTime();
				 break;
			 case 5:
				 SetPassword();
				 break;
			 case 6:
				 Wifi_SetDemo();
				 break;
			 case 7:
			 	Wifi_GetDemo();
				break;
			 case 8:
				 SetLocalSite();
				 break;
			 case 9:
				 ResetPlant();
				 break;
			 default:
				 return;
				 //break;
		 }
	 }
 }