?? recover.txt
字號:
/* ISP有影響,除去下載線,效果ok */
/* 開背景光 Turn ON*/
_ledsAnode_High(LEDS1);/* 陽極 */
_ledsCathode_ChangeToOutputLow(LEDS1);/* 陰極 */
/* 反向偏執 充電 */
_ledsAnode_Low(LEDS0);
_ledsCathode_ChangeToOutputHig(LEDS0);
_runTimer0_TimeUS(250);
_waitTimer0OV();
_runTimer0_TimeUS(250);
_waitTimer0OV();
/* 反向偏執 檢測光 */
_ledsCathode_ReadIO_Hi_Z(LEDS0);
_runTimer0_TimeUS(250);
_waitTimer0OV();
_runTimer0_TimeUS(250);
_waitTimer0OV();
suart_Byte(ReadPinsAsLowInTimePeriod(LEDS0ADDR));
_ledsAnode_Low(LEDS1);/* 陽極 Turn OFF*/
unsigned char ReadLedPinAsLowInTimePeriod(unsigned int addrPin,unsigned char bitVal)
{ unsigned char i;
static unsigned char RdVal;
unsigned char lowerThresholdCnt=0;
for(i = 0 ; i < 5 ; i++)
{ _runTimer0_TimeUS(100);
do
{ _breakTimer0OV();
RdVal = (*(volatile unsigned char *)(addrPin));
/*_ledsCathode_Pin(addrPin);通過SRAM讀取端口,程序可擴展*/
}while( !(RdVal & bitVal) );/*_breakTimer0OV() 讀取引腳1,檢測到高電平 下一步*/
/* 開始新檢測周期 */
//if(!(RdVal & bitVal)){continue;}/* 0 for-continue */
_runTimer0_TimeUS(250);
do
{ RdVal = (*(volatile unsigned char *)(addrPin));
if( !(RdVal & bitVal) )/* 讀取引腳0,檢測到低電平 */
{
lowerThresholdCnt++;
break;
}
}_whileTimer0OV();
}
//if(lowerThresholdCnt >= 3)return 1;
//else return 0;
return lowerThresholdCnt;
}
if((mercurySwitch == (char)(0-(MER_SWC_NUM/2)) ) && (SYSFLAG.merSwitch == 1))
{
SYSFLAG.merSwitch = 0;
= 1;
suart_Byte(('0'+SYSFLAG.merSwitch));
}
else if((mercurySwitch == (MER_SWC_NUM/2) ) && (SYSFLAG.merSwitch == 0))
{
SYSFLAG.merSwitch = 1;
SYSFLAG.left2right =1;
suart_Byte(('0'+SYSFLAG.merSwitch));
}
if(SYSFLAG.left2right == 0)/* 方向保持 */
{ if(gCnt >= 0 && gCnt< LINE_NUM}
{ if(SYSFLAG.merSwitch == 1)
{ ledsTurnOn(valUnPack(gDotArr[gCnt++].i16));
}else
{
ledsTurnOn(valUnPack(gDotArr[gCnt--].i16));
}
}
if(gCnt >= LINE_NUM){gNullLedsOn++;continue;}
if(gCnt == 255){gNullLedsOn++;continue;}
}else/* 方向切換后 */
{ gNullLedsOn--;/*空顯示區域忽略*/
if(gNullLedsOn <= 2)
{ SYSFLAG.left2right = 0;
}
_ledsAnode_Low(LEDS0);
_ledsAnode_Low(LEDS1);
continue;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -