So how important is the StartT parameter?
unsigned char GetNfactor(unsigned int nTimestamp) {
int l = 0;
if (nTimestamp <= StartT)
return 4;
unsigned long int s = nTimestamp - StartT;
while ((s >> 1) > 3) {
l += 1;
s >>= 1;
}
s &= 3;
int n = (l * 170 + s * 25 - 2320) / 100;
if (n < 0) n = 0;
if (n > 255)
printf("GetNfactor(%d) - something wrong(n == %d)\n", nTimestamp, n);
unsigned char N = (unsigned char)n;
if(N if(N>maxNfactor) return maxNfactor;
return N;
}
if StartT will be wrong, n factor will be calculated wrong ....