Subversion Repositories FlightCtrl

Rev

Rev 2110 | Rev 2116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2110 Rev 2115
Line 14... Line 14...
14
 
14
 
15
uint8_t lastRCCommand = COMMAND_NONE;
15
uint8_t lastRCCommand = COMMAND_NONE;
Line 16... Line 16...
16
uint8_t lastFlightMode = FLIGHT_MODE_NONE;
16
uint8_t lastFlightMode = FLIGHT_MODE_NONE;
-
 
17
 
17
 
18
#define TIME(s) ((int16_t)(((long)F_CPU/(long)8000)*(float)s))
18
#define TIME(s) ((int16_t)(((long)F_CPU/(long)8000)*(float)s))
19
 
19
/***************************************************************
20
/***************************************************************
20
 *  16bit timer 1 is used to decode the PPM-Signal            
21
 *  16bit timer 1 is used to decode the PPM-Signal            
21
 ***************************************************************/
22
 ***************************************************************/
Line 225... Line 226...
225
  if (RCQuality >= 120)
226
  if (RCQuality >= 120)
226
    return SIGNAL_BAD;
227
    return SIGNAL_BAD;
227
  return SIGNAL_LOST;
228
  return SIGNAL_LOST;
228
}
229
}
Line 229... Line -...
229
 
-
 
230
/*
-
 
231
 * To should fired only when the right stick is in the center position.
-
 
232
 * This will cause the value of pitch and roll stick to be adjusted
-
 
233
 * to zero (not just to near zero, as per the assumption in rc.c
-
 
234
 * about the rc signal. I had values about 50..70 with a Futaba
-
 
235
 * R617 receiver.) This calibration is not strictly necessary, but
-
 
236
 * for control logic that depends on the exact (non)center position
-
 
237
 * of a stick, it may be useful.
-
 
238
 */
230
 
239
void RC_calibrate(void) {
231
void RC_calibrate(void) {
240
  // Do nothing.
232
  // Do nothing.
-
 
233
}
-
 
234
 
-
 
235
int16_t RC_getZeroThrottle() {
-
 
236
        return TIME (-0.5);