Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2047 → Rev 2048

/branches/dongfang_FC_rewrite/compassControl.c
0,0 → 1,19
#include <inttypes.h>
#include "controlMixer.h"
#include "attitude.h"
#include <stdlib.h>
 
// The only possibility in a compass control is to aim the head at some compass heading.
// One way could be: When a switch is turned on, we capture the current heading in a variable.
// From then on, if the current heading is to the right of the captured heading, we yaw left etc.
// If the yaw at input is nonzero, we could also temporarily disable this and instead re-capture
// the current heading..
 
int32_t magneticTargetHeading;
 
void CC_periodicTaskAndPRTY(int16_t* PRTY) {
int16_t currentYaw = PRTY[CONTROL_YAW];
if (abs(currentYaw) < 10) {
magneticTargetHeading = magneticHeading;
}
}