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

📄 sony_servo.lst

📁 索尼CX3068VCD伺服的随身听
💻 LST
📖 第 1 页 / 共 5 页
字号:
1204          #ifdef USE_SONY_3068			// sz 8/18
                  CLEAR_SERVO_LDON;
              #else
1207          	SET_SERVO_LDON;     	/* turn on the laser diode */
1208          #endif
1209              servo_focus_on = 0;
1210          /*    focus_retry = 5; */
1211          	focus_retry = 6;
1212          /*    servo_sys_timer = T300MS; */
1213          
1214          	servo_sys_timer = T500MS; 
1215              SERVO_CLV_KICK;
1216              servo_pres_m = FOCUS_10;
1217              servo_task = SERVO_focus_10;
1218              
1219          
C51 COMPILER V6.12  SONY_SERVO                                                             02/22/2002 15:21:29 PAGE 21  

1220              
1221          }
1222          
1223          void SERVO_focus_10()
1224          {
1225              if (servo_sys_timer == 0) {
1226          		SERVO_CLV_STOP;
1227             		servo_sys_timer = T300MS;   /* focus down timer */
1228          		SERVO_fcsdwn();
1229              }
1230          }
1231          
1232          void SERVO_fcsdwn()
1233          {
1234              SERVO_FOCUS_DOWN;
1235              servo_pres_m = FOCUS_20;
1236              servo_task = SERVO_focus_20;
1237          }
1238          
1239          void SERVO_focus_20()
1240          {
1241          	if (servo_sys_timer == 0) {
1242              	zputs("SERVO_focus_20 - go 30\n");
1243                  SERVO_CLV_STOP;
1244          #ifdef USE_SONY_3068			// sz 8/18
              		SET_SERVO_AGC;
                      SERVO_send_command(4, 0x5500);      /* SET_B1 */
              #else
1248                  CLEAR_SERVO_AGC;        /* AGC off */
1249                  SERVO_send_command(4, 0x5900);      /* SET_B1 */
1250          #endif
1251                  SERVO_AUTO_FOCUS;
1252                  servo_sys_timer = T1SECOND;     /* focus up timer */
1253                  servo_pres_m = FOCUS_30;
1254                  servo_task = SERVO_focus_30;
1255              	}
1256          }
1257          #if 1
1258          void SERVO_focus_30()
1259          {
1260              if (servo_sys_timer == 0) {
1261              	zputs("SERVO_focus_30 - timeout\n");
1262          		SERVO_fcstry();
1263              } else {
1264              	enable_interrupt = 0;
1265          		SERVO_send_command_no_latch(2, 0x40);	/* Read XBUSY */
1266          		if (SERVO_SENS_HIGH && SERVO_FOK_HIGH) {
1267              		enable_interrupt = 1;
1268          	    	SERVO_fcson();
1269          	    }
1270              	enable_interrupt = 1;
1271              }
1272          }
1273          #endif
1274          
1275          #if 0
              void SERVO_focus_30()
              {
              		do{
              
                  	   SERVO_send_command_no_latch(2, 0x40);	/* Read XBUSY */
                  	}  while ( !(SERVO_SENS_HIGH && SERVO_FOK_HIGH) );
C51 COMPILER V6.12  SONY_SERVO                                                             02/22/2002 15:21:29 PAGE 22  

              	    	   	
              }
              #endif
1285          
1286          void SERVO_fcson(void)
1287          {
1288              zputs("SERVO_fcson\n");
1289              /* LPC stuff */
1290              SERVO_delay_n_ms(25);
1291          #ifdef USE_SONY_3068			// sz 8/18
                  CLEAR_SERVO_AGC;	/* LPC on */
              #else
1294              SET_SERVO_AGC;	/* LPC on */
1295          #endif
1296              servo_sys_timer = T3SECOND;
1297              servo_fok_timer = FOK_TIMEOUT / 2;
1298          
1299              /* To prevent doing focus forever */
1300              if (check_focus_fail > 6) {//6
1301          		check_focus_fail = 0;
1302          		SERVO_fcserr();
1303          		return;
1304              	}
1305              /* If FOK were HIGH most of the time, consider FOK is OK and call CLV_A */
1306              #if 1
1307              if (check_focus_ok()) {
1308              	zputs("SERVO_CLV_A\n");
1309          		SERVO_CLV_A;
1310          		SERVO_ANTISHOCK_OFF;
1311          		SERVO_TRK_SLD_ON;
1312              } else {
1313          		check_focus_fail ++;
1314          		SERVO_all_servo_off();
1315          		servo_task = SERVO_focus;
1316          		return;
1317              }
1318              #endif
1319          
1320              #if 0
                  while( !check_focus_ok() ){; }
                      zputs("SERVO_CLV_A\n");
              		SERVO_CLV_A;
              		SERVO_ANTISHOCK_OFF;
              		SERVO_TRK_SLD_ON;
              	 servo_pres_m = FOCUS_40;
                  servo_task = SERVO_focus_40;
              	zputs( "FOCUS OK" );
              	return;
              	#endif
1331          
1332              /* Check FOCUS again after sending CLV_A */
1333              #if 1
1334                if (!check_focus_ok()) {
1335          		check_focus_fail ++;
1336          		SERVO_AUTOSEQ_CANCEL;
1337          		SERVO_all_servo_off();
1338          		servo_task = SERVO_focus;
1339          		return;
1340              	}
1341              #endif    	
1342                     
1343          
C51 COMPILER V6.12  SONY_SERVO                                                             02/22/2002 15:21:29 PAGE 23  

1344              servo_pres_m = FOCUS_40;
1345              servo_task = SERVO_focus_40;
1346          }
1347          
1348          void SERVO_focus_40()
1349          {
1350              zputs("SERVO_focus_40\n");
1351              /* If FOK were LOW most of the time, restart from SERVO_focus*/
1352              if (!check_focus_ok()) {
1353          		check_focus_fail ++;
1354          		SERVO_all_servo_off();
1355          		servo_task = SERVO_focus;
1356          		return;
1357              	}
1358          
1359          	SERVO_start_timer(10);
1360              check_focus_fail = 0;
1361              while (servo_sys_timer) {
1362          		/* LARGE LOOP */
1363                  if (SERVO_FOK_HIGH) {
1364             	        servo_fok_timer = FOK_TIMEOUT / 2;
1365                      servo_focus_drop = 0;
1366                      if (SERVO_GFS_HIGH) {
1367                          if (!SERVO_check_timer()) {
1368                              SERVO_focsok();
1369                              return;
1370                          }
1371                      } else {
1372          				SERVO_start_timer(10);
1373                      }
1374                  } else {
1375                      if (servo_fok_timer == 0) {
1376              			zputs("SERVO_focus_40 fok_timer=0\n");
1377          				SERVO_start_timer(0);
1378                          SERVO_fcstry();
1379                          return;
1380                      } else {
1381          				SERVO_start_timer(10);
1382                      }
1383                  }
1384          	SERVO_Idle();	//add for esp seed6
1385          	}
1386          	zputs("SERVO_focus_40 sys_timer=0\n");
1387          	SERVO_start_timer(0);
1388              SERVO_fcstry();
1389          }
1390          
1391          void SERVO_focsok()
1392          {
1393              zputs("SERVO_focsok\n");
1394              servo_focus_on = 1;
1395              servo_focus_drop = 0;
1396              servo_fok_timer = FOK_TIMEOUT;
1397              servo_gfsmute_timer = GFSMUTE_TIMEOUT;
1398              servo_gfs_timer = GFS_TIMEOUT;
1399              servo_subq_timer = SUBQ_TIMEOUT;
1400              servo_pres_m = FOCUS_50;
1401              servo_task = SERVO_focus_50;
1402          }
1403          
1404          void SERVO_focus_50()
1405          {
C51 COMPILER V6.12  SONY_SERVO                                                             02/22/2002 15:21:29 PAGE 24  

1406              zputs("SERVO_focus_50\n");
1407              if (servo_next_m != OPEN_M) {
1408          		servo_task = SERVO_EF_balance;
1409              } else {
1410          		clear_emergency_flag();
1411          		SERVO_stop();
1412          		servo_task = null_func;
1413              }
1414          }
1415          
1416          void SERVO_fcstry()
1417          {
1418              zputs("SERVO_fcstry\n");
1419              SERVO_AUTOSEQ_CANCEL;
1420              SERVO_CLV_STOP;
1421              SERVO_TRK_SLD_OFF;
1422          	SERVO_short_delay(3);
1423              if (focus_retry)
1424          		focus_retry --;
1425              if (focus_retry == 0)
1426          		SERVO_fcserr();
1427              else {
1428          		servo_sys_timer = T500MS;
1429          		SERVO_fcsdwn();
1430             	 }
1431          }
1432          
1433          void SERVO_fcserr()
1434          {
1435              zputs("SERVO_fcserr\n");
1436              servo_focus_on = 0;
1437              SERVO_FOCUS_DOWN;
1438              servo_sys_timer = T250MS;
1439              servo_pres_m = FOCUS_60;
1440              servo_task = SERVO_focus_60;
1441          }
1442          
1443          void SERVO_focus_60()
1444          {
1445              zputs("SERVO_focus_60\n");
1446              if (servo_sys_timer == 0)
1447          	SERVO_fcsext();
1448          }
1449          
1450          void SERVO_fcsext()
1451          {
1452              zputs("SERVO_fcsext\n");
1453              clear_emergency_flag();
1454              SERVO_AUTOSEQ_CANCEL;
1455              SERVO_all_servo_off();
1456              SERVO_delay_n_ms(100);
1457              SERVO_stop();
1458              servo_task = null_func;
1459              focus_flag = 0;
1460          }
1461          
1462          
1463          
1464          /*
1465           * sub-routine to move the head to the selected position
1466           */
1467          int SERVO_search(void)
C51 COMPILER V6.12  SONY_SERVO                                                             02/22/2002 15:21:29 PAGE 25  

1468          {
1469          	int num, timeout;
1470          
1471              zputs("SERVO_search\n");
1472              /* if not rotate then return */
1473              if (!kickfg) {
1474              	zputs("Not rotating\n");
1475          		return(0);
1476          		}
1477          	servo_pres_m = ACES_10;
1478          	SERVO_new_Qcode = 0;	/* reset the new Qcode flag */
1479          
1480          //	timeout  = glbTimer + T10SECOND;
1481          	timeout  = glbTimer + T15SECOND+T4SECOND;	// Wenxin -- for some DVCD Karaoke disc	
1482              while (glbTimer < timeout) {
1483          		SERVO_short_delay(3);
1484          	    SERVO_service();	/* read new Qcode */
1485          	    servo_pres_m = ACES_10;	/* Reset it in case it is changed */
1486          /*	    
1487          	    if (!servo_focus_on) {
1488          	        	zputs("123\n");
1489          			return(0);
1490          	    }
1491          */	    
1492          	    if (SERVO_new_Qcode) {
1493          	       	zputs("NEW Q code\n");
1494          
1495          			SERVO_new_Qcode = 0;
1496          				if (SERVO_Qarray_new[SERVO_QTRACK] == 0x0) {
1497          					SERVO_send_command(6, 0x38148E);
1498          					SERVO_send_command(2, TG_UP);
1499          					SERVO_2N_trackjump(1, 100);
1500          					SERVO_send_command(6, 0x38140E);
1501          					SERVO_delay_n_ms(4);
1502          					SERVO_send_command(2, TG_NOR);
1503          				}
1504          				else if (SERVO_match()) {
1505          					reset_emergency_flag();
1506          //    				SERVO_delay_n_ms(150);	//chu
1507          					

⌨️ 快捷键说明

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