declaration of variables for control from an external system

This commit is contained in:
Gautier Hattenberger
2008-04-01 12:28:22 +00:00
parent f09b8011f4
commit c35054a6e6
2 changed files with 44 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#define EXTERNAL_C
#include "external.h"
#include "flight_plan.h"
float nav_roll = 0.;
float nav_throttle = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
float nav_cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
float nav_alt = SECURITY_ALT;
int setNavCruise( void ) {
v_ctl_auto_throttle_cruise_throttle = nav_cruise;
return FALSE;
}
/*
int nav_throttle_loop( void ) {
nav_throttle_setpoint = TRIM_UPPRZ(nav_throttle * MAX_PPRZ);
return FALSE;
}
*/
+22
View File
@@ -0,0 +1,22 @@
#ifndef EXTERNAL_H
#define EXTERNAL_H
#include "nav.h"
extern float nav_roll; /* degrees, >0 on the right */
/* int nav_ground_speed_loop(void); */
extern float nav_throttle;
/* int nav_throttle_loop(void); */
extern float nav_cruise;
int setNavCruise(void);
extern float nav_alt;
#define external_SetNavThrottle(_v) { \
nav_throttle = (_v ? _v : nav_throttle); \
Bound(nav_throttle, V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE, V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE); \
}
#endif