Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 355 → Rev 356

/FollowMe/main.c
17,7 → 17,7
 
 
#define FOLLOWME_INTERVAL 1000 // 1 second update
#define CELLUNDERVOLTAGE 31 // lowest allowed voltage/cell; 31 = 3.1V
#define CELLUNDERVOLTAGE 32 // lowest allowed voltage/cell; 32 = 3.2V
 
#ifdef USE_FOLLOWME
int16_t UBat = 120;
25,6 → 25,7
int16_t PowerOn = 0;
int16_t i = 0;
int16_t delay = 0;
int16_t FollowMe_active = 0;
#endif
 
uint16_t Error = 0;
138,6 → 139,7
FollowMe_Timer = SetDelay(FOLLOWME_INTERVAL/4); // reset timer on higer frequency
}
LEDGRN_TOGGLE; // indication of active follow me
FollowMe_active = 1;
}
break;
 
144,6 → 146,7
case STATE_IDLE:
// do nothing
LEDGRN_ON;
FollowMe_active = 0;
break;
 
default:
194,8 → 197,8
}
if(delay < 1500) delay++;
 
// monitor battery undervoltage
if((UBat < Zellenzahl * CELLUNDERVOLTAGE) && (PowerOn >= 100))
// monitor battery undervoltage [...||(UBat<74) as temporary workaround to protect 2s lipo packs]
if(((UBat < Zellenzahl * CELLUNDERVOLTAGE)||(UBat < 74)) && (PowerOn >= 100))
{ // sound for low battery
BeepModulation = 0x0300;
if(!BeepTime)