📄 yxktv.lst
字号:
1333 1 LcdWrCmd(iAddr);//set DDRAM
1334 1 }
1335
1336 void LcdClr(uchar Y)
1337 { uchar iAddr;
1338 1 switch (Y)
1339 1 { case 0:
1340 2 LcdWrCmd(1);
1341 2 break;
1342 2 case 1:
1343 2 case 2:
1344 2 case 3:
1345 2 case 4:
1346 2 iAddr=DDRAMTAB[Y-1];
1347 2 LcdWrCmd(iAddr);
1348 2 for (iAddr=0;iAddr<16;iAddr++)
1349 2 { LcdWrData(0x20);
1350 3 }
1351 2 break;
1352 2 }
C51 COMPILER V7.00 YXKTV 05/08/2006 17:58:08 PAGE 23
1353 1 LcdX=1;LcdY=Y;
1354 1 }
1355
1356 void LcdLine()
1357 {
1358 1 LcdX=1;
1359 1 LcdY=LcdY+1;
1360 1 if (LcdY>4) LcdY=1;
1361 1 LcdXY();
1362 1 }
1363
1364 void LcdNext()
1365 { LcdX=LcdX+1;
1366 1 if (LcdX>8) LcdLine();
1367 1 }
1368
1369 void Prints(uchar y,uchar x,uchar idata *str,uchar Len)
1370 { uchar i,c,j;
*** WARNING C259 IN LINE 1370 OF C:\WAVE\PEI\YXKTV\YXKTV.C: pointer: different mspace
1371 1
1372 1 LcdWrCmd(0x0c);//display on
1373 1 LcdWrCmd(0x30);//basic instrution
1374 1
1375 1 if ((x+y)>0)
1376 1 { //LcdClr();
1377 2 LcdX=x;LcdY=y;
1378 2 LcdXY();//set pos
1379 2 }
1380 1
1381 1 if (Len==0) Len=64;
1382 1
1383 1 i=0;
1384 1 do
1385 1 { c=str[i];
1386 2 if (c==0) return;
1387 2 if ((c==13)||(c=='`'))
1388 2 { if (!bLoopShow) LcdLine();
1389 3 i=i+1;goto NEXT;
1390 3 };
1391 2 if (c==0x0a) {i=i+1;goto NEXT;}
1392 2 LcdWrData(c);
1393 2
1394 2 j=c;
1395 2 i=i+1;
1396 2 if (i>=Len) return;
1397 2 c=str[i];
1398 2 if (c==0) return;
1399 2 if ((c==13)||(c=='`'))
1400 2 { if (!bLoopShow) LcdLine();
1401 3 i=i+1;goto NEXT;
1402 3 };
1403 2 if (c==0x0a) {i=i+1;goto NEXT;}
1404 2
1405 2 if ((j<0xA0)&&(c>=0xA0))//汉字半位置
1406 2 { LcdWrData(0x20);
1407 3 LcdNext();
1408 3 }else
1409 2 {
1410 3 LcdWrData(c);
1411 3 LcdNext();
1412 3 i=i+1;
1413 3 }
C51 COMPILER V7.00 YXKTV 05/08/2006 17:58:08 PAGE 24
1414 2 NEXT:
1415 2 ;
1416 2 }
1417 1 while (i<Len);
1418 1 }
1419
1420 void PrintsRom(char y,char x,char code *str,char Len)
1421 { uchar i,c,j;
1422 1
1423 1 LedTimer=C_LED; //亮
1424 1
1425 1 if ((x+y)>0)
1426 1 { if (x>4) LcdClr(0);
1427 2 else
1428 2 { LcdX=x;LcdY=y;
1429 3 LcdXY();//set pos
1430 3 }
1431 2 }
1432 1 if (Len==0) Len=64;
1433 1 i=0;
1434 1 do
1435 1 { c=str[i];
1436 2 if (c==0) return;
1437 2 if ((c==13)||(c=='`'))
1438 2 { LcdLine();
1439 3 i=i+1;goto NEXT;
1440 3 };
1441 2 LcdWrData(c);
1442 2
1443 2 j=c;
1444 2 c=str[i+1];
1445 2 if (c==0) return;
1446 2 if ((c==13)||(c=='`'))
1447 2 { LcdLine();
1448 3 i=i+1;goto NEXT;
1449 3 };
1450 2
1451 2 if ((j<0xA0)&&(c>=0xA0))//汉字半位置
1452 2 { LcdWrData(0x20);
1453 3 LcdNext();
1454 3 i=i+1;
1455 3 }else
1456 2 {
1457 3 LcdWrData(c);
1458 3 LcdNext();
1459 3 i=i+2;
1460 3 }
1461 2 NEXT:
1462 2 ;
1463 2 }
1464 1 while (i<Len);
1465 1 }
1466
1467 void ShowLoop0()
1468 { uchar Len;
1469 1
1470 1 bLoop=0;
1471 1 if (LoopPos>=CharN) LoopPos=0;
1472 1
1473 1 if ((LoopPos+16)<=CharN) Len=16;else Len=CharN-LoopPos;
1474 1 Prints(2,1,&CharData[LoopPos+2],Len);
1475 1
C51 COMPILER V7.00 YXKTV 05/08/2006 17:58:08 PAGE 25
1476 1 LoopPos=LoopPos+2;
1477 1 }
1478
1479 void ShowLoop()
1480 { uchar Len;
1481 1
1482 1 bLoop=0;
1483 1 LcdClr(2);
1484 1
1485 1 if (LoopPos>=(CharN+16)) LoopPos=0;
1486 1 if (LoopPos==0) LoopPos=2;
1487 1 if (LoopPos<=16)
1488 1 { Len=LoopPos;
1489 2 if (Len>CharN) Len=CharN;
1490 2 Prints(2,(16-LoopPos)/2+1,&CharData[2],Len);
1491 2 }else
1492 1 {
1493 2 if ((LoopPos)<=CharN) Len=16;else Len=CharN-LoopPos+16;
1494 2 Prints(2,1,&CharData[LoopPos+2-16],Len);
1495 2 }
1496 1
1497 1 LoopPos=LoopPos+2;
1498 1 }
1499
1500 void LcdInit()
1501 { uchar code SHOWTAB[]=
1502 1 {"长沙中天电子www.psunsky.com.cn`0731-5123999 13973199797"
1503 1 };
1504 1
1505 1 LCDE=0;
1506 1 LCDRST=0;
1507 1 NOP
1508 1 LCDRST=1;
1509 1
1510 1 LCDPSB=1;//Parall Mode
1511 1 LCDLED=0;
1512 1 //LCDLED=1;
1513 1 LcdWrCmd(0x0c);//0f);//display on
1514 1 LcdWrCmd(0x30);//basic instrution
1515 1
1516 1 LcdClr(0);
1517 1 LcdWrCmd(0x80);//DDram=0
1518 1 PrintsRom(1,1,&SHOWTAB,0);
1519 1 IniPos=1;
1520 1 ShowIni();
1521 1 }
1522
1523 void ShowEprom()
1524 { uchar iAddr,i,j,iLen;
1525 1 iAddr=0x80;
1526 1 RdBytes24(iAddr,8);
1527 1 DelayMs(1);
1528 1 iLen=IcBuf[0];
1529 1 //if (iLen>64) iLen=64;
1530 1 if (iLen>64) return;
1531 1
1532 1 for (i=0;i<iLen+2;i=i+8)
1533 1 {
1534 2 if ((i+8)<=(iLen+2)) j=8;else j=iLen-i+2;
1535 2 RdBytes24(iAddr,j);
1536 2 for (j=0;j<8;j++)
1537 2 {
C51 COMPILER V7.00 YXKTV 05/08/2006 17:58:08 PAGE 26
1538 3 if ((i+j)<C_CHARN) CharData[i+j]=IcBuf[j];
1539 3 }
1540 2 iAddr=iAddr+8;
1541 2 }
1542 1 CharN=iLen;
1543 1 LcdClr(0);
1544 1 LCDLED=0;
1545 1 LedTimer=C_LED; //亮
1546 1 bLoopShow=1;
1547 1 LoopPos=0;
1548 1 InputMode=0;
1549 1 }
1550
1551 void ShowNums()
1552 { uchar i,j;
1553 1
1554 1 LcdWrCmd(0x9C);//pos
1555 1 LcdWrData('[');
1556 1 for (i=0;i<6;i++)
1557 1 { j=LcdBuf[i];
1558 2 switch (j)
1559 2 {
1560 3 case 0x0a:
1561 3 j='.';
1562 3 break;
1563 3 case 0x0f:
1564 3 j=' ';
1565 3 break;
1566 3 default:
1567 3 j=j+0x30;
1568 3 break;
1569 3 }
1570 2 LcdWrData(j);
1571 2 }
1572 1 LcdWrData(']');
1573 1 return;
1574 1 }
1575
1576 void PrintNum(uchar Num,uchar Pos)
1577 { uchar i;
1578 1
1579 1 i=Num/10;
1580 1 LcdBuf[Pos-1]=i;
1581 1 i=Num-i*10;
1582 1 LcdBuf[Pos]=i;
1583 1 }
1584
1585 void ShowMoney()
1586 {
1587 1 PrintNum(Money,5);
1588 1 }
1589
1590
C51 COMPILER V7.00 YXKTV 05/08/2006 17:58:08 PAGE 27
NAME CLASS MSPACE TYPE OFFSET SIZE
==== ===== ====== ==== ====== ====
bLoop. . . . . . . . . . . . . . . . . PUBLIC DATA BIT 0000H 1
ICDataB3 . . . . . . . . . . . . . . . ABSBIT ----- BIT 0003H 1
K4 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0094H 1
bSendAck . . . . . . . . . . . . . . . PUBLIC DATA BIT 0001H 1
ICDataB4 . . . . . . . . . . . . . . . ABSBIT ----- BIT 0004H 1
K5 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0095H 1
P0 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0080H 1
SleepTimer . . . . . . . . . . . . . . PUBLIC DATA U_INT 0000H 2
ICDataB5 . . . . . . . . . . . . . . . ABSBIT ----- BIT 0005H 1
K6 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0096H 1
P1 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0090H 1
ICDataB6 . . . . . . . . . . . . . . . ABSBIT ----- BIT 0006H 1
K7 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0097H 1
P2 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A0H 1
ICDataB7 . . . . . . . . . . . . . . . ABSBIT ----- BIT 0007H 1
P3 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00B0H 1
InitOkNum. . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0002H 1
T0 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00B4H 1
AC . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D6H 1
T1 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00B5H 1
T2 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0090H 1
EA . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00AFH 1
_RdBytes24 . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
iAddr. . . . . . . . . . . . . . . . * REG * DATA U_INT 0002H 2
iLen . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0005H 1
ddd. . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0006H 1
i. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0006H 1
RDSTOP . . . . . . . . . . . . . . . LABEL CODE LABEL ----- -----
SendData . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
_ReadKey . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
iPos . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
iAddr. . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
i. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
ICData . . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0000H 1
Money. . . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0003H 1
bDot . . . . . . . . . . . . . . . . . PUBLIC DATA BIT 0002H 1
Config1. . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0001H 1
Config2. . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0002H 1
Config3. . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0003H 1
IE . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A8H 1
RecvData . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
Stop24 . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
PwrT . . . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0004H 1
_Wr24. . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
dd . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
i. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
bRcvChar . . . . . . . . . . . . . . . PUBLIC DATA BIT 0003H 1
a0 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00E0H 1
a1 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00E1H 1
_DelayMs . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
Ms . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
i. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0006H 1
TimerFunc. . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
i. . . . . . . . . . . . . . . . . . AUTO DATA U_CHAR 0000H 1
a2 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00E2H 1
_PrintsRom . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
y. . . . . . . . . . . . . . . . . . AUTO DATA CHAR 0000H 1
C51 COMPILER V7.00 YXKTV 05/08/2006 17:58:08 PAGE 28
NAME CLASS MSPACE TYPE OFFSET SIZE
==== ===== ====== ==== ====== ====
x. . . . . . . . . . . . . . . . . . AUTO DATA CHAR 0001H 1
str. . . . . . . . . . . . . . . . . AUTO DATA PTR 0002H 2
Len. . . . . . . . . . . . . . . . . AUTO DATA CHAR 0004H 1
i. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0004H 1
c. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0003H 1
j. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
NEXT . . . . . . .
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -