task void UpdateNoiseFloorTask() {
shellsort(rssisamples,NSAMPLES);
atomic {
- noisefloor = (5*noisefloor + rssisamples[NSAMPLES/2])/6;
+ noisefloor = (5*noisefloor + rssisamples[NSAMPLES/2] + 3)/6;
rssiindex = 0;
}
sdDebug(60000U + noisefloor);
} else {
shellsort(rssisamples,NSAMPLES);
if(rssisamples[MINIMUM_POSITION] < noisefloor + THREE_SIGMA) {
- noisefloor = (7*noisefloor + rssisamples[NSAMPLES/2])/8;
+ noisefloor = (7*noisefloor + rssisamples[NSAMPLES/2] + 4)/8;
++deadlockCounter;
}
else {
async command uint16_t BatteryLevel.getLevel() {
uint16_t l;
atomic l = batteryLevel;
- return (uint32_t)l*39>>5;
+ return (uint32_t)(l+3)*6/5;
}
}