srv_test.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:4k
源码类别:

DVD

开发平台:

C/C++

  1. /*
  2. *  Terry,2003/9/10 12:18AM
  3. *  Servo QRE using
  4. */
  5. #ifdef TEST_SERVO
  6. void srv_mode_test_polling(void)
  7. {
  8.     if (iTestServoMode==3) {
  9.         if (system_state==SYSTEM_BROWSE) {
  10.             UINT32 iTime=get_rtc_val();
  11.             if (iTime>=180000) { //30*60*100
  12.             //if (iTime>=12000) { //30*60*100
  13.                 psprintf(RegionValStr[REGION2], "MTBF:%010d", iTestServoCount);
  14.                 PrintOsdMsg(STR_OS_SPACE, REGION2, 0, 1);
  15.                 call_ir_func(IRC_EJECT);
  16.                 //ircmd_eject_toggle();
  17.                 polling();
  18.                 ShowTitle();
  19.                 delay_srv_10ms(600);
  20.                 polling();
  21.                 return;
  22.             }
  23.         }
  24.     }
  25. }
  26. void srv_test_mode1_open(void)
  27. {
  28.     if (iTestServoMode==1) 
  29.     {
  30.         if (system_state==SYSTEM_NODISC) {
  31.             //open/close servo testing mode
  32.             call_ir_func(IRC_EJECT);
  33.             delay_srv_10ms(200);//1s
  34.             iTestServoCount++;
  35.             psprintf(RegionValStr[REGION2], "DO OPEN/CLOSE TESTING:%05d", iTestServoCount);
  36.             PrintOsdMsg(STR_OS_SPACE, REGION2, 0, 1);
  37.         }
  38.     }
  39. }
  40. void srv_test_mode_play(void)
  41. {
  42.     if (iTestServoMode==1) {
  43.         //open/close servo testing mode
  44.         call_ir_func(IRC_EJECT);
  45.         delay_srv_10ms(600);
  46.         iTestServoCount++;
  47.         psprintf(RegionValStr[REGION2], "DO OPEN/CLOSE TESTING:%05d", iTestServoCount);
  48.         PrintOsdMsg(STR_OS_SPACE, REGION2, 0, 1);
  49.     } else if (iTestServoMode==3) {
  50.         extern UINT32 dwDiscLBA;
  51.         extern UINT32 dwLayerLBA;
  52.         
  53.         UINT32  i, iTestLBA;
  54.         //do 10 times full stroke
  55.         for (i=0; i<=20; i++) {
  56.             iTestLBA = get_stc_val_32();
  57.             iTestLBA %= dwDiscLBA;
  58.             //ran_read(pwb, l2msf(iTestLBA), 2048);
  59.             
  60.             if(i%2 == 0)
  61.                  ran_read(pwb, l2msf(0), 2048);
  62.             else
  63.             {
  64.                  if(cd_type_loaded==CDDVD)
  65.                  ran_read(pwb, l2msf(dwLayerLBA), 2048);
  66.                  else
  67.                  ran_read(pwb, gettrkmsf_leadout(), 2048);
  68.                     
  69.             }
  70.             
  71.             psprintf(RegionValStr[REGION2], "MTBF:%010d LBA:0X%08x", iTestServoCount, iTestLBA);
  72.             PrintOsdMsg(STR_OS_SPACE, REGION2, 0, 1);
  73.             polling_osd(1);
  74.         }
  75.         iTestServoCount++;
  76.         psprintf(RegionValStr[REGION2], "MTBF:%010d", iTestServoCount, iTestLBA);
  77.         PrintOsdMsg(STR_OS_SPACE, REGION2, 0, 1);
  78.         polling_osd(1);
  79.         //ircmd_shuffle();
  80.         call_ir_func(IRC_RANDOM);
  81.         browser();
  82.      }
  83. }
  84. void srv_test_mode1_no_disc(void)
  85. {
  86.   if (iTestServoMode==1) 
  87.   {
  88.     //open/close servo testing mode
  89.     call_ir_func(IRC_EJECT);
  90.     delay_srv_10ms(600);//1s
  91.     iTestServoCount++;
  92.     psprintf(RegionValStr[REGION2], "DO OPEN/CLOSE TESTING:%05d", iTestServoCount);
  93.     PrintOsdMsg(STR_OS_SPACE, REGION2, 0, 1);
  94.   }
  95. }
  96. void init_srv_test_mode(void)
  97. {
  98.     iTestServoMode  = 0;
  99.     iTestServoCount = 0;
  100. }
  101. void test_mode_chk_close_tray(void)
  102. {        
  103.         if (iTestServoMode==1) {
  104.             if (CDOpened()) {
  105.                 //close tray
  106.                 call_ir_func(IRC_EJECT);
  107.                 system_state=SYSTEM_OPEN;
  108.                 no_disk_cnt=DETECT_TIMES;
  109.             }
  110.             if (iTestServoCount>=20000) {
  111.                 iTestServoMode  = 0;
  112.                 iTestServoCount = 0;
  113.             }
  114.         } else if (iTestServoMode==3) {
  115.             if (CDOpened()) {
  116.                 //close tray
  117.                 call_ir_func(IRC_EJECT);
  118.                 delay_srv_10ms(600);
  119.                 system_state=SYSTEM_OPEN;
  120.                 no_disk_cnt=DETECT_TIMES;
  121.             }
  122.         }
  123. }
  124. #else
  125. #define test_mode_chk_close_tray();
  126. #define init_srv_test_mode();
  127. #define srv_test_mode1_no_disc();
  128. #define srv_test_mode_play();
  129. #define srv_test_mode1_open();
  130. #endif //#ifdef TEST_SERVO