Subversion Repositories FlightCtrl

Rev

Rev 2102 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*********************************************************************************/
/* Flight Control                                                                */
/*********************************************************************************/

#ifndef _FLIGHT_H
#define _FLIGHT_H

#include <inttypes.h>
#include "analog.h"
#include "configuration.h"

#define PITCH 0
#define ROLL 1

/*
 * The output BLC throttles can be set in an [0..256[ interval. Some staticParams limits
 * (min, throttle, max throttle etc) are in a [0..256[ interval.
 * The calculation of motor throttle values from sensor and control information (basically
 * flight.c) take place in an [0..1024[ interval for better precision.
 * This is the conversion factor.
 * --> Replaced back again by CONTROL_SCALING. Even though the 2 things are not quite the
 * same, they are unseperable anyway.
 */


// looping params
// extern long TurnOver180Nick, TurnOver180Roll;

// external control
// extern int16_t ExternStickNick, ExternStickRoll, ExternStickYaw;
// extern int16_t naviAccPitch, naviAccRoll, naviCntAcc;

// TODO: Rip em up, replace by a flight-state machine.
// OK first step: Move to control mixer, where the state machine will be located anyway.
// extern volatile uint8_t MKFlags;
// extern uint16_t isFlying;

#define HH_RANGE ((int32_t)GYRO_DEG_FACTOR_PITCHROLL * 30)

void flight_control(void);
void transmitMotorThrottleData(void);
void flight_setNeutral(void);

#endif //_FLIGHT_H