Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 820 → Rev 821

/branches/V0.68d Code Redesign killagreg/makefile
1,7 → 1,7
#--------------------------------------------------------------------
# MCU name
MCU = atmega644
#MCU = atmega644p
#MCU = atmega644
MCU = atmega644p
F_CPU = 20000000
#-------------------------------------------------------------------
VERSION_MAJOR = 0
/branches/V0.68d Code Redesign killagreg/rc.c
84,7 → 84,7
static uint16_t lastICR1 = 0;
// if ICR1 has not changed
// then no new input capture event has occured since last timer overflow
if (lastICR1 == ICR1) RC_Quality = 0;
if (lastICR1 == ICR1) RC_Quality /= 2;
lastICR1 = ICR1; // store last ICR1
}
 
125,12 → 125,6
signal = (uint16_t) ICR1 - oldICR1;
oldICR1 = ICR1;
 
// lost frame?
if(signal > 8000)
{
RC_Quality /= 2;
}
else
//sync gap? (3.52 ms < signal < 25.6 ms)
if((signal > 1100) && (signal < 8000))
{
164,10 → 158,6
else PPM_diff[index] = 0;
PPM_in[index] = tmp; // update channel value
}
else
{ // invalid PPM time
RC_Quality /= 2;
}
index++; // next channel
// demux sum signal for channels 5 to 7 to J3, J4, J5
if(index == 5) PORTD |= (1<<PORTD5); else PORTD &= ~(1<<PORTD5);