diff --git a/Makefile.ac b/Makefile.ac
index 19899c2ef4..68749690ed 100644
--- a/Makefile.ac
+++ b/Makefile.ac
@@ -24,17 +24,20 @@ include conf/Makefile.local
CONF=$(PAPARAZZI_HOME)/conf
CONF_XML=$(CONF)/conf.xml
+MESSAGES_XML = $(CONF)/messages.xml
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
AIRFRAME_H=$(ACINCLUDE)/airframe.h
CONTROL_H=$(ACINCLUDE)/control.h
CONTROL_C=$(ACINCLUDE)/ap/control.c
+FBW_DOWNLINK_H=$(ACINCLUDE)/fbw_downlink_gen.h
+AP_DOWNLINK_H=$(ACINCLUDE)/ap_downlink_gen.h
RADIO_H=$(ACINCLUDE)/radio.h
FLIGHT_PLAN_H=$(ACINCLUDE)/flight_plan.h
FLIGHT_PLAN_XML=$(ACINCLUDE)/flight_plan.xml
INFLIGHT_CALIB_H=$(ACINCLUDE)/inflight_calib.h
MAKEFILE_AC=$(ACINCLUDE)/Makefile.ac
-all: $(AIRFRAME_H) $(RADIO_H) $(CONTROL_H) $(CONTROL_C) $(FLIGHT_PLAN_H) $(FLIGHT_PLAN_XML) $(INFLIGHT_CALIB_H) $(MAKEFILE_AC)
+all: $(AIRFRAME_H) $(RADIO_H) $(CONTROL_H) $(CONTROL_C) $(FLIGHT_PLAN_H) $(FLIGHT_PLAN_XML) $(INFLIGHT_CALIB_H) $(MAKEFILE_AC) $(FBW_DOWNLINK_H)
$(AIRFRAME_H) : $(CONF)/$(AIRFRAME) $(CONF_XML)
@@ -45,18 +48,17 @@ $(RADIO_H) : $(CONF)/$(RADIO) $(CONF_XML)
$(TOOLS)/gen_radio.out $< > /tmp/radio.h
mv /tmp/radio.h $@
+$(FBW_DOWNLINK_H) : $(MESSAGES_XML) $(CONF)/$(AIRFRAME) $(CONF_XML)
+ TMP_FILE=`mktemp`;\
+ $(TOOLS)/gen_messages.out $< telemetry_fbw > $$TMP_FILE;\
+ mv $$TMP_FILE $@
+ chmod a+r $@
+
$(CONTROL_H) : $(CONF)/$(AIRFRAME) $(CONF_XML)
-# export TMPFILE=$(shell echo `tempfile`)
-# echo =$(shell echo `echo $TMPFILE`)
-# $(TOOLS)/gen_control.out h $< > $(shell echo $TMPFILE)
-# mv $TMPFILE $@
$(TOOLS)/gen_control.out h $< > /tmp/control.h
mv /tmp/control.h $@
$(CONTROL_C) : $(CONF)/$(AIRFRAME) $(CONF_XML)
-# TMPFILE=$(shell echo `tempfile`)
-# $(TOOLS)/gen_control.out c $< > $(shell echo $TMPFILE)
-# mv $TMPFILE $@
mkdir -p $(ACINCLUDE)/ap
$(TOOLS)/gen_control.out c $< > /tmp/control.c
mv /tmp/control.c $@
diff --git a/Makefile.gen b/Makefile.gen
index e27fab0e14..eba9588881 100644
--- a/Makefile.gen
+++ b/Makefile.gen
@@ -35,10 +35,8 @@ UBX_PROTOCOL_H=$(STATICINCLUDE)/ubx_protocol.h
DL_PROTOCOL_H=$(STATICINCLUDE)/dl_protocol.h
MESSAGES_XML = $(CONF)/messages.xml
UBX_XML = $(CONF)/ubx.xml
-FBW_MESSAGES_H=$(STATICINCLUDE)/fbw_messages.h
-
-static: $(MESSAGES_H) $(MESSAGES_FBW_H) $(UBX_PROTOCOL_H) $(FBW_MESSAGES_H) $(DL_PROTOCOL_H)
+static: $(MESSAGES_H) $(MESSAGES_FBW_H) $(UBX_PROTOCOL_H) $(DL_PROTOCOL_H)
$(MESSAGES_H) : $(MESSAGES_XML) $(CONF_XML)
test -d $(STATICINCLUDE) || mkdir -p $(STATICINCLUDE)
@@ -54,12 +52,6 @@ $(MESSAGES_FBW_H) : $(MESSAGES_XML) $(CONF_XML)
mv $$TMP_FILE $@
chmod a+r $@
-$(FBW_MESSAGES_H) : $(MESSAGES_XML) $(CONF_XML)
- TMP_FILE=`mktemp`;\
- $(TOOLS)/gen_messages.out $< telemetry_fbw > $$TMP_FILE;\
- mv $$TMP_FILE $@
- chmod a+r $@
-
$(UBX_PROTOCOL_H) : $(UBX_XML)
$(TOOLS)/gen_ubx.out $< > /tmp/ubx.h
mv /tmp/ubx.h $@
diff --git a/conf/Makefile.arm7 b/conf/Makefile.arm7
index 909299186a..e422a6677c 100644
--- a/conf/Makefile.arm7
+++ b/conf/Makefile.arm7
@@ -24,7 +24,6 @@
#
# This is the common Makefile for the arm7-target.
-# Edit the configuration part to suit your local install
#
OBJDIR = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)/$(TARGET)
diff --git a/conf/airframes/twinstar5.xml b/conf/airframes/twinstar5.xml
index 0011482a2d..daf68e9f4a 100644
--- a/conf/airframes/twinstar5.xml
+++ b/conf/airframes/twinstar5.xml
@@ -112,13 +112,30 @@
diff --git a/sw/airborne/arm7/config_classix.h b/conf/autopilot/classix.h
similarity index 100%
rename from sw/airborne/arm7/config_classix.h
rename to conf/autopilot/classix.h
diff --git a/conf/autopilot/classix.makefile b/conf/autopilot/classix.makefile
index a08a87786d..0a083e1916 100644
--- a/conf/autopilot/classix.makefile
+++ b/conf/autopilot/classix.makefile
@@ -6,7 +6,7 @@ ap.ARCHDIR = $(ARCHI)
ap.ARCH = arm7tdmi
ap.TARGET = autopilot
ap.TARGETDIR = autopilot
-ap.CFLAGS += -DAP -DCONFIG=\"config_classix.h\" -DLED -DTIME_LED=1
+ap.CFLAGS += -DAP -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_ap_2.c main.c
@@ -14,5 +14,5 @@ fbw.ARCHDIR = $(ARCHI)
fbw.ARCH = arm7tdmi
fbw.TARGET = fbw
fbw.TARGETDIR = fbw
-fbw.CFLAGS += -DFBW -DCONFIG=\"config_classix.h\" -DLED -DTIME_LED=1
+fbw.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1
fbw.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c
diff --git a/sw/airborne/avr/config_discboard.h b/conf/autopilot/disc_board.h
similarity index 100%
rename from sw/airborne/avr/config_discboard.h
rename to conf/autopilot/disc_board.h
diff --git a/conf/autopilot/disc_board.makefile b/conf/autopilot/disc_board.makefile
index 38eff4967e..bf62ca3db4 100644
--- a/conf/autopilot/disc_board.makefile
+++ b/conf/autopilot/disc_board.makefile
@@ -8,6 +8,6 @@ ap.LOW_FUSE = a0
ap.HIGH_FUSE = 99
ap.EXT_FUSE = ff
ap.LOCK_FUSE = ff
-ap.CFLAGS += -DFBW -DCONFIG=\"config_discboard.h\"
+ap.CFLAGS += -DFBW -DCONFIG=\"discboard.h\"
ap.srcs = inter_mcu.c $(SRC_ARCH)/adc_hw.c sys_time.c main_fbw.c main.c
# pid.c estimator.c if_calib.c nav.c main_ap.c mainloop.c main.c
diff --git a/conf/autopilot/robostix.h b/conf/autopilot/robostix.h
new file mode 100644
index 0000000000..55684edafe
--- /dev/null
+++ b/conf/autopilot/robostix.h
@@ -0,0 +1,21 @@
+#ifndef CONFIG_ROBOSTIX_H
+#define CONFIG_ROBOSTIX_H
+
+#define LED_1_BANK G
+#define LED_1_PIN 4
+
+#define LED_2_BANK G
+#define LED_2_PIN 3
+
+#define LED_3_BANK B
+#define LED_3_PIN 4
+
+/* clock in MHz */
+#define CLOCK 16
+
+/* PPM input on mega128 ICP (PD4) */
+#define PPM_DDR DDRD
+#define PPM_PORT PORTD
+#define PPM_PIN PD4
+
+#endif /* CONFIG_ROBOSTIX_H */
diff --git a/conf/autopilot/robostix.makefile b/conf/autopilot/robostix.makefile
index 7279ca676c..dad23c996a 100644
--- a/conf/autopilot/robostix.makefile
+++ b/conf/autopilot/robostix.makefile
@@ -10,6 +10,6 @@ ap.LOW_FUSE = 0xbf
ap.HIGH_FUSE = 0xc9
ap.EXT_FUSE = ff
ap.LOCK_FUSE = ff
-ap.CFLAGS += -DFBW -DCONFIG=\"config_robostix.h\" -DLED
+ap.CFLAGS += -DFBW -DCONFIG=\"robostix.h\" -DLED
ap.srcs = sys_time.c $(SRC_ARCH)/adc_hw.c main_fbw.c main.c
# ap.srcs += main_ap.c
diff --git a/conf/autopilot/test_v1_2_1.makefile b/conf/autopilot/test_v1_2_1.makefile
deleted file mode 100644
index 926e1d0fb7..0000000000
--- a/conf/autopilot/test_v1_2_1.makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-ARCHI=avr
-
-fbw.ARCHDIR = $(ARCHI)
-fbw.ARCH = atmega8
-fbw.TARGET = fbw
-fbw.TARGETDIR = fbw
-fbw.LOW_FUSE = 2e
-fbw.HIGH_FUSE = cb
-fbw.EXT_FUSE = ff
-fbw.LOCK_FUSE = ff
-fbw.CFLAGS += -DFBW -DACTUATORS
-fbw.srcs = $(SRC_ARCH)/servos_4017.c sys_time.c main_fbw_2.c main.c
-
-LOCAL_CFLAGS += -DCONFIG=\"config_v1_2_1.h\"
\ No newline at end of file
diff --git a/sw/airborne/arm7/config_tiny.h b/conf/autopilot/tiny.h
similarity index 100%
rename from sw/airborne/arm7/config_tiny.h
rename to conf/autopilot/tiny.h
diff --git a/conf/autopilot/tiny.makefile b/conf/autopilot/tiny.makefile
index ada4008b6e..526d261b9b 100644
--- a/conf/autopilot/tiny.makefile
+++ b/conf/autopilot/tiny.makefile
@@ -6,7 +6,7 @@ ap.ARCHDIR = $(ARCHI)
ap.ARCH = arm7tdmi
ap.TARGET = autopilot
ap.TARGETDIR = autopilot
-ap.CFLAGS += -DFBW -DCONFIG=\"config_tiny.h\"
+ap.CFLAGS += -DFBW -DCONFIG=\"tiny.h\"
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c
#ap.CFLAGS += -DAP -DLED -DGPS -DUBX
#ap.srcs = main_ap_2.c
diff --git a/conf/autopilot/tiny_test.makefile b/conf/autopilot/tiny_test.makefile
deleted file mode 100644
index 27ffc7ee19..0000000000
--- a/conf/autopilot/tiny_test.makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Configuration for a Tiny board (1 arm7tdmi, 1 LEA-LA)
-
-ARCHI=arm7
-
-ap.ARCHDIR = $(ARCHI)
-ap.ARCH = arm7tdmi
-ap.TARGET = autopilot
-ap.TARGETDIR = autopilot
-ap.CFLAGS += -DAP -DFBW -DCONFIG=\"config_tiny.h\" -DLED -DACTUATORS=\"servos_4015_hw.h\"
-ap.srcs = $(SRC_ARCH)/armVIC.c sys_time.c main_fbw.c main_ap.c main.c $(SRC_ARCH)/servos_4015_hw.c
-
-#ap.CFLAGS += -DMODEM
-# -DGPS -DUBX -DDOWNLINK
-#ap.srcs = inter_mcu.c pid.c estimator.c cam.c main_ap.c mainloop.c main.c $(SRC_ARCH)/uart.c $(SRC_ARCH)/armVIC.c
-#ap.srcs += nav.c $(SRC_ARCH)/modem_hw.c $(SRC_ARCH)/servos_hw.c
-# ap.srcs += gps_ubx.c gps.c
-# ap.srcs += $(SRC_ARCH)/modem_hw.c $(SRC_ARCH)/adc_ap.c $(SRC_ARCH)/uart_ap.c $(SRC_ARCH)/servo.c
diff --git a/sw/airborne/avr/config_v1_2.h b/conf/autopilot/v1_2.h
similarity index 100%
rename from sw/airborne/avr/config_v1_2.h
rename to conf/autopilot/v1_2.h
diff --git a/conf/autopilot/v1_2.makefile b/conf/autopilot/v1_2.makefile
index 2b6a39d5be..81839f9db8 100644
--- a/conf/autopilot/v1_2.makefile
+++ b/conf/autopilot/v1_2.makefile
@@ -1,3 +1,3 @@
include $(PAPARAZZI_SRC)/conf/autopilot/twin_avr.makefile
-LOCAL_CFLAGS += -DCTL_BRD_V1_2 -DCONFIG=\"config_v1_2.h\"
+LOCAL_CFLAGS += -DCTL_BRD_V1_2 -DCONFIG=\"v1_2.h\"
diff --git a/sw/airborne/avr/config_v1_2_1.h b/conf/autopilot/v1_2_1.h
similarity index 100%
rename from sw/airborne/avr/config_v1_2_1.h
rename to conf/autopilot/v1_2_1.h
diff --git a/conf/autopilot/v1_2_1.makefile b/conf/autopilot/v1_2_1.makefile
index 6eabb58eca..8bca9e1d1c 100644
--- a/conf/autopilot/v1_2_1.makefile
+++ b/conf/autopilot/v1_2_1.makefile
@@ -1,3 +1,3 @@
include $(PAPARAZZI_SRC)/conf/autopilot/twin_avr.makefile
-LOCAL_CFLAGS += -DCTL_BRD_V1_2_1 -DCONFIG=\"config_v1_2_1.h\"
+LOCAL_CFLAGS += -DCTL_BRD_V1_2_1 -DCONFIG=\"v1_2_1.h\"
diff --git a/conf/messages.xml b/conf/messages.xml
index 1a9871c8a4..85867d3dbf 100644
--- a/conf/messages.xml
+++ b/conf/messages.xml
@@ -239,18 +239,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -272,6 +261,7 @@
+
diff --git a/sw/airborne/Makefile b/sw/airborne/Makefile
index 162cc29c43..5e89a1d8ac 100644
--- a/sw/airborne/Makefile
+++ b/sw/airborne/Makefile
@@ -24,7 +24,7 @@
VARINCLUDE=$(PAPARAZZI_HOME)/var/include
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
-INCLUDES = -I ../include -I $(VARINCLUDE) -I $(ACINCLUDE) -I $(ARCHI) -I $(PAPARAZZI_SRC)/sw/airborne
+INCLUDES = -I $(PAPARAZZI_SRC)/sw/include -I $(PAPARAZZI_SRC)/sw/airborne -I $(PAPARAZZI_SRC)/conf/autopilot -I $(PAPARAZZI_SRC)/sw/airborne/$(ARCHI) -I $(VARINCLUDE) -I $(ACINCLUDE)
SRC_ARCH = $(PAPARAZZI_SRC)/sw/airborne/$(ARCHDIR)
diff --git a/sw/airborne/fbw_downlink.h b/sw/airborne/fbw_downlink.h
index 9ba2826d68..a4539ea362 100644
--- a/sw/airborne/fbw_downlink.h
+++ b/sw/airborne/fbw_downlink.h
@@ -37,10 +37,9 @@
#include "downlink.h"
#define PERIODIC_SEND_PPM() {}
-//#define PERIODIC_SEND_SERVOS() { Uart0PrintString("SERVOS\n");}
#define PERIODIC_SEND_SERVOS() {}
#define PERIODIC_SEND_FBW_STATUS() {DOWNLINK_SEND_FBW_STATUS(&fbw_mode, &rc_status, &fbw_mode)}
-#define PERIODIC_SEND_RC() {}
+#define PERIODIC_SEND_RC() {DOWNLINK_SEND_RC(&fbw_mode, rc_values)}
diff --git a/sw/ground_segment/tmtc/maxstream.ml b/sw/ground_segment/tmtc/maxstream.ml
index 169cd7f0b8..b1db867391 100644
--- a/sw/ground_segment/tmtc/maxstream.ml
+++ b/sw/ground_segment/tmtc/maxstream.ml
@@ -25,7 +25,7 @@
open Latlong
open Printf
module W = Wavecard
-module Tm_Pprz = Pprz.Protocol(struct let name = "telemetry_ap" end)
+module Tm_Pprz = Pprz.Protocol(struct let name = "telemetry_fbw" end)
module Ground_Pprz = Pprz.Protocol(struct let name = "ground" end)
module Dl_Pprz = Pprz.Protocol(struct let name = "datalink" end)
module PprzTransport = Serial.Transport(Tm_Pprz)