94,7 → 94,7 |
uint8_t dsl_Battery = 0; |
uint8_t dsl_Allocation = 0; |
uint8_t PacketBuffer[6]; |
uint8_t Jitter = 0; // same measurement as RC_Quality in rc.c |
//uint8_t Jitter = 0; // same measurement as RC_Quality in rc.c |
|
typedef union |
{ |
113,8 → 113,8 |
int16_t tmp; |
uint8_t index = channel + 1; // mk channels start with 1 |
|
RC_Quality = (212 * (uint16_t)dsl_RSSI) / 128; // have to be scaled approx. by a factor of 1.66 to get 200 at full level |
if(RC_Quality > 255) RC_Quality = 255; |
//RC_Quality = (212 * (uint16_t)dsl_RSSI) / 128; // have to be scaled approx. by a factor of 1.66 to get 200 at full level |
//if(RC_Quality > 255) RC_Quality = 255; |
|
// signal from DSL-receiver is between 7373 (1ms) und 14745 (2ms). |
signal-= 11059; // shift to neutral |
122,8 → 122,8 |
|
if(abs(signal-PPM_in[index]) < 6) |
{ |
if(Jitter < 200) Jitter +=10; |
else Jitter = 200; |
if(RC_Quality < 200) RC_Quality +=10; |
else RC_Quality = 200; |
} |
|
// calculate exponential history for signal |
131,7 → 131,7 |
if(tmp > signal+1) tmp--; else |
if(tmp < signal-1) tmp++; |
// calculate signal difference on good signal level |
if(Jitter >= 195) PPM_diff[index] = ((tmp - PPM_in[index]) / 3) * 3; // cut off lower 3 bit for noise reduction |
if(RC_Quality >= 195) PPM_diff[index] = ((tmp - PPM_in[index]) / 3) * 3; // cut off lower 3 bit for noise reduction |
else PPM_diff[index] = 0; |
PPM_in[index] = tmp; // update channel value |
|
159,6 → 159,7 |
// ?? = PacketBuffer[5]; |
if(dsl_RSSI == 0) |
{ |
RC_Quality = 0; |
for (i = 0; i<5; i++) |
{ |
PPM_diff[i] = 0; |