This commit is contained in:
Antoine Drouin
2007-10-26 18:19:40 +00:00
parent 727545f515
commit ebedc8c85e
6 changed files with 23 additions and 17 deletions
+4 -4
View File
@@ -24,14 +24,14 @@
<process name="Filter">
<mode name="default">
<message name="IMU_GYRO" period=".004"/>
<message name="IMU_GYRO_LP" period=".004"/>
<message name="IMU_GYRO" period=".017"/>
<message name="IMU_GYRO_LP" period=".017"/>
</mode>
<mode name="raw_sensors">
<message name="IMU_GYRO_RAW" period=".01"/>
<message name="IMU_GYRO_RAW" period=".017"/>
</mode>
<mode name="scaled_sensors">
<message name="IMU_GYRO" period=".004"/>
<message name="IMU_GYRO" period=".017"/>
</mode>
</process>
@@ -5,7 +5,7 @@
#include "std.h"
#include "i2c.h"
#define ChopServo(x,a,b) Chop(x, a, b)
#define ChopServo(x,a,b) ((x)>(b)?(b):(x))
#define Actuator(i) buss_twi_blmc_motor_power[i]
#define ActuatorsCommit() { \
if ( buss_twi_blmc_status == BUSS_TWI_BLMC_STATUS_IDLE) { \
+5 -2
View File
@@ -1,5 +1,6 @@
#include "booz_autopilot.h"
#include "radio_control.h"
#include "commands.h"
#include "booz_control.h"
@@ -32,8 +33,10 @@ void booz_autopilot_periodic_task(void) {
}
void booz_autopilot_event_task(void) {
void booz_autopilot_on_rc_event(void) {
if (rc_values_contains_avg_channels) {
booz_autopilot_mode = BOOZ_AP_MODE_OF_PPRZ(rc_values[RADIO_MODE]);
}
switch (booz_autopilot_mode) {
case BOOZ_AP_MODE_RATE:
booz_control_rate_compute_setpoints();
+1 -1
View File
@@ -12,7 +12,7 @@ extern uint8_t booz_autopilot_mode;
extern void booz_autopilot_init(void);
extern void booz_autopilot_periodic_task(void);
extern void booz_autopilot_event_task(void);
extern void booz_autopilot_on_rc_event(void);
#define TRESHOLD_RATE_PPRZ (MIN_PPRZ / 2)
#define TRESHOLD_ATTITUDE_PPRZ (MAX_PPRZ/2)
+2 -9
View File
@@ -123,13 +123,6 @@ STATIC_INLINE void booz_main_event_task( void ) {
LinkImuEventCheckAndHandle();
#endif
if (ppm_valid) {
ppm_valid = FALSE;
radio_control_event_task();
if (rc_values_contains_avg_channels) {
booz_autopilot_mode = BOOZ_AP_MODE_OF_PPRZ(rc_values[RADIO_MODE]);
}
booz_autopilot_event_task();
}
RadioControlEventCheckAndHandle(booz_autopilot_on_rc_event);
}
+10
View File
@@ -27,6 +27,16 @@
#if defined RADIO_CONTROL
#define RadioControlEventCheckAndHandle(_user_callback) { \
if (ppm_valid) { \
ppm_valid = FALSE; \
radio_control_event_task(); \
_user_callback(); \
} \
}
#include "led.h"
#include "sys_time.h"
#include "ppm.h"