Optional check for pin connect error :-)

This commit is contained in:
Stefan `Sec` Zehl 2011-07-09 22:47:38 +02:00
parent 7701a48f69
commit 76f080d302
1 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,12 @@ void tick_default(void) {
ctr=0; ctr=0;
}; };
if(ctr%5==0){ if(ctr%5==0){
if(GetVoltage()<3600){
if(GetVoltage()<3600
#ifdef SAFE
|| GetVoltage() > 10000 // pin not connected
#endif
){
IOCON_PIO1_11 = 0x0; IOCON_PIO1_11 = 0x0;
gpioSetDir(RB_LED3, gpioDirection_Output); gpioSetDir(RB_LED3, gpioDirection_Output);
if( (ctr/5)%10 == 1 ) if( (ctr/5)%10 == 1 )