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

📄 rtc_test_misc.c

📁 MMI层OBJ不能完全编译
💻 C
📖 第 1 页 / 共 4 页
字号:
   case 13:
      if (!test_to_execute)
      {
		   sprintf((char*)s_resultInfo.test_ref,"%s",RTC_003_REF);
		   sprintf((char*)s_resultInfo.test_name,"%s",RTC_003_NAME);
		   sprintf((char*)s_resultInfo.test_comment,"%s",RTC_003_COMMENT);
		   
		   gen_display_header (&s_resultInfo);
		   RTC_GetDateTime(&date_time); 
		   uc_id_obtained[0]=date_time.minute;
		   
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_003_RESULT_ADD_MN);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[0], sizeof(uc_id_waited[0]),&s_resultInfo);
		   
		   gen_display_report (b_resultMsg);
		   
		   LCD_WriteString( 2, 0, "                 ", NORMAL);
		   LCD_WriteString( 2, 0, "To add One Day", NORMAL);
		   uc_id_waited[0]=date_time.day+1;
		   if (uc_id_waited[0] > 31)
			   uc_id_waited[0]-=31;
	   }
	   else
	   {
         if (RTC_GetDateTime(&date_time) == RVF_NOT_READY)
         {
            rvf_delay(RVF_MS_TO_TICKS(1));
            RTC_GetDateTime(&date_time);
         }
		   date_time.day++;
		   if (date_time.day > 30 )
			   date_time.day -= 30;
		   
		   if (RTC_SetDateTime(date_time) == RVF_NOT_READY)
         {
			   rvf_delay(RVF_MS_TO_TICKS(1));
			   RTC_SetDateTime(date_time);
         }
	   }
	   break;
	   
   case 14:
	   if (!test_to_execute)
	   {
		   sprintf((char*)s_resultInfo.test_ref,"%s",RTC_003_REF);
		   sprintf((char*)s_resultInfo.test_name,"%s",RTC_003_NAME);
		   sprintf((char*)s_resultInfo.test_comment,"%s",RTC_003_COMMENT);
		   
		   gen_display_header (&s_resultInfo);
		   RTC_GetDateTime(&date_time); 
		   uc_id_obtained[0]=date_time.day;
		   
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_003_RESULT_ADD_D);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[0], sizeof(uc_id_waited[0]),&s_resultInfo);
		   
		   gen_display_report (b_resultMsg);

		   LCD_WriteString( 2, 0, "To add One Month", NORMAL);
		   uc_id_waited[0]=date_time.month+1;
		   if (uc_id_waited[0] > 12)
			   uc_id_waited[0]-=12;
	   }
	   else
	   {
		   if (RTC_GetDateTime(&date_time) == RVF_NOT_READY)
         {
            rvf_delay(RVF_MS_TO_TICKS(1));
			   RTC_GetDateTime(&date_time);
		   }
		   date_time.month++;
		   if (date_time.month > 12 )
			   date_time.month -= 12;
		   
		   if (RTC_SetDateTime(date_time) == RVF_NOT_READY)
		   {
			   rvf_delay(RVF_MS_TO_TICKS(1));
			   RTC_SetDateTime(date_time);
         }
      }
	   
	   break;
	   
   case 15:
	   if (!test_to_execute)
	   {
		   sprintf((char*)s_resultInfo.test_ref,"%s",RTC_003_REF);
		   sprintf((char*)s_resultInfo.test_name,"%s",RTC_003_NAME);
		   sprintf((char*)s_resultInfo.test_comment,"%s",RTC_003_COMMENT);
		   
		   gen_display_header (&s_resultInfo);
		   RTC_GetDateTime(&date_time); 
		   uc_id_obtained[0]=date_time.month;
		   
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_003_RESULT_ADD_M);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[0], sizeof(uc_id_waited[0]),&s_resultInfo);
		   
		   gen_display_report (b_resultMsg);

		   LCD_WriteString( 2, 0, "To add One Year ", NORMAL);
		   uc_id_waited[0]=date_time.year+1;
		   if (uc_id_waited[0] > 99)
			   uc_id_waited[0]-=100;
	   }
      else
      {
		   if (RTC_GetDateTime(&date_time) == RVF_NOT_READY)
		   {
			   rvf_delay(RVF_MS_TO_TICKS(1));
			   RTC_GetDateTime(&date_time);
		   }
		   date_time.year++;
		   if (date_time.year > 99 )
			   date_time.year -= 100;
		   
		   if (RTC_SetDateTime(date_time) == RVF_NOT_READY)
		   {
			   rvf_delay(RVF_MS_TO_TICKS(1));
			   RTC_SetDateTime(date_time);
		   }
      }
      break;

   case 16:
      if (!test_to_execute)
      {
		   sprintf((char*)s_resultInfo.test_ref,"%s",RTC_003_REF);
		   sprintf((char*)s_resultInfo.test_name,"%s",RTC_003_NAME);
		   sprintf((char*)s_resultInfo.test_comment,"%s",RTC_003_COMMENT);
		   
		   gen_display_header (&s_resultInfo);
		   RTC_GetDateTime(&date_time); 
		   uc_id_obtained[0]=date_time.year;
		   
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_003_RESULT_ADD_Y);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[0], sizeof(uc_id_waited[0]),&s_resultInfo);
		   
		   gen_display_report (b_resultMsg);

		   LCD_WriteString( 2, 0, "To add One Week Day", NORMAL);
		   uc_id_waited[0]=date_time.wday+1;
		   if (uc_id_waited[0] > 6)
			   uc_id_waited[0]-=7;
	   }
	   else
	   {
         if (RTC_GetDateTime(&date_time) == RVF_NOT_READY)
         {
            rvf_delay(RVF_MS_TO_TICKS(1));
            RTC_GetDateTime(&date_time);
         }
		   date_time.wday++;
		   if (date_time.wday > 6)
			   date_time.wday -= 7;
		   
		   if (RTC_SetDateTime(date_time) == RVF_NOT_READY)
         {
			   rvf_delay(RVF_MS_TO_TICKS(1));
			   RTC_SetDateTime(date_time);
         }
		   sprintf((char*)date, "%02d/%02d/%02d WDay=%d",
			   date_time.month, date_time.day, date_time.year,date_time.wday);
		   LCD_WriteString( 3, 0, (char*) date, NORMAL);
	   }
	   break;

   case 17:
	   if (!test_to_execute)
         {
		   sprintf((char*)s_resultInfo.test_ref,"%s",RTC_003_REF);
		   sprintf((char*)s_resultInfo.test_name,"%s",RTC_003_NAME);
		   sprintf((char*)s_resultInfo.test_comment,"%s",RTC_003_COMMENT);
		   
		   gen_display_header (&s_resultInfo);
		   RTC_GetDateTime(&date_time); 
		   uc_id_obtained[0]=date_time.wday;
		   
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_003_RESULT_ADD_WD);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[0], sizeof(uc_id_waited[0]),&s_resultInfo);
		   
		   gen_display_report (b_resultMsg);
		   
		   LCD_WriteString( 2, 0, "                   ", NORMAL);
		   LCD_WriteString( 3, 0, "                 ", NORMAL);
		   LCD_WriteString( 2, 0, "hour mode ?", NORMAL);
	   }
	   else
	   {
		   if (RTC_Is12HourMode() == FALSE)   
		   {
			   uc_id_waited[0]=MODE_12H;
			   LCD_WriteString( 2, 0, "24 hour mode ", NORMAL);
			   RTC_Set12HourMode(TRUE);
			   if(RTC_Is12HourMode() == TRUE)   
				   uc_id_obtained[0]= MODE_12H;
			   else
				   uc_id_obtained[0]= MODE_24H;
         }
		   else
			   if (RTC_Is12HourMode() == TRUE)   
			   {
				   uc_id_waited[0]=MODE_24H;
				   LCD_WriteString( 2, 0, "12 hour mode ", NORMAL);
				   RTC_Set12HourMode(TRUE);
				   if(RTC_Is12HourMode() == TRUE)   
					   uc_id_obtained[0]= MODE_24H;
				   else
					   uc_id_obtained[0]= MODE_12H;
      }
      else
      {
				   LCD_WriteString( 2, 0, "hour mode Error", NORMAL);
				   uc_id_obtained[0]=MODE_ERROR;
			   }
			   
			   sprintf((char*)s_resultInfo.test_ref,"%s",RTC_011_REF);
			   sprintf((char*)s_resultInfo.test_name,"%s",RTC_011_NAME);
			   sprintf((char*)s_resultInfo.test_comment,"%s",RTC_011_COMMENT);
			   
			   gen_display_header (&s_resultInfo);
			   
			   sprintf((char*)s_resultInfo.var_name,"%s",RTC_011_HOUR_MODE);
			   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[0], sizeof(uc_id_waited[0]),&s_resultInfo);
			   
			   gen_display_report (b_resultMsg);
	   }
	   break;
	   
   case 18:
	   if (!test_to_execute)
         {
		   LCD_WriteString( 2, 0, "Test Param DateTime", NORMAL);
            rvf_delay(RVF_MS_TO_TICKS(1));
         }
	   else
	   {
		   uc_id_waited[0]=RVF_INVALID_PARAMETER;
		   
		   date_time.second  = -1;
		   uc_id_obtained[0] = RTC_SetDateTime(date_time);
		   date_time.second  = 60;
		   uc_id_obtained[1] = RTC_SetDateTime(date_time);
		   
		   date_time.minute  = -1;
		   uc_id_obtained[2] = RTC_SetDateTime(date_time);
		   date_time.minute  = 60;
		   uc_id_obtained[3] = RTC_SetDateTime(date_time);
		   
		   date_time.hour    = -1;
		   uc_id_obtained[4] = RTC_SetDateTime(date_time);
		   date_time.hour	   = 25;
		   uc_id_obtained[5] = RTC_SetDateTime(date_time);
		   
		   date_time.day     = 0;
		   uc_id_obtained[6] = RTC_SetDateTime(date_time);
		   date_time.day	   = 32;
		   uc_id_obtained[7] = RTC_SetDateTime(date_time);
		   
		   date_time.month   = 0;
		   uc_id_obtained[8] = RTC_SetDateTime(date_time);
		   date_time.month   = 13;
		   uc_id_obtained[9] = RTC_SetDateTime(date_time);
		   
		   date_time.year    = -1;
		   uc_id_obtained[10] = RTC_SetDateTime(date_time);
		   date_time.year    = 100;
		   uc_id_obtained[11] = RTC_SetDateTime(date_time);
		   
		   date_time.wday    = -1;
		   uc_id_obtained[12] = RTC_SetDateTime(date_time);
		   date_time.wday    = 7;
		   uc_id_obtained[13] = RTC_SetDateTime(date_time);
		   
		   sprintf((char*)s_resultInfo.test_ref,"%s",RTC_004_REF);
		   sprintf((char*)s_resultInfo.test_name,"%s",RTC_004_NAME);
		   sprintf((char*)s_resultInfo.test_comment,"%s",RTC_004_COMMENT);
		   
		   gen_display_header (&s_resultInfo);
		   
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_0);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[0], sizeof(uc_id_waited[0]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_1);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[1], sizeof(uc_id_waited[1]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_2);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[2], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_3);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[3], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_4);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[4], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_5);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[5], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_6);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[6], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_7);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[7], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_8);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[8], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_9);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[9], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_10);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[10], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_11);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[11], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_12);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[12], sizeof(uc_id_waited[2]),&s_resultInfo);
		   sprintf((char*)s_resultInfo.var_name,"%s",RTC_004_RESULT_FONCTION_13);
		   b_resultMsg = gen_display_table_result(&uc_id_waited[0], &uc_id_obtained[13], sizeof(uc_id_waited[2]),&s_resultInfo);
		   
		   gen_display_report (b_resultMsg);
      }
      break;

   case 19:
	if (!test_to_execute) {
		    		
	      if (RTC_SetCurrentTZ(RTC_GMT_NT_0145)!=RV_OK) LCD_WriteString( 5, 0, "Current Time zone NOT set properly    ", NORMAL);
			else
				LCD_WriteString( 5, 0, "Current Time zone set properly    ", NORMAL);
		
		if (RTC_GetCurrentTZ()!= RTC_GMT_NT_0145) LCD_WriteString( 6, 0, "Current Time zone NOT read properly    ", NORMAL);
			else
				LCD_WriteString( 6, 0, "Current Time zone read  properly    ", NORMAL);

		if (RTC_SetHomeTZ(RTC_GMT_PT_0045)!=RV_OK) LCD_WriteString( 7, 0, "Home Time zone NOT set properly    ", NORMAL);
			else
				LCD_WriteString( 7, 0, "Home Time zone set properly    ", NORMAL);
		
		if (RTC_GetHomeTZ()!= RTC_GMT_PT_0045) LCD_WriteString( 8, 0, "Home Time zone NOT read properly    ", NORMAL);
			else
				LCD_WriteString( 8, 0, "Home Time zone read  properly    ", NORMAL);
		
		}
	break;

   case 20:
       LCD_WriteString( 11, 0, "The End RTC test   ", NORMAL);
	   
	   /* Restore Date & Time memory*/
	   RTC_SetDateTime(Memo_date_time);
      rvf_stop_timer(RVF_TIMER_1);
      break;

   default:
       LCD_WriteString( 2, 0, "Error Case test    ", NORMAL);
	   num_test=20;
	   break;
	   
   }

   test_to_execute = test_to_execute? FALSE : TRUE;
	if (!test_to_execute) 
		num_test++;

⌨️ 快捷键说明

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