diff --git a/Makefile.ac b/Makefile.ac
index 2f31869d6b..7ecd4db388 100644
--- a/Makefile.ac
+++ b/Makefile.ac
@@ -45,8 +45,11 @@ $(RADIO_H) : $(CONF)/$(RADIO) $(CONF_XML)
mv /tmp/radio.h $@
$(CONTROL_H) : $(CONF)/$(AIRFRAME) $(CONF_XML)
- $(TOOLS)/gen_control.out $< > /tmp/control.h
- mv /tmp/control.h $@
+ TMPFILE=$(shell echo `tempfile`)
+ $(TOOLS)/gen_control.out $< > $TMPFILE
+ mv $TMPFILE $@
+# $(TOOLS)/gen_control.out $< > /tmp/control.h
+# mv /tmp/control.h $@
$(FLIGHT_PLAN_H) : $(CONF)/$(FLIGHT_PLAN) $(CONF_XML)
$(TOOLS)/gen_flight_plan.out $< > /tmp/fp.h
diff --git a/conf/airframes/gorrazoptere_esc_3DMG_test.xml b/conf/airframes/gorrazoptere_esc_3DMG_test.xml
index 811962965a..d95b8c3caf 100644
--- a/conf/airframes/gorrazoptere_esc_3DMG_test.xml
+++ b/conf/airframes/gorrazoptere_esc_3DMG_test.xml
@@ -77,5 +77,7 @@
include $(PAPARAZZI_SRC)/conf/autopilot/disc_board.makefile
+ap.CFLAGS += -DRADIO_CONTROL -DACTUATORS
+ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/esc.c
\ No newline at end of file
diff --git a/sw/airborne/avr/esc.c b/sw/airborne/avr/esc.c
index 819e222164..3df9b0ac4d 100644
--- a/sw/airborne/avr/esc.c
+++ b/sw/airborne/avr/esc.c
@@ -33,12 +33,14 @@
#include
#include "command.h"
+#include "std.h"
+#include "airframe.h"
#define MAX_TICK 0x3FF
-#define MOT_CTL_0 OCR3C
-#define MOT_CTL_1 OCR1A
-#define MOT_CTL_2 OCR3B
-#define MOT_CTL_3 OCR3A
+#define MOT_CTL_0 OCR3C
+#define MOT_CTL_1 OCR1A
+#define MOT_CTL_2 OCR3B
+#define MOT_CTL_3 OCR3A
void command_init ( void ) {
/* OC1A output */
@@ -56,7 +58,8 @@ void command_init ( void ) {
#define COMMAND_(i) MOT_CTL_ ## i
#define COMMAND(i) COMMAND_(i)
#define ChopServo(x) (x > MAX_TICK ? MAX_TICK : x)
+#define SERVOS_TICS_OF_USEC(s) (s)
void command_set(const pprz_t values[]) {
- CommandSet(values); /*Generated from airframe.xml */
+ CommandsSet(values); /*Generated from airframe.xml */
}
diff --git a/sw/airborne/main_fbw_2.c b/sw/airborne/main_fbw_2.c
index 25f857d6bb..757ef87748 100644
--- a/sw/airborne/main_fbw_2.c
+++ b/sw/airborne/main_fbw_2.c
@@ -7,7 +7,7 @@
#include "ppm.h"
#include "radio_control.h"
#include "command.h"
-#include "control_2.h"
+//#include "control_2.h"
void init_fbw( void ) {
low_level_init();
@@ -37,8 +37,11 @@ void periodic_task_fbw( void ) {
void event_task_fbw( void ) {
#ifdef RADIO_CONTROL
- if (radio_control_ppm_event())
+ if (radio_control_ppm_event()) {
+#ifdef CONTROL
control_process_radio_control();
+#endif /* CONTROL */
+ }
#endif /* RADIO_CONTROL */
}