diff --git a/Makefile b/Makefile
index af0bd3282c..d1f4c2f58e 100644
--- a/Makefile
+++ b/Makefile
@@ -212,6 +212,13 @@ clean:
find . -mindepth 2 -name Makefile -exec sh -c '$(MAKE) -C `dirname {}` $@' \;
find . -name '*~' -exec rm -f {} \;
+cleanspaces:
+ find ./sw/airborne -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \;
+ find ./conf -name '*.makefile' -exec sed -i {} -e 's/[ \t]*$$//' ';'
+ find ./sw -name '*.ml' -exec sed -i {} -e 's/[ \t]*$$//' ';'
+ find ./sw -name '*.mli' -exec sed -i {} -e 's/[ \t]*$$//' ';'
+ find ./conf -name '*.xml' -exec sed -i {} -e 's/[ \t]*$$//' ';'
+
dist_clean : clean
diff --git a/conf/airframes/ENAC/fixed-wing/drops.xml b/conf/airframes/ENAC/fixed-wing/drops.xml
index 72d7a9719f..cf7359cc92 100644
--- a/conf/airframes/ENAC/fixed-wing/drops.xml
+++ b/conf/airframes/ENAC/fixed-wing/drops.xml
@@ -1,4 +1,4 @@
-
+on
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CONFIG = \"tiny_2_1_1.h\"
-
-include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
-
-FLASH_MODE=IAP
-
-XSENS_UART_NR = 0
-
-ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED
-ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
-
-ap.srcs += commands.c
-
-ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017
-ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
-
-ap.CFLAGS += -DRADIO_CONTROL
-ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
-
-#ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600
-#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
-
-# Maxstream API protocol
-ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600 -DTELEMETRY_MODE_FBW=1
-ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
-
-ap.CFLAGS += -DINTER_MCU -DUSE_MODULES
-ap.srcs += inter_mcu.c
-
-ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_4 -DUSE_ADC_5
-ap.srcs += $(SRC_ARCH)/adc_hw.c
-
-ap.srcs += gps_xsens.c gps.c latlong.c
-
-ap.CFLAGS += -DALT_KALMAN
-ap.srcs += estimator.c
-
-ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
-
-ap.srcs += nav_line.c nav_survey_rectangle.c
-
-# Config for SITL simulation
-include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
-sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DTRAFFIC_INFO
-sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c
-
-
diff --git a/conf/airframes/TU_Delft/MicrojetBR.xml b/conf/airframes/TU_Delft/MicrojetBR.xml
new file mode 100644
index 0000000000..0027581695
--- /dev/null
+++ b/conf/airframes/TU_Delft/MicrojetBR.xml
@@ -0,0 +1,273 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/airframes/TU_Delft/MicrojetCDW.xml b/conf/airframes/TU_Delft/MicrojetCDW.xml
new file mode 100644
index 0000000000..32cbb91002
--- /dev/null
+++ b/conf/airframes/TU_Delft/MicrojetCDW.xml
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/airframes/TUDelft/Trip50A.xml b/conf/airframes/TU_Delft/Trip50A.xml
similarity index 98%
rename from conf/airframes/TUDelft/Trip50A.xml
rename to conf/airframes/TU_Delft/Trip50A.xml
index 7c1ffb291f..0a681fbb23 100644
--- a/conf/airframes/TUDelft/Trip50A.xml
+++ b/conf/airframes/TU_Delft/Trip50A.xml
@@ -284,9 +284,9 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET -DSTRONG_WI
ap.srcs += infrared.c estimator.c gyro.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
#ap.srcs += baro_bmp.c $(SRC_ARCH)/i2c_hw.c i2c.c
#ap.CFLAGS += -DUSE_I2C0 -DUSE_BARO_BMP -DBARO_BMP_ACCEL
@@ -294,7 +294,7 @@ ap.srcs += nav_line.c nav_survey_rectangle.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK
diff --git a/conf/airframes/TUDelft/Trip50B.xml b/conf/airframes/TU_Delft/Trip50B.xml
similarity index 97%
rename from conf/airframes/TUDelft/Trip50B.xml
rename to conf/airframes/TU_Delft/Trip50B.xml
index 18d61f70ad..af557a6d57 100644
--- a/conf/airframes/TUDelft/Trip50B.xml
+++ b/conf/airframes/TU_Delft/Trip50B.xml
@@ -289,9 +289,9 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET -DSTRONG_WI
ap.srcs += infrared.c estimator.c gyro.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
ap.srcs += baro_bmp.c $(SRC_ARCH)/i2c_hw.c i2c.c
ap.CFLAGS += -DUSE_I2C0 -DUSE_BARO_BMP -DBARO_BMP_ACCEL
@@ -303,7 +303,7 @@ ap.srcs += cam.c point.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK
@@ -311,7 +311,7 @@ sim.CFLAGS += -DUSE_JOYSTICK
sim.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH_ROLL
# -DTEST_CAM
sim.srcs += cam.c point.c
-sim.srcs += bomb.c
+sim.srcs += subsystems/navigation/bomb.c
diff --git a/conf/airframes/TUDelft/holiday50.xml b/conf/airframes/TU_Delft/holiday50.xml
similarity index 96%
rename from conf/airframes/TUDelft/holiday50.xml
rename to conf/airframes/TU_Delft/holiday50.xml
index 18fd220371..3a1745e964 100644
--- a/conf/airframes/TUDelft/holiday50.xml
+++ b/conf/airframes/TU_Delft/holiday50.xml
@@ -283,7 +283,7 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DTUNE_AGRESSIVE_CLIMB
ap.CFLAGS += -DUSE_GYRO -DADXRS150
@@ -291,30 +291,30 @@ ap.srcs += gyro.c
ap.CFLAGS += -DUSE_MODULES
-ap.srcs += nav_line.c nav_survey_rectangle.c
-ap.srcs += traffic_info.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/traffic_info.c
# camera control
ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH_ROLL
# -DTEST_CAM
ap.srcs += cam.c point.c
-# traffic_info.c
+# subsystems/navigation/traffic_info.c
ap.CFLAGS += -DWIND_INFO -DSTRONG_WIND
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO -DSTRONG_WIND
-sim.srcs += nav_survey_rectangle.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
sim.CFLAGS += -DTUNE_AGRESSIVE_CLIMB
-# traffic_info.c
+# subsystems/navigation/traffic_info.c
sim.CFLAGS += -DUSE_MODULES
sim.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH_ROLL
# -DTEST_CAM
sim.srcs += cam.c point.c
-sim.srcs += bomb.c
+sim.srcs += subsystems/navigation/bomb.c
diff --git a/conf/airframes/TU_Delft/yapa_xsens.xml b/conf/airframes/TU_Delft/yapa_xsens.xml
new file mode 100644
index 0000000000..3534d3d41f
--- /dev/null
+++ b/conf/airframes/TU_Delft/yapa_xsens.xml
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/airframes/demo_module.xml b/conf/airframes/demo_module.xml
index 919a869c67..f8e4223226 100644
--- a/conf/airframes/demo_module.xml
+++ b/conf/airframes/demo_module.xml
@@ -197,16 +197,16 @@ ap.srcs += infrared.c estimator.c
########## Nav
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_survey_rectangle.c
-ap.srcs += nav_line.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/example_twog_analogimu.xml b/conf/airframes/example_twog_analogimu.xml
new file mode 100644
index 0000000000..a4cf652c0e
--- /dev/null
+++ b/conf/airframes/example_twog_analogimu.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ap.CFLAGS += -DANALOGIMU_ROTATED
+ ap.CFLAGS += -DANALOGIMU_ZERO_AVERAGE
+
+
+
diff --git a/conf/airframes/hitl_usb.xml b/conf/airframes/hitl_usb.xml
index c192922080..7108d6acf2 100644
--- a/conf/airframes/hitl_usb.xml
+++ b/conf/airframes/hitl_usb.xml
@@ -144,9 +144,9 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
# Configuration for Hardware In The Loop
ap.CFLAGS += -DHITL
@@ -155,9 +155,9 @@ ap.CFLAGS += -DGPS_USE_LATLONG # simulating LEA 5H
# Config for SITL simulation
sim.ARCHDIR = $(ARCH)
sim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED
-sim.srcs = latlong.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
+sim.srcs = latlong.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/traffic_info.c
diff --git a/conf/airframes/jsbsim.xml b/conf/airframes/jsbsim.xml
index d5024ad2e1..7b2f1d6d0b 100644
--- a/conf/airframes/jsbsim.xml
+++ b/conf/airframes/jsbsim.xml
@@ -200,7 +200,7 @@
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny_sim.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
#### Config for SITL simulation with JSBSim
@@ -208,7 +208,7 @@ SRC_FIRMWARE = firmwares/fixedwing
include $(PAPARAZZI_SRC)/conf/autopilot/sitl_jsbsim.makefile
jsbsim.CFLAGS += -DBOARD_CONFIG=\"tiny_sim.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-jsbsim.srcs += nav_line.c nav_survey_rectangle.c
+jsbsim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
jsbsim.srcs += $(SIMDIR)/sim_ac_fw.c
diff --git a/conf/airframes/microjet_raw_makefile.xml b/conf/airframes/microjet_raw_makefile.xml
index c387a94e29..050277440c 100644
--- a/conf/airframes/microjet_raw_makefile.xml
+++ b/conf/airframes/microjet_raw_makefile.xml
@@ -200,8 +200,8 @@
ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
- ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
- ap.srcs += nav_line.c nav_survey_rectangle.c
+ ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
+ ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
ap.CFLAGS += -DTRAFFIC_INFO -DALT_KALMAN
sim.CFLAGS += -DTRAFFIC_INFO
diff --git a/conf/airframes/mm/extra/press_t.xml b/conf/airframes/mm/extra/press_t.xml
old mode 100755
new mode 100644
index bb2d3ddff1..38dfec588a
--- a/conf/airframes/mm/extra/press_t.xml
+++ b/conf/airframes/mm/extra/press_t.xml
@@ -260,10 +260,10 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3 -DSCK_PIN=2
@@ -280,9 +280,9 @@ ap.CFLAGS += -DUSE_BARO_SCP
ap.srcs += joystick.c
ap.CFLAGS += -DUSE_JOYSTICK
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
-ap.srcs += snav.c
+ap.srcs += subsystems/navigation/snav.c
# distance sensor
ap.CFLAGS += -DUSE_ADC_3 -DUSE_ADC_GENERIC -DADC_CHANNEL_GENERIC1=ADC_3 -DADC_CHANNEL_GENERIC_NB_SAMPLES=16
@@ -291,7 +291,7 @@ ap.srcs += adc_generic.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK
diff --git a/conf/airframes/mm/extra/probe_t.xml b/conf/airframes/mm/extra/probe_t.xml
old mode 100755
new mode 100644
diff --git a/conf/airframes/mm/fixed-wing/drops.xml b/conf/airframes/mm/fixed-wing/drops.xml
index ba8c932c62..69dc6e5362 100644
--- a/conf/airframes/mm/fixed-wing/drops.xml
+++ b/conf/airframes/mm/fixed-wing/drops.xml
@@ -278,14 +278,14 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl_a.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl_a.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
-ap.srcs += snav.c
+ap.srcs += subsystems/navigation/snav.c
# Config for SITL simulation
# include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
@@ -294,12 +294,12 @@ sim.ARCH = sitl
sim.TARGET = autopilot
sim.TARGETDIR = autopilot
sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO
-sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
+sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
-sim.srcs += bomb.c
+sim.srcs += subsystems/navigation/bomb.c
diff --git a/conf/airframes/mm/fixed-wing/funjet43.xml b/conf/airframes/mm/fixed-wing/funjet43.xml
index 5da7f694b1..8da7f898a5 100644
--- a/conf/airframes/mm/fixed-wing/funjet43.xml
+++ b/conf/airframes/mm/fixed-wing/funjet43.xml
@@ -1,4 +1,4 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -38,7 +76,7 @@
-
+
@@ -81,8 +119,6 @@
@@ -91,8 +127,6 @@
-
-
@@ -125,7 +159,6 @@
-
@@ -140,10 +173,6 @@
-
-
-
-
-
-
-
-
+
-
-CONFIG = \"tiny_2_1.h\"
-
-include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
-
-FLASH_MODE=IAP
-
-ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1
-ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
-
-ap.srcs += commands.c
-
-ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017
-ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
-
-ap.CFLAGS += -DRADIO_CONTROL
-ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
-
-ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600
-ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
-
-#TRANSPARENT
-#ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600
-#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
-
-
-ap.CFLAGS += -DINTER_MCU
-ap.srcs += inter_mcu.c
-
-ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
-ap.srcs += $(SRC_ARCH)/adc_hw.c
-
-ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG
-# -DGPS_LED=2
-ap.srcs += gps_ubx.c gps.c latlong.c
-
-ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
-ap.srcs += infrared.c estimator.c
-
-ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
-
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
-
-ap.srcs += humid_sht.c
-ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3 -DSCK_PIN=2
-
-ap.srcs += baro_scp.c
-ap.CFLAGS += -DUSE_BARO_SCP
-
-ap.srcs += joystick.c
-ap.CFLAGS += -DUSE_JOYSTICK
-
-# Config for SITL simulation
-include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
-sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
-
-sim.srcs += joystick.c
-sim.CFLAGS += -DUSE_JOYSTICK
-
-
-
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi9.xml b/conf/airframes/mm/fixed-wing/funjetgfi9.xml
index c5228ba9c4..2a4de16260 100644
--- a/conf/airframes/mm/fixed-wing/funjetgfi9.xml
+++ b/conf/airframes/mm/fixed-wing/funjetgfi9.xml
@@ -219,10 +219,10 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3 -DSCK_PIN=2
@@ -236,7 +236,7 @@ ap.CFLAGS += -DUSE_JOYSTICK
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK
diff --git a/conf/airframes/mm/fixed-wing/funjetlisa.xml b/conf/airframes/mm/fixed-wing/funjetlisa.xml
new file mode 100644
index 0000000000..d6e6556d1c
--- /dev/null
+++ b/conf/airframes/mm/fixed-wing/funjetlisa.xml
@@ -0,0 +1,173 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/airframes/mm/fixed-wing/funjetlisam.xml b/conf/airframes/mm/fixed-wing/funjetlisam.xml
new file mode 100644
index 0000000000..8173da67b3
--- /dev/null
+++ b/conf/airframes/mm/fixed-wing/funjetlisam.xml
@@ -0,0 +1,173 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/airframes/mm/fixed-wing/funjetmm.xml b/conf/airframes/mm/fixed-wing/funjetmm.xml
old mode 100755
new mode 100644
diff --git a/conf/airframes/mm/fixed-wing/funjetmm2.xml b/conf/airframes/mm/fixed-wing/funjetmm2.xml
index 608dd22c5f..4485d2195a 100644
--- a/conf/airframes/mm/fixed-wing/funjetmm2.xml
+++ b/conf/airframes/mm/fixed-wing/funjetmm2.xml
@@ -246,17 +246,17 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=30 -DSCK_PIN=4
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
-ap.srcs += snav.c
+ap.srcs += subsystems/navigation/snav.c
# distance sensor
ap.CFLAGS += -DUSE_ADC_3 -DUSE_ADC_GENERIC -DADC_CHANNEL_GENERIC1=ADC_3 -DADC_CHANNEL_GENERIC_NB_SAMPLES=16
@@ -265,9 +265,9 @@ ap.srcs += adc_generic.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
-sim.srcs += bomb.c
+sim.srcs += subsystems/navigation/bomb.c
diff --git a/conf/airframes/mm/fixed-wing/merlin.xml b/conf/airframes/mm/fixed-wing/merlin.xml
index d2ecc86943..cd9c69901e 100644
--- a/conf/airframes/mm/fixed-wing/merlin.xml
+++ b/conf/airframes/mm/fixed-wing/merlin.xml
@@ -2,7 +2,6 @@
-
@@ -92,15 +89,12 @@
-
-
-
-
+
+
-
-
-CONFIG = \"tiny_2_1.h\"
+
+
+
+
+
+
+
+
+
+
-include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-FLASH_MODE=IAP
+
+
+
+
+
+
-ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1
-ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
+
+
+
+
+
-ap.srcs += commands.c
-
-ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017
-ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
-
-ap.CFLAGS += -DRADIO_CONTROL -DUSE_RC_TELEMETRY
-ap.srcs += radio_control.c ppm_telemetry.c
-
-ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600
-ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
-
-#TRANSPARENT
-#ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -#DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600
-#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
-
-ap.CFLAGS += -DINTER_MCU
-ap.srcs += inter_mcu.c
-
-ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3
-ap.srcs += $(SRC_ARCH)/adc_hw.c
-
-ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400
-# -DGPS_USE_LATLONG
-ap.srcs += gps_ubx.c gps.c latlong.c
-
-ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
-ap.srcs += infrared.c estimator.c
-
-ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
-
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
-
-ap.srcs += snav.c
-
-# Config for SITL simulation
-# include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
-sim.ARCHDIR = $(ARCH)
-sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO
-sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
-
-sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
-
-
diff --git a/conf/airframes/mm/fixed-wing/miniwing.xml b/conf/airframes/mm/fixed-wing/miniwing.xml
index d27f5364ac..3e9f7d9597 100644
--- a/conf/airframes/mm/fixed-wing/miniwing.xml
+++ b/conf/airframes/mm/fixed-wing/miniwing.xml
@@ -208,10 +208,10 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
#ap.CFLAGS += -DTELEMETRY_MODE_FBW=1
@@ -220,7 +220,7 @@ ap.CFLAGS += -DUSE_ACCEL_MEMSIC -DUSE_ADC_3 -DUSE_ADC_4
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/mm/fixed-wing/slowfast.xml b/conf/airframes/mm/fixed-wing/slowfast.xml
index f29a776abd..ddf00fbd9a 100644
--- a/conf/airframes/mm/fixed-wing/slowfast.xml
+++ b/conf/airframes/mm/fixed-wing/slowfast.xml
@@ -260,11 +260,11 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
-ap.srcs += snav.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/snav.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
@@ -272,7 +272,7 @@ ap.srcs += gyro.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
-->
diff --git a/conf/airframes/mm/fixed-wing/slowfast2.xml b/conf/airframes/mm/fixed-wing/slowfast2.xml
index b9a62671a0..708cf98ac2 100644
--- a/conf/airframes/mm/fixed-wing/slowfast2.xml
+++ b/conf/airframes/mm/fixed-wing/slowfast2.xml
@@ -274,11 +274,11 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
-ap.srcs += snav.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/snav.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
@@ -286,7 +286,7 @@ ap.srcs += gyro.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
-->
diff --git a/conf/airframes/mm/fixed-wing/twinstarmm.xml b/conf/airframes/mm/fixed-wing/twinstarmm.xml
index 95bfd5eb83..92db7ebddb 100644
--- a/conf/airframes/mm/fixed-wing/twinstarmm.xml
+++ b/conf/airframes/mm/fixed-wing/twinstarmm.xml
@@ -235,25 +235,25 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
-ap.srcs += snav.c
+ap.srcs += subsystems/navigation/snav.c
# Config for SITL simulation
# include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.ARCHDIR = $(ARCHI)
sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO
-sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
+sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
-sim.srcs += bomb.c
+sim.srcs += subsystems/navigation/bomb.c
diff --git a/conf/airframes/mm/hangar/black_one.xml b/conf/airframes/mm/hangar/black_one.xml
index 3c768eb7e0..fcb1f0398f 100644
--- a/conf/airframes/mm/hangar/black_one.xml
+++ b/conf/airframes/mm/hangar/black_one.xml
@@ -247,15 +247,15 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
#Cap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM
-#Cap.srcs += traffic_info.c point.c cam.c
+#Cap.srcs += subsystems/navigation/traffic_info.c point.c cam.c
# Video switch
@@ -271,10 +271,10 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DIR_360
-sim.srcs += bomb.c
+sim.srcs += subsystems/navigation/bomb.c
#Csim.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM
-#Csim.srcs += traffic_info.c point.c
+#Csim.srcs += subsystems/navigation/traffic_info.c point.c
diff --git a/conf/airframes/mm/hangar/glass_one1.xml b/conf/airframes/mm/hangar/glass_one1.xml
index 136e6b3d81..c87a0f442c 100644
--- a/conf/airframes/mm/hangar/glass_one1.xml
+++ b/conf/airframes/mm/hangar/glass_one1.xml
@@ -239,7 +239,7 @@ ap.srcs += infrared.c estimator.c
# -DALT_KALMAN
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c latlong.c nav_survey_rectangle.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c latlong.c subsystems/navigation/nav_survey_rectangle.c
#ap.CFLAGS += -DUSE_GYRO -DADXRS150
#ap.srcs += gyro.c
@@ -247,7 +247,7 @@ ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c latlong.c nav_survey_rectangle.c
#ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH
#ap.srcs += point.c cam.c
-ap.srcs += traffic_info.c nav_line.c
+ap.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
# Video switch
ap.CFLAGS += -DUSE_GPIO
@@ -261,9 +261,9 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM
-sim.srcs += bomb.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c
-sim.srcs += traffic_info.c nav_line.c
+sim.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/mm/hangar/glass_one2.xml b/conf/airframes/mm/hangar/glass_one2.xml
index 8270362ff4..d1b53ac34e 100644
--- a/conf/airframes/mm/hangar/glass_one2.xml
+++ b/conf/airframes/mm/hangar/glass_one2.xml
@@ -213,12 +213,12 @@ ap.srcs += infrared.c estimator.c
# -DALT_KALMAN
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c latlong.c nav_survey_rectangle.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c latlong.c subsystems/navigation/nav_survey_rectangle.c
#ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH
#ap.srcs += point.c cam.c
-ap.srcs += traffic_info.c nav_line.c
+ap.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
# Video switch
ap.CFLAGS += -DUSE_GPIO
@@ -232,9 +232,9 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM
-sim.srcs += bomb.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c
-sim.srcs += traffic_info.c nav_line.c
+sim.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/mm/hangar/glass_one3.xml b/conf/airframes/mm/hangar/glass_one3.xml
index ffffb63724..8eb4e8755e 100644
--- a/conf/airframes/mm/hangar/glass_one3.xml
+++ b/conf/airframes/mm/hangar/glass_one3.xml
@@ -240,12 +240,12 @@ ap.srcs += infrared.c estimator.c
# -DALT_KALMAN
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c latlong.c nav_survey_rectangle.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c latlong.c subsystems/navigation/nav_survey_rectangle.c
#ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH
#ap.srcs += point.c cam.c
-ap.srcs += traffic_info.c nav_line.c
+ap.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
# Video switch
ap.CFLAGS += -DUSE_GPIO
@@ -259,9 +259,9 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM
-sim.srcs += bomb.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c
-sim.srcs += traffic_info.c nav_line.c
+sim.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/mm/hangar/lila.xml b/conf/airframes/mm/hangar/lila.xml
index 04403d4751..c93cca0366 100644
--- a/conf/airframes/mm/hangar/lila.xml
+++ b/conf/airframes/mm/hangar/lila.xml
@@ -238,19 +238,19 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl_a.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl_a.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
-ap.srcs += snav.c
+ap.srcs += subsystems/navigation/snav.c
# Config for SITL simulation
sim.ARCHDIR = $(ARCHI)
sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO
-sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
+sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/mm/hangar/mac06a.xml b/conf/airframes/mm/hangar/mac06a.xml
index c2ba4a2dc0..e7e2240692 100644
--- a/conf/airframes/mm/hangar/mac06a.xml
+++ b/conf/airframes/mm/hangar/mac06a.xml
@@ -232,13 +232,13 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
@@ -250,7 +250,7 @@ ap.srcs += bomb.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360
-sim.srcs += bomb.c
+sim.srcs += subsystems/navigation/bomb.c
diff --git a/conf/airframes/mm/hangar/red_one.xml b/conf/airframes/mm/hangar/red_one.xml
index 028744c211..e2aca5ec54 100644
--- a/conf/airframes/mm/hangar/red_one.xml
+++ b/conf/airframes/mm/hangar/red_one.xml
@@ -260,15 +260,15 @@ ap.srcs += infrared.c estimator.c
# -DALT_KALMAN
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c latlong.c nav_survey_rectangle.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c latlong.c subsystems/navigation/nav_survey_rectangle.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/bomb.c
ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH
-ap.srcs += traffic_info.c point.c cam.c nav_line.c
+ap.srcs += subsystems/navigation/traffic_info.c point.c cam.c subsystems/navigation/nav_line.c
ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A
ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c
@@ -288,10 +288,10 @@ ap.CFLAGS += -DUSE_CURRENT
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM
-sim.srcs += bomb.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c
sim.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH
-sim.srcs += traffic_info.c point.c cam.c nav_line.c
+sim.srcs += subsystems/navigation/traffic_info.c point.c cam.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/mm/rotor/qmk1.xml b/conf/airframes/mm/rotor/qmk1.xml
old mode 100755
new mode 100644
index 2c010bd134..8935328ed0
--- a/conf/airframes/mm/rotor/qmk1.xml
+++ b/conf/airframes/mm/rotor/qmk1.xml
@@ -189,8 +189,9 @@
+
-
+
diff --git a/conf/airframes/obsolete/easystar2.xml b/conf/airframes/obsolete/easystar2.xml
index 55bd1c9864..2ebf40831f 100644
--- a/conf/airframes/obsolete/easystar2.xml
+++ b/conf/airframes/obsolete/easystar2.xml
@@ -211,10 +211,10 @@ ap.srcs += infrared.c estimator.c
# Control loops
ap.CFLAGS += -DNAV -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
# Camera control
#ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH_ROLL
@@ -228,7 +228,7 @@ ap.srcs += airspeed.c airspeed_ets.c baro_ets.c i2c.c $(SRC_ARCH)/i2c_hw.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DLOITER_TRIM -DALT_KALMAN -DUSE_MODULES
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
sim.CFLAGS += -DUSE_AIRSPEED_ETS -DUSE_AIRSPEED -DUSE_BARO_ETS -DUSE_I2C0 -DAGR_CLIMB
sim.srcs += airspeed.c airspeed_ets.c baro_ets.c i2c.c $(SRC_ARCH)/i2c_hw.c
diff --git a/conf/airframes/obsolete/kalscott_easystar.xml b/conf/airframes/obsolete/kalscott_easystar.xml
index 8e5c721c67..6f5519ba87 100644
--- a/conf/airframes/obsolete/kalscott_easystar.xml
+++ b/conf/airframes/obsolete/kalscott_easystar.xml
@@ -191,16 +191,16 @@ ap.srcs += infrared.c estimator.c
# Control loops
ap.CFLAGS += -DNAV -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DLOITER_TRIM -DALT_KALMAN -DUSE_MODULES
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/obsolete/malolo_sim.xml b/conf/airframes/obsolete/malolo_sim.xml
index 972a70e07f..bed7e4dce1 100644
--- a/conf/airframes/obsolete/malolo_sim.xml
+++ b/conf/airframes/obsolete/malolo_sim.xml
@@ -233,8 +233,8 @@ sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV
sim.srcs = $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/ivy_transport.c
-sim.srcs += latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
sim.srcs += $(SIMDIR)/sim_ac_jsbsim.c $(SIMDIR)/sim_ac_fw.c
diff --git a/conf/airframes/obsolete/microjet5.xml b/conf/airframes/obsolete/microjet5.xml
index 5d3e06a0ea..418d2ba25f 100644
--- a/conf/airframes/obsolete/microjet5.xml
+++ b/conf/airframes/obsolete/microjet5.xml
@@ -202,15 +202,15 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DTRAFFIC_INFO
-sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/obsolete/microjet5_tp_auto.xml b/conf/airframes/obsolete/microjet5_tp_auto.xml
index 40f5e9cca3..2202e38386 100644
--- a/conf/airframes/obsolete/microjet5_tp_auto.xml
+++ b/conf/airframes/obsolete/microjet5_tp_auto.xml
@@ -213,7 +213,7 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
@@ -227,7 +227,7 @@ ap.srcs += gyro.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\"
-sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c
sim.CFLAGS += -DUSE_GYRO -DADXRS150
sim.srcs += gyro.c
diff --git a/conf/airframes/obsolete/microjet6.xml b/conf/airframes/obsolete/microjet6.xml
index af9ce282ae..b253366e0c 100644
--- a/conf/airframes/obsolete/microjet6.xml
+++ b/conf/airframes/obsolete/microjet6.xml
@@ -235,7 +235,7 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c nav_survey_rectangle.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
@@ -244,7 +244,7 @@ ap.srcs += gyro.c
ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A
ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c
-ap.srcs += nav_line.c
+ap.srcs += subsystems/navigation/nav_line.c
# Harware In The Loop
@@ -254,7 +254,7 @@ ap.srcs += nav_line.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DUSE_BARO_MS5534A
-sim.srcs += nav_survey_rectangle.c $(SRC_ARCH)/sim_baro.c bomb.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c $(SRC_ARCH)/sim_baro.c subsystems/navigation/bomb.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/obsolete/microjetI.xml b/conf/airframes/obsolete/microjetI.xml
index 247037bca2..ed08e55f50 100644
--- a/conf/airframes/obsolete/microjetI.xml
+++ b/conf/airframes/obsolete/microjetI.xml
@@ -222,12 +222,12 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
ap.srcs += light.c
ap.CFLAGS += -DUSE_LIGHT
@@ -239,7 +239,7 @@ ap.srcs += adc_generic.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
sim.srcs += light.c
sim.CFLAGS += -DUSE_LIGHT
diff --git a/conf/airframes/obsolete/microjetII.xml b/conf/airframes/obsolete/microjetII.xml
index 43717e14c5..1948c1959d 100644
--- a/conf/airframes/obsolete/microjetII.xml
+++ b/conf/airframes/obsolete/microjetII.xml
@@ -221,13 +221,13 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
-ap.srcs += traffic_info.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/traffic_info.c
ap.srcs += light.c
ap.CFLAGS += -DUSE_LIGHT
@@ -235,8 +235,8 @@ ap.CFLAGS += -DUSE_LIGHT
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c
-sim.srcs += traffic_info.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
+sim.srcs += subsystems/navigation/traffic_info.c
sim.srcs += light.c
diff --git a/conf/airframes/obsolete/microjetIII.xml b/conf/airframes/obsolete/microjetIII.xml
index 5e6a97022d..36df078b8c 100644
--- a/conf/airframes/obsolete/microjetIII.xml
+++ b/conf/airframes/obsolete/microjetIII.xml
@@ -211,14 +211,14 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
# -DESTIMATOR_COMP_FILTER
ap.srcs += gyro.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
-ap.srcs += traffic_info.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/traffic_info.c
# PID sensor
ap.CFLAGS += -DUSE_ADC_6 -DUSE_ADC_GENERIC -DADC_CHANNEL_GENERIC1=ADC_6 -DADC_CHANNEL_GENERIC_NB_SAMPLES=16
@@ -228,7 +228,7 @@ ap.srcs += adc_generic.c
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
# -DESTIMATOR_COMP_FILTER
-sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/traffic_info.c
diff --git a/conf/airframes/obsolete/minimag_fs.xml b/conf/airframes/obsolete/minimag_fs.xml
index e43bc1550f..4e5aa431e1 100644
--- a/conf/airframes/obsolete/minimag_fs.xml
+++ b/conf/airframes/obsolete/minimag_fs.xml
@@ -212,7 +212,7 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c nav_survey_rectangle.c nav_line.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
ap.CFLAGS += -DDIGITAL_CAM
ap.srcs += dc.c
@@ -220,7 +220,7 @@ ap.srcs += dc.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
sim.srcs += dc.c
diff --git a/conf/airframes/obsolete/slayer1.xml b/conf/airframes/obsolete/slayer1.xml
index 77fa715f5e..086cbd8421 100644
--- a/conf/airframes/obsolete/slayer1.xml
+++ b/conf/airframes/obsolete/slayer1.xml
@@ -224,12 +224,12 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
ap.CFLAGS += -DUSE_GYRO -DIDG300
-ap.srcs += gyro.c bomb.c
+ap.srcs += gyro.c subsystems/navigation/bomb.c
# Video switch
ap.CFLAGS += -DLIGHT_PIN_1=3 -DUSE_GPIO
@@ -244,7 +244,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += bomb.c nav_survey_rectangle.c nav_line.c
+sim.srcs += subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/obsolete/slayer3.xml b/conf/airframes/obsolete/slayer3.xml
index 147573ba8e..928b3c88d8 100644
--- a/conf/airframes/obsolete/slayer3.xml
+++ b/conf/airframes/obsolete/slayer3.xml
@@ -226,7 +226,7 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
@@ -245,7 +245,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360
-sim.srcs += nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/obsolete/slayerJH.xml b/conf/airframes/obsolete/slayerJH.xml
index 174ac3d98b..48b830b90b 100644
--- a/conf/airframes/obsolete/slayerJH.xml
+++ b/conf/airframes/obsolete/slayerJH.xml
@@ -209,7 +209,7 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c nav_survey_rectangle.c nav_line.c snav.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/snav.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
@@ -228,7 +228,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c snav.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/snav.c
diff --git a/conf/airframes/obsolete/slicer1.xml b/conf/airframes/obsolete/slicer1.xml
index 5fe62b7cbf..3cd8b34397 100644
--- a/conf/airframes/obsolete/slicer1.xml
+++ b/conf/airframes/obsolete/slicer1.xml
@@ -220,21 +220,21 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH_ROLL
# -DTEST_CAM
ap.srcs += cam.c point.c
-# traffic_info.c
+# subsystems/navigation/traffic_info.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
sim.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH_ROLL
-sim.srcs += cam.c point.c traffic_info.c
+sim.srcs += cam.c point.c subsystems/navigation/traffic_info.c
diff --git a/conf/airframes/obsolete/slicer2.xml b/conf/airframes/obsolete/slicer2.xml
index 38c00d9f32..0311507969 100644
--- a/conf/airframes/obsolete/slicer2.xml
+++ b/conf/airframes/obsolete/slicer2.xml
@@ -202,14 +202,14 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/obsolete/spirit.xml b/conf/airframes/obsolete/spirit.xml
index 96ad443c3f..53c1dc9c9e 100644
--- a/conf/airframes/obsolete/spirit.xml
+++ b/conf/airframes/obsolete/spirit.xml
@@ -219,9 +219,9 @@ ap.CFLAGS += -DUSE_GYRO -DADXRS150 -DPID_RATE_LOOP
ap.srcs += gyro.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
# Current sensor
ap.CFLAGS += -DUSE_ADC_7 -DUSE_ADC_GENERIC -DADC_CHANNEL_GENERIC1=ADC_7 -DADC_CHANNEL_GENERIC_NB_SAMPLES=16
@@ -231,7 +231,7 @@ ap.srcs += adc_generic.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/traffic_info.c
ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A
ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c
diff --git a/conf/airframes/obsolete/spirit_proto.xml b/conf/airframes/obsolete/spirit_proto.xml
index 4600b911b2..257a656625 100644
--- a/conf/airframes/obsolete/spirit_proto.xml
+++ b/conf/airframes/obsolete/spirit_proto.xml
@@ -204,9 +204,9 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
# Current sensor
ap.CFLAGS += -DUSE_ADC_7 -DUSE_ADC_GENERIC -DADC_CHANNEL_GENERIC1=ADC_7 -DADC_CHANNEL_GENERIC_NB_SAMPLES=16
@@ -218,7 +218,7 @@ ap.srcs += adc_generic.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/traffic_info.c
ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A
ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c
diff --git a/conf/airframes/obsolete/storm1.xml b/conf/airframes/obsolete/storm1.xml
index b7f4ba0ebe..99dc34336d 100644
--- a/conf/airframes/obsolete/storm1.xml
+++ b/conf/airframes/obsolete/storm1.xml
@@ -268,14 +268,14 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
# ap.CFLAGS += -DUSE_GYRO -DADXRS150
# ap.srcs += gyro.c
-ap.srcs += traffic_info.c nav_survey_rectangle.c
-ap.srcs += bomb.c
+ap.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/bomb.c
# Hack to use the same tuning file than slayer1
ap.CFLAGS += -DUSE_GPIO
@@ -290,8 +290,8 @@ ap.srcs += $(SRC_ARCH)/gpio.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360
-sim.srcs += traffic_info.c
-sim.srcs += bomb.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/traffic_info.c
+sim.srcs += subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/obsolete/tiny2.xml b/conf/airframes/obsolete/tiny2.xml
index ef4c1f645c..4220672e22 100644
--- a/conf/airframes/obsolete/tiny2.xml
+++ b/conf/airframes/obsolete/tiny2.xml
@@ -231,7 +231,7 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c nav_survey_rectangle.c nav_line.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
# Harware In The Loop
@@ -241,7 +241,7 @@ ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c nav_survey_rectangle.c nav_line.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c
diff --git a/conf/airframes/obsolete/tl.xml b/conf/airframes/obsolete/tl.xml
index 2aa4ab9b33..0787729120 100644
--- a/conf/airframes/obsolete/tl.xml
+++ b/conf/airframes/obsolete/tl.xml
@@ -118,7 +118,7 @@ ap.srcs += $(TL)/tl_baro.c
ap.srcs += micromag.c $(SRC_ARCH)/micromag_hw.c
ap.CFLAGS += -DNAV
-ap.srcs += common_nav.c $(TL)/tl_nav.c
+ap.srcs += subsystems/navigation/common_nav.c $(TL)/tl_nav.c
#ap.CFLAGS += -D TL_BARO_W1=0xABDC -D TL_BARO_W2=0x849A -D TL_BARO_W3=0X939E -D TL_BARO_W4=0xB259
diff --git a/conf/airframes/obsolete/twinjet1.xml b/conf/airframes/obsolete/twinjet1.xml
index dcff373e0a..0721f67e8b 100644
--- a/conf/airframes/obsolete/twinjet1.xml
+++ b/conf/airframes/obsolete/twinjet1.xml
@@ -197,7 +197,7 @@ ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DLED -DTIM
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_ap.c main.c
#ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600
-#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c traffic_info.c xbee.c
+#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c subsystems/navigation/traffic_info.c xbee.c
ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
@@ -222,12 +222,12 @@ ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += gyro.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
-# chemotaxis.c anemotaxis.c discsurvey.c
+ap.srcs += subsystems/navigation/nav_line.c
+# chemotaxis.c anemotaxis.c subsystems/navigation/discsurvey.c
-ap.srcs += nav_survey_rectangle.c snav.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/snav.c
ap.srcs += light.c
ap.CFLAGS += -DUSE_LIGHT
@@ -243,10 +243,10 @@ test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_tran
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"classix.h\" -DAGR_CLIMB -DLOITER_TRIM
-#sim.srcs += traffic_info.c
-#sim.srcs += nav_line.c chemotaxis.c anemotaxis.c discsurvey.c bomb.c nav_survey_rectangle.c
+#sim.srcs += subsystems/navigation/traffic_info.c
+#sim.srcs += subsystems/navigation/nav_line.c chemotaxis.c anemotaxis.c subsystems/navigation/discsurvey.c subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c
-sim.srcs += nav_survey_rectangle.c nav_line.c light.c snav.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c light.c subsystems/navigation/snav.c
sim.CFLAGS += -DUSE_LIGHT
sim.CFLAGS += -DUSE_ADC_GENERIC
diff --git a/conf/airframes/obsolete/twinstar1.xml b/conf/airframes/obsolete/twinstar1.xml
index 793ac767fa..94e676fbfb 100644
--- a/conf/airframes/obsolete/twinstar1.xml
+++ b/conf/airframes/obsolete/twinstar1.xml
@@ -185,12 +185,12 @@ ap.CFLAGS += -DUSE_UART0 -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLIN
ap.EXTRA_SRCS += pprz_transport.c downlink.c
# Datalink (on uart0) used to emulate sensors (infrared and gps)
-ap.EXTRA_SRCS += traffic_info.c datalink.c
+ap.EXTRA_SRCS += subsystems/navigation/traffic_info.c datalink.c
ap.CFLAGS += -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
-sim.srcs += nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/obsolete/twinstar6.xml b/conf/airframes/obsolete/twinstar6.xml
index 4d3425b523..a7a381a4eb 100644
--- a/conf/airframes/obsolete/twinstar6.xml
+++ b/conf/airframes/obsolete/twinstar6.xml
@@ -205,7 +205,7 @@ ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DLED -DTIM
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_ap.c main.c
ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600
-ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c traffic_info.c pprz_transport.c
+ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c subsystems/navigation/traffic_info.c pprz_transport.c
ap.CFLAGS += -DINTER_MCU -DMCU_SPI_LINK -DUSE_SPI -DSPI_MASTER
ap.srcs += inter_mcu.c link_mcu.c spi.c $(SRC_ARCH)/spi_hw.c
@@ -221,11 +221,11 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c
+ap.srcs += subsystems/navigation/nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
ap.CFLAGS += -DUSE_GPIO
ap.srcs += $(SRC_ARCH)/gpio.c
@@ -243,9 +243,9 @@ test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_tran
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"classix.h\" -DAGR_CLIMB -DLOITER_TRIM
-#sim.srcs += traffic_info.c
-sim.srcs += nav_line.c nav_survey_rectangle.c dc.c
-# chemotaxis.c anemotaxis.c discsurvey.c bomb.c nav_survey_rectangle.c
+#sim.srcs += subsystems/navigation/traffic_info.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c dc.c
+# chemotaxis.c anemotaxis.c subsystems/navigation/discsurvey.c subsystems/navigation/bomb.c subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/obsolete/tyto1.xml b/conf/airframes/obsolete/tyto1.xml
index 06ca0fd0a8..15feae9864 100644
--- a/conf/airframes/obsolete/tyto1.xml
+++ b/conf/airframes/obsolete/tyto1.xml
@@ -237,16 +237,16 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
-ap.srcs += gyro.c nav_line.c
-ap.srcs += nav_survey_rectangle.c
+ap.srcs += gyro.c subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
diff --git a/conf/airframes/obsolete/xxx1.xml b/conf/airframes/obsolete/xxx1.xml
index 7d34959884..7c967182fa 100644
--- a/conf/airframes/obsolete/xxx1.xml
+++ b/conf/airframes/obsolete/xxx1.xml
@@ -241,13 +241,12 @@ ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
ap.CFLAGS += -DUSE_GYRO -DADXRS150
-ap.srcs += gyro.c nav_line.c
-ap.srcs += nav_survey_rectangle.c
-
+ap.srcs += gyro.c subsystems/navigation/nav_line.c
+ap.srcs += subsystems/navigation/nav_survey_rectangle.c
# Hack to use the same tuning file than slayer1
ap.CFLAGS += -DUSE_GPIO
@@ -271,7 +270,7 @@ ap.CFLAGS += -DMOBILE_CAM
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM
# -DMOBILE_CAM
-sim.srcs += nav_line.c nav_survey_rectangle.c
+sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
# cam_roll.c jeremy_tuning.c
diff --git a/conf/airframes/tiny_hitl.xml b/conf/airframes/tiny_hitl.xml
index 162f5a4be5..ac97fa1fc3 100644
--- a/conf/airframes/tiny_hitl.xml
+++ b/conf/airframes/tiny_hitl.xml
@@ -196,9 +196,9 @@ ap.CFLAGS += -DUSE_INFRARED
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO
-ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
+ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c
-ap.srcs += nav_line.c nav_survey_rectangle.c
+ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c
# Configuration for Hardware In The Loop
ap.CFLAGS += -DHITL -UGPS_CONFIGURE -UUART0_BAUD -DUART0_BAUD=B57600
@@ -206,7 +206,7 @@ ap.CFLAGS += -DHITL -UGPS_CONFIGURE -UUART0_BAUD -DUART0_BAUD=B57600
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
-sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c
+sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/traffic_info.c
diff --git a/conf/airframes/twinjet_overo.xml b/conf/airframes/twinjet_overo.xml
index ef5b06badc..5ed5655242 100755
--- a/conf/airframes/twinjet_overo.xml
+++ b/conf/airframes/twinjet_overo.xml
@@ -13,7 +13,6 @@
-
@@ -22,11 +21,6 @@
-
-
-
-
-
@@ -44,6 +38,12 @@
+
+
+
+
+
+
diff --git a/conf/autopilot/booz2_test_progs.makefile b/conf/autopilot/booz2_test_progs.makefile
index aab10a795c..1d35e9ce1b 100644
--- a/conf/autopilot/booz2_test_progs.makefile
+++ b/conf/autopilot/booz2_test_progs.makefile
@@ -195,7 +195,7 @@ test_usb.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c
test_usb.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_USB_SERIAL
test_usb.CFLAGS += -DDOWNLINK_DEVICE=UsbS -DPPRZ_UART=UsbS -DDATALINK=PPRZ
test_usb.srcs += downlink.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/usb_ser_hw.c pprz_transport.c
-# datalink.c
+# $(SRC_FIRMWARE)/datalink.c
test_usb.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c
test_usb.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c
@@ -430,7 +430,7 @@ test_amc.srcs += $(SRC_ARCH)/uart_hw.c
test_amc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1
test_amc.srcs += downlink.c pprz_transport.c
test_amc.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart1
-test_amc.srcs += $(SRC_BOOZ)/booz2_datalink.c
+test_amc.srcs += $(SRC_FIRMWARE)/datalink.c
test_amc.CFLAGS += -DACTUATORS=\"actuators_asctec_twi_blmc_hw.h\"
test_amc.srcs += $(SRC_BOOZ_ARCH)/actuators_asctec_twi_blmc_hw.c actuators.c
diff --git a/conf/autopilot/csc.makefile b/conf/autopilot/csc.makefile
index ff97504153..2f83265bca 100644
--- a/conf/autopilot/csc.makefile
+++ b/conf/autopilot/csc.makefile
@@ -1,6 +1,6 @@
#
# $Id$
-#
+#
# Copyright (C) 2009 Antoine Drouin
#
# This file is part of paparazzi.
@@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# Boston, MA 02111-1307, USA.
#
#
diff --git a/conf/autopilot/csc_ap.makefile b/conf/autopilot/csc_ap.makefile
index a5c58d2871..ee88e9d2c1 100644
--- a/conf/autopilot/csc_ap.makefile
+++ b/conf/autopilot/csc_ap.makefile
@@ -1,6 +1,6 @@
#
# $Id$
-#
+#
# Copyright (C) 2009 Antoine Drouin, Allen H. Ibara
#
# This file is part of paparazzi.
@@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# Boston, MA 02111-1307, USA.
#
#
diff --git a/conf/autopilot/csc_baro.makefile b/conf/autopilot/csc_baro.makefile
index cb2444b04d..bb0065ad16 100644
--- a/conf/autopilot/csc_baro.makefile
+++ b/conf/autopilot/csc_baro.makefile
@@ -1,4 +1,4 @@
# baro scp bits
-ap.CFLAGS += -DUSE_BARO_SCP -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0
-ap.srcs += $(SRC_CSC)/csc_baro.c spi.c $(SRC_ARCH)/spi_hw.c
+ap.CFLAGS += -DUSE_BARO_SCP -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0
+ap.srcs += $(SRC_CSC)/csc_baro.c mcu_periph/spi.c $(SRC_ARCH)/mcu_periph/spi_arch.c
diff --git a/conf/autopilot/fixedwing.makefile b/conf/autopilot/fixedwing.makefile
index b22a99c9cb..0ead7d26d4 100644
--- a/conf/autopilot/fixedwing.makefile
+++ b/conf/autopilot/fixedwing.makefile
@@ -24,7 +24,13 @@ FIXEDWING_INC = -I$(SRC_FIRMWARE) -I$(SRC_FIXEDWING)
include $(CFG_FIXEDWING)/autopilot.makefile
# automatically include correct actuators for the ap target
-ifeq ($(TARGET),ap)
+ifeq ($(BOARD),classix)
+ ACTUATOR_TARGET = fbw
+else
+ ACTUATOR_TARGET = ap
+endif
+
+ifeq ($(TARGET),$(ACTUATOR_TARGET))
ifeq ($(ACTUATORS),)
ifeq ($(BOARD),tiny)
diff --git a/conf/autopilot/lisa_l_test_progs.makefile b/conf/autopilot/lisa_l_test_progs.makefile
index d7e3afa0b7..ab9527b999 100644
--- a/conf/autopilot/lisa_l_test_progs.makefile
+++ b/conf/autopilot/lisa_l_test_progs.makefile
@@ -280,7 +280,7 @@ test_adc.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=$(MODEM_PORT)
test_adc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT)
test_adc.srcs += downlink.c pprz_transport.c
-test_adc.srcs += $(SRC_ARCH)/adc_hw.c
+test_adc.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
test_adc.CFLAGS += -DUSE_AD1 -DUSE_AD1_1
# -DUSE_AD1_2 -DUSE_AD1_3 -DUSE_AD1_4
test_adc.CFLAGS += -DUSE_ADC1_2_IRQ_HANDLER
@@ -681,4 +681,4 @@ tunnel.CFLAGS += -DUSE_LED
tunnel.srcs += $(SRC_ARCH)/led_hw.c
tunnel.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=$(SYS_TIME_LED)
tunnel.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)'
-tunnel.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c
\ No newline at end of file
+tunnel.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c
diff --git a/conf/autopilot/lisa_passthrough.makefile b/conf/autopilot/lisa_passthrough.makefile
index 5798922428..2241a70455 100644
--- a/conf/autopilot/lisa_passthrough.makefile
+++ b/conf/autopilot/lisa_passthrough.makefile
@@ -103,12 +103,12 @@ stm_passthrough.CFLAGS += -DUSE_CAN1 \
-DCAN_BS1_TQ=CAN_BS1_3tq \
-DCAN_BS2_TQ=CAN_BS2_4tq \
-DCAN_ERR_RESUME=DISABLE
-stm_passthrough.srcs += can.c $(SRC_ARCH)/can_hw.c
+stm_passthrough.srcs += mcu_periph/can.c $(SRC_ARCH)/mcu_periph/can_arch.c
stm_passthrough.srcs += $(SRC_CSC)/csc_protocol.c
# ADC
-stm_passthrough.srcs += $(SRC_ARCH)/adc_hw.c
+stm_passthrough.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
stm_passthrough.CFLAGS += -DUSE_AD1 \
-DUSE_AD1_1 \
-DUSE_AD1_2 \
diff --git a/conf/autopilot/conf_motor_bench.h b/conf/autopilot/obsolete/conf_motor_bench.h
similarity index 100%
rename from conf/autopilot/conf_motor_bench.h
rename to conf/autopilot/obsolete/conf_motor_bench.h
diff --git a/conf/autopilot/data_logger_1_0.h b/conf/autopilot/obsolete/data_logger_1_0.h
similarity index 100%
rename from conf/autopilot/data_logger_1_0.h
rename to conf/autopilot/obsolete/data_logger_1_0.h
diff --git a/conf/autopilot/twin_avr.h b/conf/autopilot/obsolete/twin_avr.h
similarity index 100%
rename from conf/autopilot/twin_avr.h
rename to conf/autopilot/obsolete/twin_avr.h
diff --git a/conf/autopilot/twin_avr.makefile b/conf/autopilot/obsolete/twin_avr.makefile
similarity index 100%
rename from conf/autopilot/twin_avr.makefile
rename to conf/autopilot/obsolete/twin_avr.makefile
diff --git a/conf/autopilot/twin_mcu.makefile b/conf/autopilot/obsolete/twin_mcu.makefile
similarity index 83%
rename from conf/autopilot/twin_mcu.makefile
rename to conf/autopilot/obsolete/twin_mcu.makefile
index 3cdaca95c4..690f741285 100644
--- a/conf/autopilot/twin_mcu.makefile
+++ b/conf/autopilot/obsolete/twin_mcu.makefile
@@ -1,4 +1,4 @@
-ap.srcs += $(SRC_FIRMWARE)/main_ap.c sys_time.c $(SRC_FIRMWARE)/main.c inter_mcu.c link_mcu.c gps_ubx.c gps.c infrared.c fw_h_ctl.c fw_v_ctl.c nav.c estimator.c cam.c spi.c rc_settings.c latlong.c nav_survey_rectangle.c
+ap.srcs += $(SRC_FIRMWARE)/main_ap.c sys_time.c $(SRC_FIRMWARE)/main.c inter_mcu.c link_mcu.c gps_ubx.c gps.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c cam.c spi.c rc_settings.c latlong.c subsystems/navigation/nav_survey_rectangle.c
ap.CFLAGS += -DMCU_SPI_LINK -DUSE_GPS -DUBX -DUSE_INFRARED -DRADIO_CONTROL -DINTER_MCU -DSPI_MASTER -DUSE_SPI -DNAV -DRADIO_CONTROL_SETTINGS
fbw.srcs += sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main.c commands.c radio_control.c pprz_transport.c downlink.c inter_mcu.c spi.c link_mcu.c
diff --git a/conf/autopilot/twin_mcu_avr.makefile b/conf/autopilot/obsolete/twin_mcu_avr.makefile
similarity index 100%
rename from conf/autopilot/twin_mcu_avr.makefile
rename to conf/autopilot/obsolete/twin_mcu_avr.makefile
diff --git a/conf/autopilot/twog_booz.h b/conf/autopilot/obsolete/twog_booz.h
similarity index 100%
rename from conf/autopilot/twog_booz.h
rename to conf/autopilot/obsolete/twog_booz.h
diff --git a/conf/autopilot/v1_2.h b/conf/autopilot/obsolete/v1_2.h
similarity index 100%
rename from conf/autopilot/v1_2.h
rename to conf/autopilot/obsolete/v1_2.h
diff --git a/conf/autopilot/v1_2.makefile b/conf/autopilot/obsolete/v1_2.makefile
similarity index 100%
rename from conf/autopilot/v1_2.makefile
rename to conf/autopilot/obsolete/v1_2.makefile
diff --git a/conf/autopilot/v1_2_1.h b/conf/autopilot/obsolete/v1_2_1.h
similarity index 100%
rename from conf/autopilot/v1_2_1.h
rename to conf/autopilot/obsolete/v1_2_1.h
diff --git a/conf/autopilot/v1_2_1.makefile b/conf/autopilot/obsolete/v1_2_1.makefile
similarity index 100%
rename from conf/autopilot/v1_2_1.makefile
rename to conf/autopilot/obsolete/v1_2_1.makefile
diff --git a/conf/autopilot/rotorcraft.makefile b/conf/autopilot/rotorcraft.makefile
index d29a13b1fc..e42d413483 100644
--- a/conf/autopilot/rotorcraft.makefile
+++ b/conf/autopilot/rotorcraft.makefile
@@ -55,6 +55,8 @@ ap.ARCHDIR = $(ARCH)
ap.CFLAGS += $(ROTORCRAFT_INC)
ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -DPERIPHERALS_AUTO_INIT
ap.srcs = $(SRC_FIRMWARE)/main.c
+ap.srcs += mcu.c
+ap.srcs += $(SRC_ARCH)/mcu_arch.c
ifeq ($(ARCH), stm32)
ap.srcs += lisa/plug_sys.c
@@ -90,15 +92,15 @@ endif
#
# Telemetry/Datalink
#
-ap.srcs += $(SRC_ARCH)/uart_hw.c
+ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport
ap.CFLAGS += -DDOWNLINK_DEVICE=$(MODEM_PORT)
-ap.srcs += $(SRC_FIRMWARE)/telemetry.c \
- downlink.c \
- pprz_transport.c
+ap.srcs += $(SRC_FIRMWARE)/telemetry.c
+ap.srcs += downlink.c
+ap.srcs += pprz_transport.c
ap.CFLAGS += -DDATALINK=PPRZ
ap.CFLAGS += -DPPRZ_UART=$(MODEM_PORT)
-ap.srcs += $(SRC_BOOZ)/booz2_datalink.c
+ap.srcs += $(SRC_FIRMWARE)/datalink.c
ap.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD)
ifeq ($(ARCH), lpc21)
diff --git a/conf/autopilot/sitl.makefile b/conf/autopilot/sitl.makefile
index 59f6c3728d..22b74c9876 100644
--- a/conf/autopilot/sitl.makefile
+++ b/conf/autopilot/sitl.makefile
@@ -6,15 +6,15 @@ sim.srcs += latlong.c\
commands.c\
gps.c\
inter_mcu.c\
- infrared.c\
+ subsystems/sensors/infrared.c\
$(SRC_FIRMWARE)/stabilization/stabilization_attitude.c\
$(SRC_FIRMWARE)/guidance/guidance_v.c \
- nav.c\
+ subsystems/nav.c\
estimator.c\
sys_time.c\
$(SRC_FIRMWARE)/main_fbw.c \
$(SRC_FIRMWARE)/main_ap.c \
- datalink.c \
+ $(SRC_FIRMWARE)/datalink.c \
$(SRC_ARCH)/ppm_hw.c \
$(SRC_ARCH)/sim_gps.c\
$(SRC_ARCH)/sim_ir.c \
diff --git a/conf/autopilot/sitl_jsbsim.makefile b/conf/autopilot/sitl_jsbsim.makefile
index 392cf7e8c6..7259edccef 100644
--- a/conf/autopilot/sitl_jsbsim.makefile
+++ b/conf/autopilot/sitl_jsbsim.makefile
@@ -26,10 +26,10 @@ endif
jsbsim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO -Ifirmwares/fixedwing
jsbsim.srcs = $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/jsbsim_transport.c $(SRC_ARCH)/ivy_transport.c
-jsbsim.srcs += latlong.c downlink.c commands.c gps.c inter_mcu.c infrared.c \
+jsbsim.srcs += latlong.c downlink.c commands.c gps.c inter_mcu.c subsystems/sensors/infrared.c \
$(SRC_FIXEDWING)/stabilization/stabilization_attitude.c \
$(SRC_FIXEDWING)/guidance/guidance_v.c\
- nav.c estimator.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c datalink.c
+ subsystems/nav.c estimator.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c $(SRC_FIRMWARE)/datalink.c
jsbsim.srcs += $(SIMDIR)/sim_ac_jsbsim.c
# Choose in your airframe file type of airframe
# jsbsim.srcs += $(SIMDIR)/sim_ac_fw.c
diff --git a/conf/autopilot/sitl_link_pprz.makefile b/conf/autopilot/sitl_link_pprz.makefile
index 1d4f06b5bc..313d5ee07f 100644
--- a/conf/autopilot/sitl_link_pprz.makefile
+++ b/conf/autopilot/sitl_link_pprz.makefile
@@ -1,3 +1,3 @@
sim.ARCHDIR = $(ARCH)
sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_INFRARED -DRADIO_CONTROL_SETTINGS -DSIM_UART -DDOWNLINK_AP_DEVICE=SimUart -DDOWNLINK_FBW_DEVICE=SimUart -DDATALINK=PPRZ
-sim.srcs = radio_control.c downlink.c pprz_transport.c commands.c gps.c inter_mcu.c infrared.c $(SRC_FIRMWARE)/stabilization/stabilization_attitude.c $(SRC_FIRMWARE)/guidance/guidance_v.c nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c datalink.c
+sim.srcs = radio_control.c downlink.c pprz_transport.c commands.c gps.c inter_mcu.c subsystems/sensors/infrared.c $(SRC_FIRMWARE)/stabilization/stabilization_attitude.c $(SRC_FIRMWARE)/guidance/guidance_v.c nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c $(SRC_FIRMWARE)/datalink.c
diff --git a/conf/autopilot/sitl_link_xbee.makefile b/conf/autopilot/sitl_link_xbee.makefile
index 73fcac0657..6928643999 100644
--- a/conf/autopilot/sitl_link_xbee.makefile
+++ b/conf/autopilot/sitl_link_xbee.makefile
@@ -1,3 +1,3 @@
sim.ARCHDIR = $(ARCH)
sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=XBeeTransport -DUSE_INFRARED -DRADIO_CONTROL_SETTINGS -DSIM_UART -DSIM_XBEE -DXBEE_UART=SimUart
-sim.srcs = radio_control.c downlink.c xbee.c commands.c gps.c inter_mcu.c infrared.c $(SRC_FIXEDWING)/stabilization/stabilization_attitude.c $(SRC_FIXEDWING)/guidance/guidance_v.c nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c
+sim.srcs = radio_control.c downlink.c xbee.c commands.c gps.c inter_mcu.c subsystems/sensors/infrared.c $(SRC_FIXEDWING)/stabilization/stabilization_attitude.c $(SRC_FIXEDWING)/guidance/guidance_v.c nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c
diff --git a/conf/autopilot/subsystems/fixedwing/adc_generic.makefile b/conf/autopilot/subsystems/fixedwing/adc_generic.makefile
deleted file mode 100644
index 4ade7cbbe1..0000000000
--- a/conf/autopilot/subsystems/fixedwing/adc_generic.makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# generic ADC
-
-#
-# default values for tiny and twog are:
-# ADC_GENERIC_NB_SAMPLES = 16
-#
-# to change just redefine before including this file
-#
-# you have to set the params of the ADCs to use, eg.
-#
-#
-#
-#
-#
-# if you only set one parameter only that one will be used
-
-ifdef ADC_GENERIC1
- ap.CFLAGS += -DUSE_ADC_GENERIC -DADC_CHANNEL_GENERIC_NB_SAMPLES=$(ADC_GENERIC_NB_SAMPLES)
- ap.CFLAGS += -DADC_CHANNEL_GENERIC1=$(ADC_GENERIC1) -DUSE_$(ADC_GENERIC1)
- ifdef ADC_GENERIC2
- ap.CFLAGS += -DADC_CHANNEL_GENERIC2=$(ADC_GENERIC2) -DUSE_$(ADC_GENERIC2)
- endif
- ap.srcs += $(SRC_FIXEDWING)/adc_generic.c
-else
- ifdef ADC_GENERIC2
- ap.CFLAGS += -DUSE_ADC_GENERIC -DADC_CHANNEL_GENERIC_NB_SAMPLES=$(ADC_GENERIC_NB_SAMPLES)
- ap.CFLAGS += -DADC_CHANNEL_GENERIC2=$(ADC_GENERIC1) -DUSE_$(ADC_GENERIC2)
- ap.srcs += $(SRC_FIXEDWING)/adc_generic.c
- endif
-endif
diff --git a/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile b/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile
new file mode 100644
index 0000000000..03d340e877
--- /dev/null
+++ b/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile
@@ -0,0 +1,31 @@
+# attitude estimation for fixedwings via dcm algorithm
+
+
+$(TARGET).CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_dcm.h\"
+
+ifeq ($(ARCH), lpc21)
+
+ap.CFLAGS += -DUSE_ANALOG_IMU
+
+ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
+ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
+ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_dcm.c
+
+endif
+
+# since there is currently no SITL sim for the Analog IMU, we use the infrared sim
+
+ifeq ($(TARGET), sim)
+
+sim.CFLAGS += -DIR_ROLL_NEUTRAL_DEFAULT=0
+sim.CFLAGS += -DIR_PITCH_NEUTRAL_DEFAULT=0
+
+sim.CFLAGS += -DUSE_INFRARED
+sim.srcs += subsystems/sensors/infrared.c
+
+sim.srcs += $(SRC_ARCH)/sim_ir.c
+sim.srcs += $(SRC_ARCH)/sim_imu.c
+
+endif
+
+jsbsim.srcs += $(SRC_ARCH)/jsbsim_ir.c
diff --git a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile
index cf762bf1ff..aa4509a479 100644
--- a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile
+++ b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile
@@ -32,7 +32,7 @@ endif
ap.CFLAGS += -DADC_CHANNEL_IR_NB_SAMPLES=$(ADC_IR_NB_SAMPLES)
$(TARGET).CFLAGS += -DUSE_INFRARED
-$(TARGET).srcs += $(SRC_FIXEDWING)/infrared.c
+$(TARGET).srcs += subsystems/sensors/infrared.c
sim.srcs += $(SRC_ARCH)/sim_ir.c
jsbsim.srcs += $(SRC_ARCH)/jsbsim_ir.c
diff --git a/conf/autopilot/subsystems/fixedwing/autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile
index 7a334a7338..858b016e5a 100644
--- a/conf/autopilot/subsystems/fixedwing/autopilot.makefile
+++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile
@@ -29,7 +29,7 @@
# temporary hack for ADCs
ifeq ($(ARCH), stm32)
-$(TARGET).CFLAGS += -DSTM32
+# FIXME : this is for the battery
$(TARGET).CFLAGS += -DUSE_AD1_3
endif
#
@@ -37,8 +37,12 @@ endif
#
$(TARGET).CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
+$(TARGET).CFLAGS += -DPERIPHERALS_AUTO_INIT
$(TARGET).CFLAGS += $(FIXEDWING_INC)
+$(TARGET).srcs += mcu.c
+$(TARGET).srcs += $(SRC_ARCH)/mcu_arch.c
+
#
# Common Options
#
@@ -54,7 +58,7 @@ $(TARGET).CFLAGS += -DTRAFFIC_INFO
# LEDs
#
-$(TARGET).CFLAGS += -DLED
+$(TARGET).CFLAGS += -DUSE_LED
ifneq ($(ARCH), lpc21)
ifneq ($(ARCH), jsbsim)
$(TARGET).srcs += $(SRC_ARCH)/led_hw.c
@@ -126,18 +130,15 @@ ns_srcs += $(SRC_ARCH)/sys_time_hw.c
# UARTS
#
-ns_srcs += $(SRC_ARCH)/uart_hw.c
+ns_srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
#
# ANALOG
#
- ns_CFLAGS += -DADC
+ ns_CFLAGS += -DUSE_ADC
#ifeq ($(ARCH), lpc21)
- ns_srcs += $(SRC_ARCH)/adc_hw.c
-#else ifeq ($(ARCH), stm32)
-# ns_srcs += lisa/lisa_analog_plug.c
-#endif
+ ns_srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
ifeq ($(ARCH), stm32)
ns_CFLAGS += -DUSE_ADC1_2_IRQ_HANDLER
endif
@@ -149,6 +150,7 @@ endif
fbw_CFLAGS += -DFBW
fbw_srcs += $(SRC_FIRMWARE)/main_fbw.c
+fbw_srcs += subsystems/electrical.c
fbw_srcs += $(SRC_FIXEDWING)/commands.c
######################################################################
@@ -173,7 +175,7 @@ sim.CFLAGS += -DSITL
sim.srcs += $(SRC_ARCH)/sim_ap.c
sim.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
-sim.srcs += downlink.c datalink.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c
+sim.srcs += downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c
######################################################################
##
@@ -194,7 +196,7 @@ jsbsim.CFLAGS += -I$(SIMDIR) -I/usr/include -I$(JSBSIM_INC) `pkg-config glib-2
jsbsim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -L/usr/lib -lJSBSim
jsbsim.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
-jsbsim.srcs += downlink.c datalink.c $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/jsbsim_transport.c
+jsbsim.srcs += downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/jsbsim_transport.c
######################################################################
##
@@ -207,9 +209,9 @@ jsbsim.srcs += downlink.c datalink.c $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsi
ifeq ($(BOARD),classix)
fbw.CFLAGS += -DMCU_SPI_LINK -DUSE_SPI -DSPI_SLAVE
- fbw.srcs += $(SRC_FIXEDWING)/link_mcu.c $(SRC_FIXEDWING)/spi.c $(SRC_ARCH)/spi_hw.c
+ fbw.srcs += $(SRC_FIXEDWING)/link_mcu.c mcu_periph/spi.c $(SRC_ARCH)/mcu_periph/spi_arch.c
ap.CFLAGS += -DMCU_SPI_LINK -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0
- ap.srcs += $(SRC_FIXEDWING)/link_mcu.c $(SRC_FIXEDWING)/spi.c $(SRC_ARCH)/spi_hw.c
+ ap.srcs += $(SRC_FIXEDWING)/link_mcu.c mcu_periph/spi.c $(SRC_ARCH)/mcu_periph/spi_arch.c
else
# Single MCU's run both
ap.CFLAGS += $(fbw_CFLAGS)
diff --git a/conf/autopilot/subsystems/fixedwing/i2c.makefile b/conf/autopilot/subsystems/fixedwing/i2c.makefile
index 7a16bd4ebe..0f8769cf04 100644
--- a/conf/autopilot/subsystems/fixedwing/i2c.makefile
+++ b/conf/autopilot/subsystems/fixedwing/i2c.makefile
@@ -1,3 +1,5 @@
#generic i2c driver
-ap.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
-sim.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
+ap.srcs += mcu_periph/i2c.c
+ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
+sim.srcs += mcu_periph/i2c.c
+sim.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
diff --git a/conf/autopilot/subsystems/fixedwing/imu_analog.makefile b/conf/autopilot/subsystems/fixedwing/imu_analog.makefile
new file mode 100644
index 0000000000..499706aa75
--- /dev/null
+++ b/conf/autopilot/subsystems/fixedwing/imu_analog.makefile
@@ -0,0 +1,65 @@
+#
+# Analog IMU connected to MCU ADC ports
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+# required xml:
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+
+
+ifeq ($(ARCH), lpc21)
+
+imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_analog.h\"
+
+imu_CFLAGS += -DADC
+imu_CFLAGS += -DUSE_$(GYRO_P) -DUSE_$(GYRO_Q) -DUSE_$(GYRO_R)
+imu_CFLAGS += -DUSE_$(ACCEL_X) -DUSE_$(ACCEL_Y) -DUSE_$(ACCEL_Z)
+
+imu_CFLAGS += -DADC_CHANNEL_GYRO_P=$(GYRO_P) -DADC_CHANNEL_GYRO_Q=$(GYRO_Q) -DADC_CHANNEL_GYRO_R=$(GYRO_R)
+imu_CFLAGS += -DADC_CHANNEL_ACCEL_X=$(ACCEL_X) -DADC_CHANNEL_ACCEL_Y=$(ACCEL_Y) -DADC_CHANNEL_ACCEL_Z=$(ACCEL_Z)
+
+imu_srcs += $(SRC_SUBSYSTEMS)/imu.c
+imu_srcs += $(SRC_SUBSYSTEMS)/imu/imu_analog.c
+imu_srcs += math/pprz_trig_int.c
+
+endif
+
+# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets
+# see: conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile for example
+ap.CFLAGS += $(imu_CFLAGS)
+ap.srcs += $(imu_srcs)
diff --git a/conf/autopilot/subsystems/fixedwing/imu_booz.makefile b/conf/autopilot/subsystems/fixedwing/imu_booz.makefile
new file mode 100644
index 0000000000..5de6f0bf69
--- /dev/null
+++ b/conf/autopilot/subsystems/fixedwing/imu_booz.makefile
@@ -0,0 +1,86 @@
+#
+# Booz2 IMU booz2v1.2
+#
+#
+# required xml:
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+
+#
+# param: MAX_1168_DRDY_PORT
+
+
+
+# imu Booz2 v1.0, v1.1, v1.2, YAI v1.0
+
+imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\"
+imu_srcs += $(SRC_SUBSYSTEMS)/imu.c
+imu_srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c
+imu_srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c
+
+imu_srcs += peripherals/max1168.c
+imu_srcs += $(SRC_ARCH)/peripherals/max1168_arch.c
+
+#ifeq ($(ARCH), lpc21)
+imu_CFLAGS += -DSSP_VIC_SLOT=9
+imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8
+#FIXME ms2001 not used on this imu
+#else ifeq ($(ARCH), stm32)
+#imu_CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ
+#imu_CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT)
+#imu_CFLAGS += -DMAX_1168_DRDY_PORT_SOURCE=$(MAX_1168_DRDY_PORT_SOURCE)
+#imu_CFLAGS += -DUSE_I2C2 -DUSE_EXTI9_5_IRQ
+#endif
+
+ap.srcs += $(imu_srcs)
+ap.CFLAGS += $(imu_CFLAGS)
+
+imu_srcs += math/pprz_trig_int.c
+
+#
+# Simulator
+#
+
+sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\"
+#FIXME, should be HMC5843
+sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601
+#FIXME, should be verision 1.2
+sim.CFLAGS += -DIMU_B2_VERSION_1_1
+sim.srcs += $(SRC_SUBSYSTEMS)/imu.c
+sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c
+sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c
+
+sim.srcs += peripherals/max1168.c
+sim.srcs += $(SRC_ARCH)/peripherals/max1168_arch.c
+
+sim.CFLAGS += -DUSE_AMI601
+sim.srcs += peripherals/ami601.c
+sim.CFLAGS += -DUSE_I2C1
diff --git a/conf/autopilot/subsystems/fixedwing/navigation.makefile b/conf/autopilot/subsystems/fixedwing/navigation.makefile
index 195cfe2a5b..b1eb8b1dad 100644
--- a/conf/autopilot/subsystems/fixedwing/navigation.makefile
+++ b/conf/autopilot/subsystems/fixedwing/navigation.makefile
@@ -4,8 +4,8 @@
#add these to all targets
$(TARGET).CFLAGS += -DNAV
-$(TARGET).srcs += $(SRC_FIXEDWING)/nav.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/traffic_info.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/nav_survey_rectangle.c $(SRC_FIXEDWING)/nav_line.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/nav.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/traffic_info.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/nav_survey_rectangle.c $(SRC_SUBSYSTEMS)/navigation/nav_line.c
diff --git a/conf/autopilot/subsystems/fixedwing/navigation_bomb.makefile b/conf/autopilot/subsystems/fixedwing/navigation_bomb.makefile
index 758ef836d0..de839f98a0 100644
--- a/conf/autopilot/subsystems/fixedwing/navigation_bomb.makefile
+++ b/conf/autopilot/subsystems/fixedwing/navigation_bomb.makefile
@@ -3,5 +3,5 @@
#add these to all targets
-$(TARGET).srcs += $(SRC_FIXEDWING)/bomb.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/bomb.c
diff --git a/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile b/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile
index 613a308a7c..91be2eba88 100644
--- a/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile
+++ b/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile
@@ -4,12 +4,12 @@
#add these to all targets
$(TARGET).CFLAGS += -DNAV
-$(TARGET).srcs += $(SRC_FIXEDWING)/nav.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/traffic_info.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/nav_survey_rectangle.c $(SRC_FIXEDWING)/nav_line.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/nav.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/traffic_info.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/nav_survey_rectangle.c $(SRC_SUBSYSTEMS)/navigation/nav_line.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/nav_cube.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/discsurvey.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/OSAMNav.c
-$(TARGET).srcs += $(SRC_FIXEDWING)/snav.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/nav_cube.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/discsurvey.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/OSAMNav.c
+$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/snav.c
diff --git a/conf/autopilot/subsystems/fixedwing/spi.makefile b/conf/autopilot/subsystems/fixedwing/spi.makefile
index 42106f69f5..d6ff15a24a 100644
--- a/conf/autopilot/subsystems/fixedwing/spi.makefile
+++ b/conf/autopilot/subsystems/fixedwing/spi.makefile
@@ -1,5 +1,5 @@
#generic spi driver
$(TARGET).CFLAGS += -DUSE_SPI
-ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c
-sim.srcs += spi.c $(SRC_ARCH)/spi_hw.c
+ap.srcs += mcu_periph/spi.c $(SRC_ARCH)/mcu_periph/spi_arch.c
+sim.srcs += mcu_periph/spi.c $(SRC_ARCH)/mcu_periph/spi_arch.c
diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile
index 6ad33ef3c8..8cbcfa9189 100644
--- a/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile
+++ b/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile
@@ -7,6 +7,6 @@ MODEM_UART = Uart$(MODEM_UART_NR)
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=$(MODEM_UART) -DDOWNLINK_AP_DEVICE=$(MODEM_UART) -DPPRZ_UART=$(MODEM_UART)
ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ
-ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c
+ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c
diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile
index eb77b500bd..fdc2d31baf 100644
--- a/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile
+++ b/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile
@@ -3,7 +3,7 @@
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=UsbS -DDOWNLINK_AP_DEVICE=UsbS -DPPRZ_UART=UsbS
ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ -DUSE_USB_SERIAL -DUSE_USB_HIGH_PCLK
-ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c
+ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c
ap.srcs += $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c
ap.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c
diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile
index 1263c24044..3fdff1608d 100644
--- a/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile
+++ b/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile
@@ -7,4 +7,4 @@ MODEM_UART = Uart$(MODEM_UART_NR)
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=$(MODEM_UART) -DDOWNLINK_AP_DEVICE=$(MODEM_UART) -DXBEE_UART=$(MODEM_UART)
ap.CFLAGS += -DDOWNLINK_TRANSPORT=XBeeTransport -DDATALINK=XBEE
-ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/xbee.c
+ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_FIXEDWING)/xbee.c
diff --git a/conf/autopilot/subsystems/fixedwing/testing.makefile b/conf/autopilot/subsystems/fixedwing/testing.makefile
index 909daa7715..f1b539ccfc 100644
--- a/conf/autopilot/subsystems/fixedwing/testing.makefile
+++ b/conf/autopilot/subsystems/fixedwing/testing.makefile
@@ -17,11 +17,11 @@ tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c
# A test program to monitor the ADC values
test_adcs.ARCHDIR = $(ARCH)
-test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7
+test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DUSE_ADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7
test_adcs.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600
test_adcs.srcs += downlink.c $(SRC_ARCH)/uart_hw.c xbee.c
-test_adcs.srcs += sys_time.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test/test_adcs.c
+test_adcs.srcs += sys_time.c $(SRC_ARCH)/mcu_periph/adc_arch.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test/test_adcs.c
# pprz_transport.c
diff --git a/conf/autopilot/subsystems/lisa_spi_link.makefile b/conf/autopilot/subsystems/lisa_spi_link.makefile
index 36e2ea2570..14e9905f9a 100644
--- a/conf/autopilot/subsystems/lisa_spi_link.makefile
+++ b/conf/autopilot/subsystems/lisa_spi_link.makefile
@@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with Paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# Boston, MA 02111-1307, USA.
ap.CFLAGS += -DUSE_SPI_LINK -DOVERO_LINK_MSG_UP=AutopilotMessagePTUp -DOVERO_LINK_MSG_DOWN=AutopilotMessagePTDown
ap.srcs += $(SRC_FMS)/fms_spi_autopilot_msg.c
diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile
index 9e092b0c83..a3c61afbef 100644
--- a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile
@@ -1,6 +1,7 @@
# asctec controllers
ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c
-ap.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
+ap.srcs += mcu_periph/i2c.c
+ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
ifeq ($(ARCH), lpc21)
ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c0
@@ -16,5 +17,6 @@ endif
# Simulator
sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c
sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=10
-sim.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
+sim.srcs += mcu_periph/i2c.c
+sim.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile
index e59570a96c..c1cfc48f37 100644
--- a/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile
@@ -19,7 +19,8 @@
ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
ap.CFLAGS += -DACTUATORS_ASCTEC_V2_PROTOCOL
ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c
-ap.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
+ap.srcs += mcu_periph/i2c.c
+ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
ifeq ($(ARCH), lpc21)
ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c0
diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile
index c64e676752..95e3591951 100644
--- a/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile
@@ -7,4 +7,4 @@ ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_heli.c
ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c
# fixme : this is needed by baro and usualy added by actuators_mkk or actuators_asctec
-ap.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
+ap.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c
diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile
index 031567385e..f70c299815 100644
--- a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile
@@ -28,7 +28,8 @@
#
ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c
-ap.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
+ap.srcs += mcu_periph/i2c.c
+ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
ifeq ($(ARCH), lpc21)
ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c0
@@ -42,4 +43,5 @@ endif
sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c
sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c1
-sim.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
+sim.srcs += mcu_periph/i2c.c
+sim.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
diff --git a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile
index 40f08f0fe6..8a0b64bafe 100644
--- a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile
@@ -81,7 +81,7 @@ sim.srcs += $(SRC_FIRMWARE)/telemetry.c \
sim.srcs += $(SRC_BOOZ)/booz2_commands.c
-sim.srcs += $(SRC_BOOZ)/booz2_datalink.c
+sim.srcs += $(SRC_FIRMWARE)/datalink.c
#
#
diff --git a/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile b/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile
index 5f288cdc7f..ae53bd7a26 100644
--- a/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile
+++ b/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile
@@ -7,7 +7,7 @@ endif
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_BIND_IMPL_FUNC=radio_control_spektrum_try_bind
ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"subsystems/radio_control/spektrum.h\"
-ifeq ($(BOARD), booz)
+ifeq ($(ARCH), lpc21)
ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_MODEL_H=$(RADIO_CONTROL_SPEKTRUM_MODEL)
endif
ifdef RADIO_CONTROL_LED
diff --git a/conf/boards/booz_1.0.makefile b/conf/boards/booz_1.0.makefile
index 7e9184cf5c..1f56efef5b 100644
--- a/conf/boards/booz_1.0.makefile
+++ b/conf/boards/booz_1.0.makefile
@@ -25,11 +25,19 @@ RADIO_CONTROL_LINK = UART0
BARO_LED = 2
+ifndef MODEM_PORT
MODEM_PORT = UART1
+endif
+ifndef MODEM_BAUD
MODEM_BAUD = B57600
+endif
AHRS_ALIGNER_LED = 3
+ifndef GPS_PORT
GPS_PORT=UART0
+endif
+ifndef GPS_BAUD
GPS_BAUD=B38400
+endif
GPS_LED=4
diff --git a/conf/boards/classix.makefile b/conf/boards/classix.makefile
index 88f2af0807..90ae9df340 100644
--- a/conf/boards/classix.makefile
+++ b/conf/boards/classix.makefile
@@ -10,10 +10,7 @@ ARCH=lpc21
BOARD=classix
BOARD_VERSION=1.0
-#BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
-
-# TODO: update syntax
-BOARD_CFG = \"classix.h\"
+BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
ifndef FLASH_MODE
FLASH_MODE = IAP
diff --git a/conf/boards/hb_1.1.makefile b/conf/boards/hb_1.1.makefile
index 16c134efc5..8cb1393b3a 100644
--- a/conf/boards/hb_1.1.makefile
+++ b/conf/boards/hb_1.1.makefile
@@ -22,8 +22,16 @@ SYS_TIME_LED = 1 # not used on rotorcraft, only for tests
RADIO_CONTROL_LINK = UART0
+ifndef MODEM_PORT
MODEM_PORT = UART0
+endif
+ifndef MODEM_BAUD
MODEM_BAUD = B57600
+endif
+ifndef GPS_PORT
GPS_PORT=UART1
+endif
+ifndef GPS_BAUD
GPS_BAUD=B38400
+endif
diff --git a/conf/boards/lisa_l_1.0.makefile b/conf/boards/lisa_l_1.0.makefile
index d98f433b5e..35717910a1 100644
--- a/conf/boards/lisa_l_1.0.makefile
+++ b/conf/boards/lisa_l_1.0.makefile
@@ -41,13 +41,21 @@ RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3
RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5
RADIO_CONTROL_LED = 5
+ifndef MODEM_PORT
MODEM_PORT=UART2
+endif
+ifndef MODEM_BAUD
MODEM_BAUD=B57600
+endif
AHRS_ALIGNER_LED = 7
+ifndef GPS_PORT
GPS_PORT=UART1
+endif
+ifndef GPS_BAUD
GPS_BAUD=B38400
+endif
GPS_LED = 3
#
@@ -57,7 +65,7 @@ GPS_LED = 3
#
MAX_1168_DRDY_PORT = _GPIOD
MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOD
-# v1.1
+# v1.1
#MAX_1168_DRDY_PORT = GPIOB
@@ -78,8 +86,8 @@ ADC_IR2 = 2
ADC_IR2_CHAN = 1
endif
ifndef ADC_IR3
-ADC_IR_TOP = 3
-ADC_IR_TOP_CHAN = 2
+ADC_IR_TOP = 4
+ADC_IR_TOP_CHAN = 3
endif
ifndef ADC_IR_NB_SAMPLES
ADC_IR_NB_SAMPLES = 16
diff --git a/conf/boards/lisa_l_1.1.makefile b/conf/boards/lisa_l_1.1.makefile
index 0cfb319aa1..0c0cc40249 100644
--- a/conf/boards/lisa_l_1.1.makefile
+++ b/conf/boards/lisa_l_1.1.makefile
@@ -3,7 +3,7 @@ include $(PAPARAZZI_SRC)/conf/boards/lisa_l_1.0.makefile
#
# this is the DRDY pin of a max1168 on a booz IMU
#
-# v1.1
+# v1.1
#
MAX_1168_DRDY_PORT = _GPIOB
MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOB
\ No newline at end of file
diff --git a/conf/boards/lisa_m_1.0.makefile b/conf/boards/lisa_m_1.0.makefile
index c5e003081c..89a1814674 100644
--- a/conf/boards/lisa_m_1.0.makefile
+++ b/conf/boards/lisa_m_1.0.makefile
@@ -12,6 +12,8 @@ ARCH=stm32
$(TARGET).ARCHDIR = $(ARCH)
# not needed?
$(TARGET).OOCD_INTERFACE=flossjtag
+#$(TARGET).OOCD_INTERFACE=jtagkey-tiny
+
# -----------------------------------------------------------------------
ifndef FLASH_MODE
@@ -51,7 +53,7 @@ GPS_LED = none
#
MAX_1168_DRDY_PORT = _GPIOD
MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOD
-# v1.1
+# v1.1
#MAX_1168_DRDY_PORT = GPIOB
@@ -64,13 +66,16 @@ MODEM_UART_NR = 2
endif
ifndef ADC_IR1
-ADC_IR1 = 1
+ADC_IR1 = 1
+ADC_IR1_CHAN = 0
endif
ifndef ADC_IR2
-ADC_IR2 = 2
+ADC_IR2 = 2
+ADC_IR2_CHAN = 1
endif
ifndef ADC_IR3
-ADC_IR_TOP = 3
+ADC_IR_TOP = 4
+ADC_IR_TOP_CHAN = 3
endif
ifndef ADC_IR_NB_SAMPLES
ADC_IR_NB_SAMPLES = 16
diff --git a/conf/conf.xml.example b/conf/conf.xml.example
index 682645c290..5ba76d762e 100644
--- a/conf/conf.xml.example
+++ b/conf/conf.xml.example
@@ -80,6 +80,16 @@
settings="settings/basic.xml"
gui_color="#6293ba"
/>
+
#include "datalink.h"
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
diff --git a/conf/flight_plans/IS.xml b/conf/flight_plans/IS.xml
index 904be80ec4..9c264b7f37 100644
--- a/conf/flight_plans/IS.xml
+++ b/conf/flight_plans/IS.xml
@@ -5,9 +5,9 @@
#include "chemo_detect.h"
#include "anemotaxis.h"
#include "chemotaxis.h"
-#include "discsurvey.h"
-#include "nav_line.h"
-#include "bomb.h"
+#include "subsystems/navigation/discsurvey.h"
+#include "subsystems/navigation/nav_line.h"
+#include "subsystems/navigation/bomb.h"
#include "datalink.h"
diff --git a/conf/flight_plans/basic.xml b/conf/flight_plans/basic.xml
index 3f421d8d14..57f3531d50 100644
--- a/conf/flight_plans/basic.xml
+++ b/conf/flight_plans/basic.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/creidlitz.xml b/conf/flight_plans/creidlitz.xml
index 99e68782a8..e8f52af09b 100644
--- a/conf/flight_plans/creidlitz.xml
+++ b/conf/flight_plans/creidlitz.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/cube.xml b/conf/flight_plans/cube.xml
index 8463dc7466..93754e3b33 100644
--- a/conf/flight_plans/cube.xml
+++ b/conf/flight_plans/cube.xml
@@ -3,7 +3,7 @@
-#include "nav_cube.h"
+#include "subsystems/navigation/nav_cube.h"
diff --git a/conf/flight_plans/grosslobke_demo.xml b/conf/flight_plans/grosslobke_demo.xml
index c9127bf202..03e7dee1a1 100755
--- a/conf/flight_plans/grosslobke_demo.xml
+++ b/conf/flight_plans/grosslobke_demo.xml
@@ -2,8 +2,8 @@
-#include "bomb.h"
-#include "nav_line.h"
+#include "subsystems/navigation/bomb.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/hsif.xml b/conf/flight_plans/hsif.xml
index f0c3cb2155..01f2d7cae2 100644
--- a/conf/flight_plans/hsif.xml
+++ b/conf/flight_plans/hsif.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/ingolfsskali.xml b/conf/flight_plans/ingolfsskali.xml
index 99a0be55c5..228ba75842 100644
--- a/conf/flight_plans/ingolfsskali.xml
+++ b/conf/flight_plans/ingolfsskali.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/joystick.xml b/conf/flight_plans/joystick.xml
index cfecc250b5..55b6b6e0cd 100644
--- a/conf/flight_plans/joystick.xml
+++ b/conf/flight_plans/joystick.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
#include "joystick.h"
diff --git a/conf/flight_plans/kv_svalbard.xml b/conf/flight_plans/kv_svalbard.xml
index 3598897513..33bb101d5f 100644
--- a/conf/flight_plans/kv_svalbard.xml
+++ b/conf/flight_plans/kv_svalbard.xml
@@ -3,7 +3,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/mav06.xml b/conf/flight_plans/mav06.xml
index 7f3d584ee0..864c6ccd0e 100644
--- a/conf/flight_plans/mav06.xml
+++ b/conf/flight_plans/mav06.xml
@@ -1,7 +1,7 @@
-#include "bomb.h"
-#include "nav_line.h"
+#include "subsystems/navigation/bomb.h"
+#include "subsystems/navigation/nav_line.h"
diff --git a/conf/flight_plans/mav07.xml b/conf/flight_plans/mav07.xml
index e3e106e7e5..fb2a87092a 100644
--- a/conf/flight_plans/mav07.xml
+++ b/conf/flight_plans/mav07.xml
@@ -2,7 +2,7 @@
-#include "bomb.h"
+#include "subsystems/navigation/bomb.h"
#include "datalink.h"
diff --git a/conf/flight_plans/mav08.xml b/conf/flight_plans/mav08.xml
index c3baa595e5..d418ee1cf7 100644
--- a/conf/flight_plans/mav08.xml
+++ b/conf/flight_plans/mav08.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/nordlys.xml b/conf/flight_plans/nordlys.xml
index 668437f32b..61fa5a0fa6 100644
--- a/conf/flight_plans/nordlys.xml
+++ b/conf/flight_plans/nordlys.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/slayer_training.xml b/conf/flight_plans/slayer_training.xml
index 4f21098ea0..16773c0183 100644
--- a/conf/flight_plans/slayer_training.xml
+++ b/conf/flight_plans/slayer_training.xml
@@ -2,7 +2,7 @@
-#include "bomb.h"
+#include "subsystems/navigation/bomb.h"
diff --git a/conf/flight_plans/snav.xml b/conf/flight_plans/snav.xml
index bce76f02b7..866073c27e 100644
--- a/conf/flight_plans/snav.xml
+++ b/conf/flight_plans/snav.xml
@@ -2,9 +2,9 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
-#include "snav.h"
+#include "subsystems/navigation/snav.h"
diff --git a/conf/flight_plans/standard.xml b/conf/flight_plans/standard.xml
index 0420399df8..906defbb70 100644
--- a/conf/flight_plans/standard.xml
+++ b/conf/flight_plans/standard.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/flight_plans/tcas.xml b/conf/flight_plans/tcas.xml
index 1f84ef2027..c0b327457c 100644
--- a/conf/flight_plans/tcas.xml
+++ b/conf/flight_plans/tcas.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
#include "tcas.h"
diff --git a/conf/flight_plans/xsens_cachejunction.xml b/conf/flight_plans/xsens_cachejunction.xml
index cdc7188150..84aa6cf7bf 100644
--- a/conf/flight_plans/xsens_cachejunction.xml
+++ b/conf/flight_plans/xsens_cachejunction.xml
@@ -2,7 +2,7 @@
-#include "nav_line.h"
+#include "subsystems/navigation/nav_line.h"
#include "datalink.h"
diff --git a/conf/messages.xml b/conf/messages.xml
index ed2ade3e62..2029c96743 100644
--- a/conf/messages.xml
+++ b/conf/messages.xml
@@ -720,7 +720,7 @@
-
+
diff --git a/conf/modules/baro_scp.xml b/conf/modules/baro_scp.xml
index f76579e90f..8bb3c9d8b2 100644
--- a/conf/modules/baro_scp.xml
+++ b/conf/modules/baro_scp.xml
@@ -14,6 +14,8 @@
+
+
diff --git a/conf/modules/poles.xml b/conf/modules/poles.xml
index 042c3dacbc..ed760a56e3 100644
--- a/conf/modules/poles.xml
+++ b/conf/modules/poles.xml
@@ -2,7 +2,7 @@
diff --git a/conf/settings/basic.xml b/conf/settings/basic.xml
index 997ed9ca38..35991b8d98 100644
--- a/conf/settings/basic.xml
+++ b/conf/settings/basic.xml
@@ -7,9 +7,9 @@
-
+
-
+
@@ -29,8 +29,8 @@
-
-
+
+
diff --git a/conf/settings/fw_ctl_n.xml b/conf/settings/fw_ctl_n.xml
index 1959e7b649..eb3a8ac9e7 100644
--- a/conf/settings/fw_ctl_n.xml
+++ b/conf/settings/fw_ctl_n.xml
@@ -50,7 +50,7 @@
-
+
diff --git a/conf/settings/lisa.xml b/conf/settings/lisa.xml
index 1f1d802734..9facc3d61b 100644
--- a/conf/settings/lisa.xml
+++ b/conf/settings/lisa.xml
@@ -7,9 +7,9 @@
-
+
-
+
diff --git a/conf/settings/tuning.xml b/conf/settings/tuning.xml
index 70f9ed3ff0..4f83d2daaa 100644
--- a/conf/settings/tuning.xml
+++ b/conf/settings/tuning.xml
@@ -21,7 +21,7 @@
-
+
@@ -31,17 +31,17 @@
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
@@ -99,7 +99,7 @@
-
+
diff --git a/conf/settings/tuningJH.xml b/conf/settings/tuningJH.xml
index 6282e488d4..f7ccad596f 100644
--- a/conf/settings/tuningJH.xml
+++ b/conf/settings/tuningJH.xml
@@ -22,22 +22,20 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
@@ -83,7 +81,7 @@
-
+
diff --git a/conf/settings/tuning_ctl_new.xml b/conf/settings/tuning_ctl_new.xml
index 59fc7b5257..06caf025ac 100644
--- a/conf/settings/tuning_ctl_new.xml
+++ b/conf/settings/tuning_ctl_new.xml
@@ -21,7 +21,7 @@
-
+
@@ -30,18 +30,18 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
@@ -115,7 +115,7 @@
-
+
diff --git a/conf/settings/tuning_ins.xml b/conf/settings/tuning_ins.xml
index a778e360f0..fb7ac75c5d 100644
--- a/conf/settings/tuning_ins.xml
+++ b/conf/settings/tuning_ins.xml
@@ -21,7 +21,7 @@
-
+
@@ -30,8 +30,9 @@
+
-
+
@@ -65,8 +66,9 @@
-
-
+
+
+
@@ -79,8 +81,8 @@
-
-
+
+
@@ -88,7 +90,7 @@
-
+
diff --git a/conf/settings/tuning_loiter.xml b/conf/settings/tuning_loiter.xml
index 0122b8b518..b2cd6984f4 100644
--- a/conf/settings/tuning_loiter.xml
+++ b/conf/settings/tuning_loiter.xml
@@ -21,7 +21,7 @@
-
+
@@ -30,19 +30,18 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -99,7 +98,7 @@
-
+
diff --git a/conf/settings/tuning_rc.xml b/conf/settings/tuning_rc.xml
index 6b0adedd2f..e2147cefd2 100644
--- a/conf/settings/tuning_rc.xml
+++ b/conf/settings/tuning_rc.xml
@@ -6,8 +6,8 @@
-
-
+
+
diff --git a/conf/settings/tuning_tp_auto.xml b/conf/settings/tuning_tp_auto.xml
index 247b28b69f..ba8e605fe3 100644
--- a/conf/settings/tuning_tp_auto.xml
+++ b/conf/settings/tuning_tp_auto.xml
@@ -23,8 +23,8 @@
-
-
+
+
@@ -71,7 +71,7 @@
-
+
diff --git a/conf/settings/ugv.xml b/conf/settings/ugv.xml
index febc7b230d..71eba1ade6 100644
--- a/conf/settings/ugv.xml
+++ b/conf/settings/ugv.xml
@@ -6,7 +6,7 @@
-
+
diff --git a/conf/telemetry/default_fixedwing_imu.xml b/conf/telemetry/default_fixedwing_imu.xml
new file mode 100644
index 0000000000..fcf88d9dfb
--- /dev/null
+++ b/conf/telemetry/default_fixedwing_imu.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/ubx.xml b/conf/ubx.xml
index 6c4dfe9243..eaa6053c5b 100644
--- a/conf/ubx.xml
+++ b/conf/ubx.xml
@@ -205,24 +205,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sw/airborne/6dof.h b/sw/airborne/6dof.h
deleted file mode 100644
index 029585afc0..0000000000
--- a/sw/airborne/6dof.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _6DOF_H
-#define _6DOF_H
-
-#define AXIS_X 0
-#define AXIS_Y 1
-#define AXIS_Z 2
-#define AXIS_NB 3
-
-#define AXIS_P 0
-#define AXIS_Q 1
-#define AXIS_R 2
-
-#define AXIS_U 0
-#define AXIS_V 1
-#define AXIS_W 2
-
-#define EULER_PHI 0
-#define EULER_THETA 1
-#define EULER_PSI 2
-#define EULER_NB 3
-
-#define QUAT_QI 0
-#define QUAT_QX 1
-#define QUAT_QY 2
-#define QUAT_QZ 3
-#define QUAT_NB 4
-
-
-
-
-#endif /* _6DOF_H */
diff --git a/sw/airborne/agl_vfilter.h b/sw/airborne/agl_vfilter.h
index 91ce89532f..f7fd036e86 100644
--- a/sw/airborne/agl_vfilter.h
+++ b/sw/airborne/agl_vfilter.h
@@ -1,7 +1,7 @@
#ifndef AGL_VFILTER_H
#define AGL_VFILTER_H
-#include "adc.h"
+#include "mcu_periph/adc.h"
#define STATE_SIZE 3
diff --git a/sw/airborne/anemotaxis.c b/sw/airborne/anemotaxis.c
index 3bfc75b610..562b02b7e1 100644
--- a/sw/airborne/anemotaxis.c
+++ b/sw/airborne/anemotaxis.c
@@ -2,7 +2,7 @@
#include "generated/airframe.h"
#include "estimator.h"
#include "std.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "generated/flight_plan.h"
#include "ap_downlink.h"
#include "chemo_detect.h"
diff --git a/sw/airborne/ap_downlink.h b/sw/airborne/ap_downlink.h
index da90c9f3c6..a45945cf33 100644
--- a/sw/airborne/ap_downlink.h
+++ b/sw/airborne/ap_downlink.h
@@ -116,7 +116,7 @@
#endif
#if defined USE_INFRARED || USE_INFRARED_I2C
-#define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &ir_ir1, &ir_ir2, &ir_pitch, &ir_roll, &ir_top);
+#define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &infrared.ir1, &infrared.ir2, &infrared.pitch, &infrared.roll, &infrared.top);
#else
#define PERIODIC_SEND_IR_SENSORS(_chan) ;
#endif
@@ -138,6 +138,19 @@
#define PERIODIC_SEND_SEGMENT(_chan) if (nav_in_segment) { DOWNLINK_SEND_SEGMENT(_chan, &nav_segment_x_1, &nav_segment_y_1, &nav_segment_x_2, &nav_segment_y_2); }
+#ifdef IMU_TYPE_H
+#include "subsystems/imu.h"
+#define PERIODIC_SEND_IMU_ACCEL_RAW(_chan) { DOWNLINK_SEND_IMU_ACCEL_RAW(_chan, &imu.accel_unscaled.x, &imu.accel_unscaled.y, &imu.accel_unscaled.z)}
+#define PERIODIC_SEND_IMU_GYRO_RAW(_chan) { DOWNLINK_SEND_IMU_GYRO_RAW(_chan, &imu.gyro_unscaled.p, &imu.gyro_unscaled.q, &imu.gyro_unscaled.r)}
+#define PERIODIC_SEND_IMU_ACCEL(_chan) { DOWNLINK_SEND_IMU_ACCEL_RAW(_chan, &imu.accel.x, &imu.accel.y, &imu.accel.z)}
+#define PERIODIC_SEND_IMU_GYRO(_chan) { DOWNLINK_SEND_IMU_GYRO_RAW(_chan, &imu.gyro.p, &imu.gyro.q, &imu.gyro.r)}
+#else
+#define PERIODIC_SEND_IMU_ACCEL_RAW(_chan) {}
+#define PERIODIC_SEND_IMU_GYRO_RAW(_chan) {}
+#define PERIODIC_SEND_IMU_ACCEL(_chan) {}
+#define PERIODIC_SEND_IMU_GYRO(_chan) {}
+#endif
+
#ifdef IMU_ANALOG
#define PERIODIC_SEND_IMU(_chan) { int16_t dummy = 42; DOWNLINK_SEND_IMU(_chan, &(from_fbw.euler_dot[0]), &(from_fbw.euler_dot[1]), &(from_fbw.euler_dot[2]), &dummy, &dummy, &dummy); }
#else
diff --git a/sw/airborne/arch/avr/ant_tracker.c b/sw/airborne/arch/avr/ant_tracker.c
index 5d62efd219..68b172bead 100644
--- a/sw/airborne/arch/avr/ant_tracker.c
+++ b/sw/airborne/arch/avr/ant_tracker.c
@@ -1,6 +1,6 @@
#include "ant_tracker.h"
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
uint8_t ant_track_mode;
float ant_track_azim;
diff --git a/sw/airborne/arch/avr/adc_hw.c b/sw/airborne/arch/avr/mcu_periph/adc_arch.c
similarity index 99%
rename from sw/airborne/arch/avr/adc_hw.c
rename to sw/airborne/arch/avr/mcu_periph/adc_arch.c
index ae37327e7f..6799d7317f 100644
--- a/sw/airborne/arch/avr/adc_hw.c
+++ b/sw/airborne/arch/avr/mcu_periph/adc_arch.c
@@ -31,7 +31,7 @@
#endif
#include
#include
-#include "adc.h"
+#include "mcu_periph/adc.h"
#include "std.h"
diff --git a/sw/airborne/arch/avr/adc_hw.h b/sw/airborne/arch/avr/mcu_periph/adc_arch.h
similarity index 100%
rename from sw/airborne/arch/avr/adc_hw.h
rename to sw/airborne/arch/avr/mcu_periph/adc_arch.h
diff --git a/sw/airborne/arch/avr/i2c_ap.c b/sw/airborne/arch/avr/mcu_periph/i2c_arch.c
similarity index 100%
rename from sw/airborne/arch/avr/i2c_ap.c
rename to sw/airborne/arch/avr/mcu_periph/i2c_arch.c
diff --git a/sw/airborne/arch/avr/i2c_ap.h b/sw/airborne/arch/avr/mcu_periph/i2c_arch.h
similarity index 100%
rename from sw/airborne/arch/avr/i2c_ap.h
rename to sw/airborne/arch/avr/mcu_periph/i2c_arch.h
diff --git a/sw/airborne/arch/avr/spi_hw.c b/sw/airborne/arch/avr/mcu_periph/spi_arch.c
similarity index 98%
rename from sw/airborne/arch/avr/spi_hw.c
rename to sw/airborne/arch/avr/mcu_periph/spi_arch.c
index eb30bcc7af..e2dc0bda80 100644
--- a/sw/airborne/arch/avr/spi_hw.c
+++ b/sw/airborne/arch/avr/mcu_periph/spi_arch.c
@@ -22,12 +22,12 @@
*
*/
-/** \file spi_hw.c
+/** \file mcu_periph/spi_arch.c
* \brief handling of hardware dependant SPI on AVR architecture
*/
#include CONFIG
-#include "spi.h"
+#include "mcu_periph/spi.h"
#include
#include
diff --git a/sw/airborne/arch/avr/spi_hw.h b/sw/airborne/arch/avr/mcu_periph/spi_arch.h
similarity index 97%
rename from sw/airborne/arch/avr/spi_hw.h
rename to sw/airborne/arch/avr/mcu_periph/spi_arch.h
index 384009ff61..e76d1f9429 100644
--- a/sw/airborne/arch/avr/spi_hw.h
+++ b/sw/airborne/arch/avr/mcu_periph/spi_arch.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef SPI_HW_H
-#define SPI_HW_H
+#ifndef SPI_ARCH_H
+#define SPI_ARCH_H
/** Index in SPI buffers: one is enough for full duplex communication */
extern volatile uint8_t spi_idx_buf;
@@ -83,4 +83,4 @@ extern volatile uint8_t spi_idx_buf;
#endif /* SPI_MASTER */
-#endif /* SPI_HW_H */
+#endif /* SPI_ARCH_H */
diff --git a/sw/airborne/arch/avr/uart_hw.c b/sw/airborne/arch/avr/mcu_periph/uart_arch.c
similarity index 99%
rename from sw/airborne/arch/avr/uart_hw.c
rename to sw/airborne/arch/avr/mcu_periph/uart_arch.c
index b1c8aac337..29ec68e656 100644
--- a/sw/airborne/arch/avr/uart_hw.c
+++ b/sw/airborne/arch/avr/mcu_periph/uart_arch.c
@@ -26,7 +26,7 @@
* \brief avr uart low level functions
*
*/
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "sys_time.h"
#define B2400 2400UL
diff --git a/sw/airborne/arch/avr/uart_hw.h b/sw/airborne/arch/avr/mcu_periph/uart_arch.h
similarity index 100%
rename from sw/airborne/arch/avr/uart_hw.h
rename to sw/airborne/arch/avr/mcu_periph/uart_arch.h
diff --git a/sw/airborne/arch/lpc21/ADS8344.c b/sw/airborne/arch/lpc21/ADS8344.c
index dd72abcac8..49ce4dd027 100644
--- a/sw/airborne/arch/lpc21/ADS8344.c
+++ b/sw/airborne/arch/lpc21/ADS8344.c
@@ -27,7 +27,7 @@
#include "armVIC.h"
#include BOARD_CONFIG
#include "led.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi.h"
#define ADS8344_SS_IODIR IO0DIR
#define ADS8344_SS_IOSET IO0SET
diff --git a/sw/airborne/arch/lpc21/init_hw.h b/sw/airborne/arch/lpc21/mcu_arch.c
similarity index 51%
rename from sw/airborne/arch/lpc21/init_hw.h
rename to sw/airborne/arch/lpc21/mcu_arch.c
index 470f38e6e5..ab66aaa72f 100644
--- a/sw/airborne/arch/lpc21/init_hw.h
+++ b/sw/airborne/arch/lpc21/mcu_arch.c
@@ -1,64 +1,40 @@
/*
- * Paparazzi $Id$
+ * Paparazzi lpc21 arch dependant microcontroller initialisation function
*
- * Copyright (C) 2005 Pascal Brisset, Antoine Drouin
+ * Copyright (C) 2010 The Paparazzi team
*
- * This file is part of paparazzi.
+ * This file is part of Paparazzi.
*
- * paparazzi is free software; you can redistribute it and/or modify
+ * Paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
- * paparazzi is distributed in the hope that it will be useful,
+ * Paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING. If not, write to
+ * along with Paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
-/*
- *\brief ARM7 low level hardware initialisation
- * PLL, MAM, VIC
- *
- */
+#include "mcu.h"
-#ifndef INIT_HW_H
-#define INIT_HW_H
#include
#include BOARD_CONFIG
#include "LPC21xx.h"
-#ifdef PERIPHERALS_AUTO_INIT
-#if defined LED || defined USE_LED
-#include "led.h"
-#endif
-#if defined USE_UART0 || defined USE_UART1
-#include "uart.h"
-#endif
-#ifdef USE_USB_SERIAL
-#include "usb_serial.h"
-#endif
-#if defined USE_I2C0 || defined USE_I2C1
-#include "i2c.h"
-#endif
-#endif /* PERIPHERALS_AUTO_INIT */
-
-
/* declare functions and values from crt0.S & the linker control file */
extern void reset(void);
-/* extern void exit(void); */
-extern void abort(void);
+void mcu_arch_init(void) {
-static inline void hw_init(void) {
/* set PLL multiplier & divisor. */
/* values computed from config.h */
PLLCFG = PLLCFG_MSEL | PLLCFG_PSEL;
@@ -82,24 +58,12 @@ static inline void hw_init(void) {
MAMTIM = MAMTIM_CYCLES;
MAMCR = MAMCR_FULL;
- /* setup & enable the MAM */
- MAMTIM = MAMTIM_CYCLES;
- MAMCR = MAMCR_FULL;
-
/* set the peripheral bus speed */
/* value computed from config.h */
VPBDIV = VPBDIV_VALUE;
- /* set the interrupt controller defaults */
- //#if defined(RAM_RUN)
- /* map interrupt vectors space into SRAM */
- // MEMMAP = MEMMAP_SRAM;
- //#elif defined(ROM_RUN)
- /* map interrupt vectors space into FLASH */
+ /* set the interrupt controller to flash */
MEMMAP = MEMMAP_FLASH;
- //#else
- //#error RUN_MODE not defined!
- //#endif
/* clear all interrupts */
VICIntEnClear = 0xFFFFFFFF;
@@ -108,29 +72,4 @@ static inline void hw_init(void) {
/* point unvectored IRQs to reset() */
VICDefVectAddr = (uint32_t)reset;
-
-#ifdef PERIPHERALS_AUTO_INIT
-#if defined LED || defined USE_LED
- led_init();
-#endif
-#ifdef USE_UART0
- uart0_init();
-#endif
-#ifdef USE_UART1
- uart1_init();
-#endif
-#ifdef USE_USB_SERIAL
- VCOM_init();
-#endif
-#ifdef USE_I2C0
- i2c0_init();
-#endif
-#ifdef USE_I2C1
- i2c1_init();
-#endif
-#endif /* PERIPHERALS_AUTO_INIT */
-
-
}
-
-#endif /* INIT_HW_H */
diff --git a/sw/airborne/arch/lpc21/mcu_arch.h b/sw/airborne/arch/lpc21/mcu_arch.h
new file mode 100644
index 0000000000..a677d396c2
--- /dev/null
+++ b/sw/airborne/arch/lpc21/mcu_arch.h
@@ -0,0 +1,35 @@
+/*
+ * Paparazzi lpc21 arch dependant microcontroller initialisation functions
+ *
+ * Copyright (C) 2010 The Paparazzi team
+ *
+ * This file is part of Paparazzi.
+ *
+ * Paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * Paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef LPC21_MCU_ARCH_H
+#define LPC21_MCU_ARCH_H
+
+extern void mcu_arch_init(void);
+
+#include "armVIC.h"
+
+#define mcu_int_enable() enableIRQ()
+#define mcu_int_disable() disableIRQ()
+
+#endif /* LPC21_MCU_ARCH_H */
diff --git a/sw/airborne/arch/lpc21/adc_hw.c b/sw/airborne/arch/lpc21/mcu_periph/adc_arch.c
similarity index 99%
rename from sw/airborne/arch/lpc21/adc_hw.c
rename to sw/airborne/arch/lpc21/mcu_periph/adc_arch.c
index 6fe1f8654d..3c1c298373 100644
--- a/sw/airborne/arch/lpc21/adc_hw.c
+++ b/sw/airborne/arch/lpc21/mcu_periph/adc_arch.c
@@ -22,7 +22,7 @@
*
*/
-#include "adc.h"
+#include "mcu_periph/adc.h"
#include "LPC21xx.h"
#include "armVIC.h"
diff --git a/sw/airborne/arch/lpc21/adc_hw.h b/sw/airborne/arch/lpc21/mcu_periph/adc_arch.h
similarity index 100%
rename from sw/airborne/arch/lpc21/adc_hw.h
rename to sw/airborne/arch/lpc21/mcu_periph/adc_arch.h
diff --git a/sw/airborne/arch/lpc21/i2c_hw.c b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c
similarity index 99%
rename from sw/airborne/arch/lpc21/i2c_hw.c
rename to sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c
index d91352db4b..7d8541121d 100644
--- a/sw/airborne/arch/lpc21/i2c_hw.c
+++ b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c
@@ -22,7 +22,7 @@
*
*/
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "std.h"
#include "interrupt_hw.h"
diff --git a/sw/airborne/arch/lpc21/i2c_hw.h b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.h
similarity index 100%
rename from sw/airborne/arch/lpc21/i2c_hw.h
rename to sw/airborne/arch/lpc21/mcu_periph/i2c_arch.h
diff --git a/sw/airborne/arch/lpc21/spi_hw.c b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.c
similarity index 99%
rename from sw/airborne/arch/lpc21/spi_hw.c
rename to sw/airborne/arch/lpc21/mcu_periph/spi_arch.c
index 5c29360fe6..614704b944 100644
--- a/sw/airborne/arch/lpc21/spi_hw.c
+++ b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.c
@@ -25,7 +25,7 @@
* for now only SPI1 ( aka SSP )
*/
-#include "spi.h"
+#include "mcu_periph/spi.h"
#include "std.h"
#include "LPC21xx.h"
diff --git a/sw/airborne/arch/lpc21/spi_hw.h b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.h
similarity index 98%
rename from sw/airborne/arch/lpc21/spi_hw.h
rename to sw/airborne/arch/lpc21/mcu_periph/spi_arch.h
index 8bd15491a2..6e05e44168 100644
--- a/sw/airborne/arch/lpc21/spi_hw.h
+++ b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.h
@@ -25,8 +25,8 @@
* for now only SPI1 ( aka SSP )
*/
-#ifndef SPI_HW_H
-#define SPI_HW_H
+#ifndef SPI_ARCH_H
+#define SPI_ARCH_H
#include "std.h"
#include "LPC21xx.h"
@@ -192,4 +192,4 @@ extern volatile uint8_t spi_rx_idx;
#define SpiClrCPHA() (SSPCR0 &= ~(_BV(7)))
-#endif /* SPI_HW_H */
+#endif /* SPI_ARCH_H */
diff --git a/sw/airborne/arch/lpc21/uart_hw.c b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c
similarity index 99%
rename from sw/airborne/arch/lpc21/uart_hw.c
rename to sw/airborne/arch/lpc21/mcu_periph/uart_arch.c
index 722dbf411e..55d8df8c52 100644
--- a/sw/airborne/arch/lpc21/uart_hw.c
+++ b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * Copyright (C) 2008 Pascal Brisset, Antoine Drouin
+ * Copyright (C) 2008-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -26,7 +26,7 @@
* Brief LPC21 uart code
*/
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "armVIC.h"
#ifdef USE_UART0
diff --git a/sw/airborne/arch/lpc21/uart_hw.h b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h
similarity index 97%
rename from sw/airborne/arch/lpc21/uart_hw.h
rename to sw/airborne/arch/lpc21/mcu_periph/uart_arch.h
index 06ac5ff7f0..fbc1c6c991 100644
--- a/sw/airborne/arch/lpc21/uart_hw.h
+++ b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef UART_HW_H
-#define UART_HW_H
+#ifndef LPC21_UART_ARCH_H
+#define LPC21_UART_ARCH_H
#include "types.h"
#include "LPC21xx.h"
@@ -93,4 +93,4 @@ extern void uart0_init_param( uint16_t baud, uint8_t mode, uint8_t fmode);
extern uint8_t uart0_tx_running;
extern uint8_t uart1_tx_running;
-#endif /* UART_HW_H */
+#endif /* LPC21_UART_ARCH_H */
diff --git a/sw/airborne/arch/lpc21/modules/display/lcd_dogm_hw.h b/sw/airborne/arch/lpc21/modules/display/lcd_dogm_hw.h
index 3897cf2a0d..14f6640e49 100644
--- a/sw/airborne/arch/lpc21/modules/display/lcd_dogm_hw.h
+++ b/sw/airborne/arch/lpc21/modules/display/lcd_dogm_hw.h
@@ -3,7 +3,7 @@
#include
#include "std.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi.h"
#include "led.h"
diff --git a/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.c b/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.c
index ee707a0668..4b160cdb93 100644
--- a/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.c
+++ b/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.c
@@ -7,8 +7,8 @@
*/
#include "led.h"
-#include "mag_micromag_fw_hw.h"
-#include "sensors/mag_micromag_fw.h"
+#include "modules/sensors/mag_micromag_fw_hw.h"
+#include "modules/sensors/mag_micromag_fw.h"
volatile uint8_t micromag_cur_axe;
diff --git a/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h b/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h
index 9f9b38e6ae..2ea2218424 100644
--- a/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h
+++ b/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h
@@ -5,9 +5,9 @@
#include "std.h"
#include "LPC21xx.h"
-#include "interrupt_hw.h"
+#include "mcu.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi.h"
#include BOARD_CONFIG
#include "generated/airframe.h"
diff --git a/sw/airborne/arch/lpc21/peripherals/max1168_arch.c b/sw/airborne/arch/lpc21/peripherals/max1168_arch.c
index 14a45313da..060fafcde8 100644
--- a/sw/airborne/arch/lpc21/peripherals/max1168_arch.c
+++ b/sw/airborne/arch/lpc21/peripherals/max1168_arch.c
@@ -59,6 +59,7 @@ void max1168_read( void ) {
SSP_DisableRti();
SSP_Enable();
/* write control byte - wait EOC on extint */
+ /* use internal reference and clock, sequentially scan channels 0-7 */
SSPDR = (1 << 0 | 1 << 3 | 7 << 5) << 8;
max1168_status = STA_MAX1168_SENDING_REQ;
diff --git a/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h b/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h
index 955d692fc5..616354e976 100644
--- a/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h
+++ b/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h
@@ -26,7 +26,7 @@
#define RADIO_CONTROL_SPEKTRUM_ARCH_H
#include "std.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include RADIO_CONTROL_SPEKTRUM_MODEL_H
@@ -73,27 +73,27 @@ extern const int16_t rc_spk_throw[RADIO_CONTROL_NB_CHANNEL];
rc_spk_parser_idx++; \
if (rc_spk_parser_idx >= 2*RADIO_CONTROL_NB_CHANNEL) { \
rc_spk_parser_status = RC_SPK_STA_UNINIT; \
- radio_control.frame_cpt++; \
- radio_control.time_since_last_frame = 0; \
- radio_control.status = RC_OK; \
- uint8_t i; \
- for (i=0;i> 10;*/ \
- const int16_t val = (tmp&0x03FF) - 512; \
- radio_control.values[i] = val; \
- radio_control.values[i] *= rc_spk_throw[i]; \
- if (i==RADIO_CONTROL_THROTTLE) { \
- radio_control.values[i] += MAX_PPRZ; \
- radio_control.values[i] /= 2; \
- } \
- } \
- _received_frame_handler(); \
+ radio_control.frame_cpt++; \
+ radio_control.time_since_last_frame = 0; \
+ radio_control.status = RC_OK; \
+ uint8_t i; \
+ for (i=0;i> 10;*/ \
+ const int16_t val = (tmp&0x03FF) - 512; \
+ radio_control.values[i] = val; \
+ radio_control.values[i] *= rc_spk_throw[i]; \
+ if (i==RADIO_CONTROL_THROTTLE) { \
+ radio_control.values[i] += MAX_PPRZ; \
+ radio_control.values[i] /= 2; \
+ } \
+ } \
+ _received_frame_handler(); \
} \
break; \
- default: \
- rc_spk_parser_status = RC_SPK_STA_UNINIT; \
+ default: \
+ rc_spk_parser_status = RC_SPK_STA_UNINIT; \
} \
} \
}
diff --git a/sw/airborne/arch/lpc21/usb_ser_hw.c b/sw/airborne/arch/lpc21/usb_ser_hw.c
index d372aec8a0..b44ee52fcf 100644
--- a/sw/airborne/arch/lpc21/usb_ser_hw.c
+++ b/sw/airborne/arch/lpc21/usb_ser_hw.c
@@ -51,7 +51,7 @@
#include
#include "LPC21xx.h"
#include "armVIC.h"
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#include BOARD_CONFIG
#include "lpcusb/usbapi.h"
diff --git a/sw/airborne/arch/lpc21/usb_tunnel.c b/sw/airborne/arch/lpc21/usb_tunnel.c
index 869caeabd3..f7f324da24 100644
--- a/sw/airborne/arch/lpc21/usb_tunnel.c
+++ b/sw/airborne/arch/lpc21/usb_tunnel.c
@@ -31,13 +31,11 @@
*/
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
-#include "uart_hw.h"
-#include "uart.h"
-#include "usb_serial.h"
+#include "mcu_periph/uart.h"
+#include "mcu_periph/usb_serial.h"
/* minimum LED blink on time 10Hz = 100ms */
#define BLINK_MIN 10
@@ -46,21 +44,11 @@ int main( void ) {
unsigned char inc;
unsigned int rx_time=0, tx_time=0;
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
VCOM_allow_linecoding(1);
-#ifdef USE_UART0
- Uart0Init();
-#else
-#ifdef USE_UART1
- Uart1Init();
-#else
-#error no serial port defined
-#endif
-#endif
-
#ifdef USE_USB_SERIAL
VCOM_init();
#endif
diff --git a/sw/airborne/arch/sim/gps_hw.c b/sw/airborne/arch/sim/gps_hw.c
index 75dfc0ac47..4511247803 100644
--- a/sw/airborne/arch/sim/gps_hw.c
+++ b/sw/airborne/arch/sim/gps_hw.c
@@ -1,7 +1,5 @@
#include "gps.h"
-#include "6dof.h"
-
/* in gps_ubx.c */
volatile uint8_t gps_msg_received;
bool_t gps_pos_available;
diff --git a/sw/airborne/arch/sim/init_hw.h b/sw/airborne/arch/sim/init_hw.h
deleted file mode 100644
index 32a393b484..0000000000
--- a/sw/airborne/arch/sim/init_hw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef INIT_HW_H
-#define INIT_HW_H
-
-static inline void hw_init(void) {}
-
-#endif /* INIT_HW_H */
diff --git a/sw/airborne/arch/sim/interrupt_hw.h b/sw/airborne/arch/sim/interrupt_hw.h
deleted file mode 100644
index 12561a990c..0000000000
--- a/sw/airborne/arch/sim/interrupt_hw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef INTERRUPT_HW_H
-#define INTERRUPT_HW_H
-
-#define int_enable() {}
-
-#endif /* INTERRUPT_HW_H */
diff --git a/sw/airborne/arch/sim/jsbsim_gps.c b/sw/airborne/arch/sim/jsbsim_gps.c
index 767eda28b6..1df8a10cd9 100644
--- a/sw/airborne/arch/sim/jsbsim_gps.c
+++ b/sw/airborne/arch/sim/jsbsim_gps.c
@@ -11,7 +11,7 @@
#include "gps.h"
#include "estimator.h"
#include "latlong.h"
-#include "common_nav.h"
+#include "subsystems/navigation/common_nav.h"
uint8_t gps_mode;
uint16_t gps_week; /* weeks */
diff --git a/sw/airborne/arch/sim/jsbsim_hw.c b/sw/airborne/arch/sim/jsbsim_hw.c
index 153f8859a8..d188b1609a 100644
--- a/sw/airborne/arch/sim/jsbsim_hw.c
+++ b/sw/airborne/arch/sim/jsbsim_hw.c
@@ -28,7 +28,7 @@ uint16_t adc_generic_val2;
uint8_t ac_id;
void update_bat(double bat) {
- fbw_vsupply_decivolt = (int) (bat * 10.);
+ electrical.vsupply = (int) (bat * 10.);
}
void adc_generic_init( void ) {}
diff --git a/sw/airborne/arch/sim/jsbsim_hw.h b/sw/airborne/arch/sim/jsbsim_hw.h
index be7a43b4ad..88ed9404a7 100644
--- a/sw/airborne/arch/sim/jsbsim_hw.h
+++ b/sw/airborne/arch/sim/jsbsim_hw.h
@@ -33,14 +33,14 @@
#include "firmwares/fixedwing/autopilot.h"
#include "estimator.h"
#include "gps.h"
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
#include "generated/flight_plan.h"
#include "generated/airframe.h"
#include "generated/settings.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
-#include "infrared.h"
+#include "subsystems/sensors/infrared.h"
#include "commands.h"
#include "firmwares/fixedwing/main_ap.h"
#include "ap_downlink.h"
diff --git a/sw/airborne/arch/sim/jsbsim_ir.c b/sw/airborne/arch/sim/jsbsim_ir.c
index c05b9a67d9..9d448d486b 100644
--- a/sw/airborne/arch/sim/jsbsim_ir.c
+++ b/sw/airborne/arch/sim/jsbsim_ir.c
@@ -21,9 +21,9 @@ void set_ir(double roll, double pitch) {
double roll_sensor = roll + JSBSIM_IR_ROLL_NEUTRAL; // ir_roll_neutral;
double pitch_sensor = pitch + JSBSIM_IR_PITCH_NEUTRAL; // ir_pitch_neutral;
#ifdef USE_INFRARED
- ir_roll = sin(roll_sensor) * ir_contrast;
- ir_pitch = sin(pitch_sensor) * ir_contrast;
- ir_top = cos(roll_sensor) * cos(pitch_sensor) * ir_contrast;
+ infrared.roll = sin(roll_sensor) * ir_contrast;
+ infrared.pitch = sin(pitch_sensor) * ir_contrast;
+ infrared.top = cos(roll_sensor) * cos(pitch_sensor) * ir_contrast;
#endif
}
diff --git a/sw/airborne/arch/sim/mcu_arch.c b/sw/airborne/arch/sim/mcu_arch.c
new file mode 100644
index 0000000000..1820c41208
--- /dev/null
+++ b/sw/airborne/arch/sim/mcu_arch.c
@@ -0,0 +1,3 @@
+
+
+void mcu_arch_init(void) {}
diff --git a/sw/airborne/arch/avr/init_hw.h b/sw/airborne/arch/sim/mcu_arch.h
similarity index 68%
rename from sw/airborne/arch/avr/init_hw.h
rename to sw/airborne/arch/sim/mcu_arch.h
index f517fdbc7d..9500d80520 100644
--- a/sw/airborne/arch/avr/init_hw.h
+++ b/sw/airborne/arch/sim/mcu_arch.h
@@ -1,7 +1,7 @@
/*
- * Paparazzi $Id$
+ * $Id$
*
- * Copyright (C) 2005 Pascal Brisset, Antoine Drouin
+ * Copyright (C) 2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -22,23 +22,12 @@
*
*/
-/*
- *\brief AVR low level hardware initialisation
- *
- */
+#ifndef SIM_MCU_ARCH_H
+#define SIM_MCU_ARCH_H
-#ifndef INIT_HW_H
-#define INIT_HW_H
+extern void mcu_arch_init(void);
-#include
+#define mcu_int_enable() {}
-static inline void hw_init(void) {
- /** Pause */
- uint8_t foo1 = 25;
- while (foo1--) {
- uint16_t foo2 = 1;
- while (foo2++);
- }
-}
+#endif /* SIM_MCU_ARCH_H */
-#endif /* INIT_HW_H */
diff --git a/sw/airborne/arch/sim/adc_hw.c b/sw/airborne/arch/sim/mcu_periph/adc_arch.c
similarity index 88%
rename from sw/airborne/arch/sim/adc_hw.c
rename to sw/airborne/arch/sim/mcu_periph/adc_arch.c
index 05d7287f27..0a21926066 100644
--- a/sw/airborne/arch/sim/adc_hw.c
+++ b/sw/airborne/arch/sim/mcu_periph/adc_arch.c
@@ -1,4 +1,4 @@
-#include "adc.h"
+#include "mcu_periph/adc.h"
void adc_buf_channel(uint8_t adc_channel __attribute__ ((unused)),
struct adc_buf* s __attribute__ ((unused)),
diff --git a/sw/airborne/arch/sim/adc_hw.h b/sw/airborne/arch/sim/mcu_periph/adc_arch.h
similarity index 100%
rename from sw/airborne/arch/sim/adc_hw.h
rename to sw/airborne/arch/sim/mcu_periph/adc_arch.h
diff --git a/sw/airborne/arch/sim/i2c_hw.c b/sw/airborne/arch/sim/mcu_periph/i2c_arch.c
similarity index 85%
rename from sw/airborne/arch/sim/i2c_hw.c
rename to sw/airborne/arch/sim/mcu_periph/i2c_arch.c
index 37d9c6df38..cd16065446 100644
--- a/sw/airborne/arch/sim/i2c_hw.c
+++ b/sw/airborne/arch/sim/mcu_periph/i2c_arch.c
@@ -1,4 +1,4 @@
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
void i2c_hw_init ( void ) {}
diff --git a/sw/airborne/arch/sim/i2c_hw.h b/sw/airborne/arch/sim/mcu_periph/i2c_arch.h
similarity index 61%
rename from sw/airborne/arch/sim/i2c_hw.h
rename to sw/airborne/arch/sim/mcu_periph/i2c_arch.h
index 24b31c0b8f..3f5e6921c1 100644
--- a/sw/airborne/arch/sim/i2c_hw.h
+++ b/sw/airborne/arch/sim/mcu_periph/i2c_arch.h
@@ -1,5 +1,5 @@
-#ifndef I2C_HW_H
-#define I2C_HW_H
+#ifndef SIM_MCU_PERIPH_I2C_ARCH_H
+#define SIM_MCU_PERIPH_I2C_ARCH_H
#define I2cSendStart() {}
@@ -10,4 +10,4 @@
#define I2c0SendStart() {}
#define I2c1SendStart() {}
-#endif /* I2C_HW_H */
+#endif /* SIM_MCU_PERIPH_I2C_ARCH_H */
diff --git a/sw/airborne/arch/sim/mcu_periph/spi_arch.c b/sw/airborne/arch/sim/mcu_periph/spi_arch.c
new file mode 100644
index 0000000000..43ec2e48d4
--- /dev/null
+++ b/sw/airborne/arch/sim/mcu_periph/spi_arch.c
@@ -0,0 +1,3 @@
+#include "mcu_periph/spi.h"
+
+void spi_init( void ) {}
diff --git a/sw/airborne/arch/sim/spi_hw.h b/sw/airborne/arch/sim/mcu_periph/spi_arch.h
similarity index 100%
rename from sw/airborne/arch/sim/spi_hw.h
rename to sw/airborne/arch/sim/mcu_periph/spi_arch.h
diff --git a/sw/airborne/arch/sim/uart_hw.h b/sw/airborne/arch/sim/mcu_periph/uart_arch.h
similarity index 100%
rename from sw/airborne/arch/sim/uart_hw.h
rename to sw/airborne/arch/sim/mcu_periph/uart_arch.h
diff --git a/sw/airborne/arch/sim/micromag_hw.c b/sw/airborne/arch/sim/micromag_hw.c
index bb867b7156..3dd9c24c01 100644
--- a/sw/airborne/arch/sim/micromag_hw.c
+++ b/sw/airborne/arch/sim/micromag_hw.c
@@ -28,16 +28,15 @@
#include "micromag.h"
-#include "6dof.h"
void micromag_hw_init( void ) {}
void micromag_read( void ) {}
void micromag_hw_feed_value(VEC* mag) {
- micromag_values[0] = mag->ve[AXIS_X];
- micromag_values[1] = mag->ve[AXIS_Y];
- micromag_values[2] = mag->ve[AXIS_Z];
+ micromag_values[0] = mag->ve[0];
+ micromag_values[1] = mag->ve[1];
+ micromag_values[2] = mag->ve[2];
micromag_status = MM_DATA_AVAILABLE;
}
diff --git a/sw/airborne/arch/sim/sim_ap.c b/sw/airborne/arch/sim/sim_ap.c
index c87337eebd..9a8d211881 100644
--- a/sw/airborne/arch/sim/sim_ap.c
+++ b/sw/airborne/arch/sim/sim_ap.c
@@ -12,19 +12,19 @@
#include "autopilot.h"
#include "estimator.h"
#include "gps.h"
-#include "traffic_info.h"
-#include "generated/flight_plan.h"
+#include "subsystems/navigation/traffic_info.h"
#include "generated/settings.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
-#include "infrared.h"
+#include "subsystems/sensors/infrared.h"
#include "commands.h"
#include "firmwares/fixedwing/main_ap.h"
#include "ap_downlink.h"
#include "sim_uart.h"
#include "latlong.h"
#include "datalink.h"
+#include "generated/flight_plan.h"
#include
#include
@@ -91,7 +91,7 @@ value sim_init(value unit) {
}
value update_bat(value bat) {
- fbw_vsupply_decivolt = Int_val(bat);
+ electrical.vsupply = Int_val(bat);
return Val_unit;
}
diff --git a/sw/airborne/arch/sim/sim_baro.c b/sw/airborne/arch/sim/sim_baro.c
index d6e737e3b0..e117d97a18 100644
--- a/sw/airborne/arch/sim/sim_baro.c
+++ b/sw/airborne/arch/sim/sim_baro.c
@@ -1,6 +1,6 @@
#include
#include "estimator.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "gps.h"
#include "baro_MS5534A.h"
diff --git a/sw/airborne/arch/sim/sim_gps.c b/sw/airborne/arch/sim/sim_gps.c
index 6a157d808b..6bfe4c9058 100644
--- a/sw/airborne/arch/sim/sim_gps.c
+++ b/sw/airborne/arch/sim/sim_gps.c
@@ -11,7 +11,7 @@
#include "gps.h"
#include "estimator.h"
#include "latlong.h"
-#include "common_nav.h"
+#include "subsystems/navigation/common_nav.h"
#include
diff --git a/sw/airborne/arch/sim/sim_imu.c b/sw/airborne/arch/sim/sim_imu.c
new file mode 100644
index 0000000000..0169091122
--- /dev/null
+++ b/sw/airborne/arch/sim/sim_imu.c
@@ -0,0 +1,15 @@
+/** \file sim_ir.c
+ * \brief Regroup functions to simulate autopilot/infrared.c
+ *
+ * Infrared soft simulation. OCaml binding.
+ */
+
+
+#include
+#include "subsystems/sensors/infrared.h"
+#include "generated/airframe.h"
+
+#include
+
+float ins_roll_neutral = INS_ROLL_NEUTRAL_DEFAULT;
+float ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT;
diff --git a/sw/airborne/arch/sim/sim_ir.c b/sw/airborne/arch/sim/sim_ir.c
index ffc1cac2e5..88441205f8 100644
--- a/sw/airborne/arch/sim/sim_ir.c
+++ b/sw/airborne/arch/sim/sim_ir.c
@@ -6,7 +6,7 @@
#include
-#include "infrared.h"
+#include "subsystems/sensors/infrared.h"
#include "generated/airframe.h"
#include
@@ -22,9 +22,9 @@ value set_ir(value roll __attribute__ ((unused)),
value air_speed
) {
#if defined USE_INFRARED || USE_INFRARED_I2C
- ir_roll = Int_val(roll);
- ir_pitch = Int_val(front);
- ir_top = Int_val(top);
+ infrared.roll = Int_val(roll);
+ infrared.pitch = Int_val(front);
+ infrared.top = Int_val(top);
#endif
sim_air_speed = Double_val(air_speed);
return Val_unit;
diff --git a/sw/airborne/arch/sim/sim_jsbsim.c b/sw/airborne/arch/sim/sim_jsbsim.c
index b830460e5a..f81a5bcb41 100644
--- a/sw/airborne/arch/sim/sim_jsbsim.c
+++ b/sw/airborne/arch/sim/sim_jsbsim.c
@@ -12,13 +12,13 @@
#include "autopilot.h"
#include "estimator.h"
#include "gps.h"
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
#include "generated/flight_plan.h"
#include "generated/settings.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "ffirmwares/fixedwing/guidance/guidance_v.h"
-#include "infrared.h"
+#include "subsystems/sensors/infrared.h"
#include "commands.h"
#include "firmwares/fixedwing/main_ap.h"
#include "ap_downlink.h"
diff --git a/sw/airborne/arch/sim/spi_hw.c b/sw/airborne/arch/sim/spi_hw.c
deleted file mode 100644
index cd0b3ece6e..0000000000
--- a/sw/airborne/arch/sim/spi_hw.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "spi.h"
-
-void spi_init( void ) {}
diff --git a/sw/airborne/arch/stm32/init_hw.h b/sw/airborne/arch/stm32/mcu_arch.c
similarity index 54%
rename from sw/airborne/arch/stm32/init_hw.h
rename to sw/airborne/arch/stm32/mcu_arch.c
index 5f601a4673..eb6760b1c6 100644
--- a/sw/airborne/arch/stm32/init_hw.h
+++ b/sw/airborne/arch/stm32/mcu_arch.c
@@ -1,34 +1,29 @@
/*
- * Paparazzi $Id$
+ * Paparazzi stm32 arch dependant microcontroller initialisation function
*
- * Copyright (C) 2009-2010 The Paparazzi Team
+ * Copyright (C) 2010 The Paparazzi team
*
- * This file is part of paparazzi.
+ * This file is part of Paparazzi.
*
- * paparazzi is free software; you can redistribute it and/or modify
+ * Paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
- * paparazzi is distributed in the hope that it will be useful,
+ * Paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING. If not, write to
+ * along with Paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
- */
-
-/*
- *\brief STM low level hardware initialisation
- * PLL, MAM, VIC
*
*/
-#ifndef INIT_HW_H
-#define INIT_HW_H
+#include "mcu.h"
+
#include
#include
@@ -38,43 +33,7 @@
#include BOARD_CONFIG
-/* should probably not be here
- * a couple of macros to use the rev instruction
- */
-#define MyByteSwap16(in, out) { \
- asm volatile ( \
- "rev16 %0, %1\n\t" \
- : "=r" (out) \
- : "r"(in) \
- ); \
- }
-
-
-#ifdef PERIPHERALS_AUTO_INIT
-#ifdef USE_LED
-#include "led.h"
-#endif
-#if defined RADIO_CONTROL
-#if defined RADIO_CONTROL_LINK || defined RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT
-#include "subsystems/radio_control.h"
-#endif
-#endif
-#if defined USE_UART1 || defined USE_UART2 || defined USE_UART3
-#include "uart.h"
-#endif
-#if defined USE_I2C1 || defined USE_I2C2
-#include "i2c.h"
-#endif
-#endif /* PERIPHERALS_AUTO_INIT */
-
-
-/* declare functions and values from crt0.S & the linker control file */
-extern void reset(void);
-/* extern void exit(void); */
-extern void abort(void);
-
-
-static inline void hw_init(void) {
+void mcu_arch_init(void) {
#ifdef HSE_TYPE_EXT_CLK
/* Setup the microcontroller system.
@@ -119,33 +78,5 @@ static inline void hw_init(void) {
/* Set the Vector Table base location at 0x08000000 */
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
-
-#ifdef PERIPHERALS_AUTO_INIT
-#ifdef USE_LED
- led_init();
-#endif
- /* for now this means using spektrum */
-#if defined RADIO_CONTROL & defined RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT & defined RADIO_CONTROL_BIND_IMPL_FUNC
- RADIO_CONTROL_BIND_IMPL_FUNC();
-#endif
-#ifdef USE_UART1
- uart1_init();
-#endif
-#ifdef USE_UART2
- uart2_init();
-#endif
-#ifdef USE_UART3
- uart3_init();
-#endif
-#ifdef USE_I2C1
- i2c1_init();
-#endif
-#ifdef USE_I2C2
- i2c2_init();
-#endif
-#endif /* PERIPHERALS_AUTO_INIT */
-
-
}
-#endif /* INIT_HW_H */
diff --git a/sw/airborne/arch/stm32/mcu_arch.h b/sw/airborne/arch/stm32/mcu_arch.h
new file mode 100644
index 0000000000..b8110a16cc
--- /dev/null
+++ b/sw/airborne/arch/stm32/mcu_arch.h
@@ -0,0 +1,45 @@
+/*
+ * Paparazzi stm32 arch dependant microcontroller initialisation function
+ *
+ * Copyright (C) 2010 The Paparazzi team
+ *
+ * This file is part of Paparazzi.
+ *
+ * Paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * Paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef STM32_MCU_ARCH_H
+#define STM32_MCU_ARCH_H
+
+extern void mcu_arch_init(void);
+
+
+/* should probably not be here
+ * a couple of macros to use the rev instruction
+ */
+#define MyByteSwap16(in, out) { \
+ asm volatile ( \
+ "rev16 %0, %1\n\t" \
+ : "=r" (out) \
+ : "r"(in) \
+ ); \
+ }
+
+#define mcu_int_enable() {}
+#define mcu_int_disable() {}
+
+#endif /* STM32_MCU_ARCH_H */
diff --git a/sw/airborne/arch/stm32/adc_hw.c b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c
similarity index 97%
rename from sw/airborne/arch/stm32/adc_hw.c
rename to sw/airborne/arch/stm32/mcu_periph/adc_arch.c
index bbea45a95c..8ff6734e31 100644
--- a/sw/airborne/arch/stm32/adc_hw.c
+++ b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c
@@ -83,8 +83,7 @@
*/
-#include "adc.h"
-#include "adc_hw.h"
+#include "mcu_periph/adc.h"
#include
#include
#include
@@ -125,16 +124,16 @@ static inline void adc_init_irq( void );
// {{{
/*
- GPIO mapping for ADC1 pins (PA.B, PB.1, PC.3, PC.5).
+ GPIO mapping for ADC1 pins (PB.1, PB.0, PC.5, PC.3).
Can be changed by predefining ADC1_GPIO_INIT.
*/
#ifdef USE_AD1
#ifndef ADC1_GPIO_INIT
#define ADC1_GPIO_INIT(gpio) { \
- (gpio).GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1; \
+ (gpio).GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_0; \
(gpio).GPIO_Mode = GPIO_Mode_AIN; \
GPIO_Init(GPIOB, (&gpio)); \
- (gpio).GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_5; \
+ (gpio).GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_3; \
GPIO_Init(GPIOC, (&gpio)); \
}
#endif // ADC1_GPIO_INIT
@@ -387,7 +386,9 @@ void adc_init( void ) {
// using defines.
adc_channel_map[0] = ADC_Channel_8;
adc_channel_map[1] = ADC_Channel_9;
- adc_channel_map[2] = ADC_Channel_13;
+ // adc_channel_map[2] = ADC_Channel_13;
+ // FIXME for now we get battery voltage this way
+ adc_channel_map[2] = ADC_Channel_0;
adc_channel_map[3] = ADC_Channel_15;
adc_init_rcc();
diff --git a/sw/airborne/arch/stm32/adc_hw.h b/sw/airborne/arch/stm32/mcu_periph/adc_arch.h
similarity index 100%
rename from sw/airborne/arch/stm32/adc_hw.h
rename to sw/airborne/arch/stm32/mcu_periph/adc_arch.h
diff --git a/sw/airborne/arch/stm32/can_hw.c b/sw/airborne/arch/stm32/mcu_periph/can_arch.c
similarity index 99%
rename from sw/airborne/arch/stm32/can_hw.c
rename to sw/airborne/arch/stm32/mcu_periph/can_arch.c
index 5d0991e3ea..2af91534c1 100644
--- a/sw/airborne/arch/stm32/can_hw.c
+++ b/sw/airborne/arch/stm32/mcu_periph/can_arch.c
@@ -25,7 +25,7 @@
#include
#include
-#include "can_hw.h"
+#include "mcu_periph/can.h"
#include
#include
diff --git a/sw/airborne/arch/stm32/can_hw.h b/sw/airborne/arch/stm32/mcu_periph/can_arch.h
similarity index 89%
rename from sw/airborne/arch/stm32/can_hw.h
rename to sw/airborne/arch/stm32/mcu_periph/can_arch.h
index e6f6228a71..b2fa04798a 100644
--- a/sw/airborne/arch/stm32/can_hw.h
+++ b/sw/airborne/arch/stm32/mcu_periph/can_arch.h
@@ -22,11 +22,11 @@
*
*/
-#ifndef CAN_HW_H
-#define CAN_HW_H
+#ifndef MCU_PERIPH_STM32_CAN_ARCH_H
+#define MCU_PERIPH_STM32_CAN_ARCH_H
void can_hw_init(void);
void usb_lp_can1_rx0_irq_handler(void);
int can_hw_transmit(uint32_t id, const uint8_t *buf, uint8_t len);
-#endif /* CAN_HW_H */
+#endif /* MCU_PERIPH_STM32_CAN_ARCH_H */
diff --git a/sw/airborne/arch/stm32/i2c_hw.c b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c
similarity index 99%
rename from sw/airborne/arch/stm32/i2c_hw.c
rename to sw/airborne/arch/stm32/mcu_periph/i2c_arch.c
index fb9325d7a4..2099326c6c 100644
--- a/sw/airborne/arch/stm32/i2c_hw.c
+++ b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c
@@ -1,4 +1,4 @@
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include
#include
diff --git a/sw/airborne/arch/stm32/i2c_hw.h b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.h
similarity index 97%
rename from sw/airborne/arch/stm32/i2c_hw.h
rename to sw/airborne/arch/stm32/mcu_periph/i2c_arch.h
index 2d41241471..0274829fc1 100644
--- a/sw/airborne/arch/stm32/i2c_hw.h
+++ b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.h
@@ -28,7 +28,7 @@
#ifndef I2C_HW_H
#define I2C_HW_H
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include
diff --git a/sw/airborne/arch/stm32/uart_hw.c b/sw/airborne/arch/stm32/mcu_periph/uart_arch.c
similarity index 99%
rename from sw/airborne/arch/stm32/uart_hw.c
rename to sw/airborne/arch/stm32/mcu_periph/uart_arch.c
index f1c1fd4743..3edce0c1d1 100644
--- a/sw/airborne/arch/stm32/uart_hw.c
+++ b/sw/airborne/arch/stm32/mcu_periph/uart_arch.c
@@ -21,7 +21,7 @@
* Boston, MA 02111-1307, USA.
*/
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include
#include
@@ -282,9 +282,6 @@ volatile uint16_t uart3_tx_insert_idx, uart3_tx_extract_idx;
volatile bool_t uart3_tx_running;
uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE];
-#include "led.h"
-
-
void uart3_init( void ) {
/* init RCC */
diff --git a/sw/airborne/arch/stm32/uart_hw.h b/sw/airborne/arch/stm32/mcu_periph/uart_arch.h
similarity index 97%
rename from sw/airborne/arch/stm32/uart_hw.h
rename to sw/airborne/arch/stm32/mcu_periph/uart_arch.h
index 8679622711..e281700dba 100644
--- a/sw/airborne/arch/stm32/uart_hw.h
+++ b/sw/airborne/arch/stm32/mcu_periph/uart_arch.h
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * Copyright (C) 2009 Antoine Drouin
+ * Copyright (C) 2009-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -26,8 +26,8 @@
*
*/
-#ifndef UART_HW_H
-#define UART_HW_H
+#ifndef STM32_UART_ARCH_H
+#define STM32_UART_ARCH_H
#include "std.h"
@@ -183,4 +183,4 @@ extern uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE];
void uart_init( void );
-#endif /* UART_HW_H */
+#endif /* STM32_UART_ARCH_H */
diff --git a/sw/airborne/arch/stm32/peripherals/hmc8543_arch.c b/sw/airborne/arch/stm32/peripherals/hmc8543_arch.c
index e85724e199..f50c285037 100644
--- a/sw/airborne/arch/stm32/peripherals/hmc8543_arch.c
+++ b/sw/airborne/arch/stm32/peripherals/hmc8543_arch.c
@@ -27,7 +27,7 @@
#include
#include
#include
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
void exti9_5_irq_handler(void);
diff --git a/sw/airborne/arch/stm32/peripherals/max1168_arch.c b/sw/airborne/arch/stm32/peripherals/max1168_arch.c
index f39881bc80..3239a3ad86 100644
--- a/sw/airborne/arch/stm32/peripherals/max1168_arch.c
+++ b/sw/airborne/arch/stm32/peripherals/max1168_arch.c
@@ -97,6 +97,7 @@ void max1168_read( void ) {
Max1168Select();
/* write control byte - wait EOC on extint */
+ /* use internal reference and clock, sequentially scan channels 0-7 */
const uint16_t ctl_byte = (1 << 0 | 1 << 3 | 7 << 5) << 8;
SPI_I2S_SendData(SPI2, ctl_byte);
max1168_status = STA_MAX1168_SENDING_REQ;
diff --git a/sw/airborne/arch/stm32/stm32_vector_table.c b/sw/airborne/arch/stm32/stm32_vector_table.c
index 40b187d87f..a2cd4e7348 100644
--- a/sw/airborne/arch/stm32/stm32_vector_table.c
+++ b/sw/airborne/arch/stm32/stm32_vector_table.c
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * Copyright (C) 2010 Antoine Drouin
+ * Copyright (C) 2010 The Paparazzi Team
*
* This file is part of Paparazzi.
*
@@ -35,28 +35,28 @@
#endif
#if defined USE_UART1 || OVERRIDE_UART1_IRQ_HANDLER
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define USART1_IRQ_HANDLER usart1_irq_handler
#else
#define USART1_IRQ_HANDLER null_handler
#endif
#if defined USE_UART2 || OVERRIDE_UART2_IRQ_HANDLER
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define USART2_IRQ_HANDLER usart2_irq_handler
#else
#define USART2_IRQ_HANDLER null_handler
#endif
#if defined USE_UART3 || OVERRIDE_UART3_IRQ_HANDLER
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define USART3_IRQ_HANDLER usart3_irq_handler
#else
#define USART3_IRQ_HANDLER null_handler
#endif
#if defined USE_UART5 || OVERRIDE_UART5_IRQ_HANDLER
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define USART5_IRQ_HANDLER usart5_irq_handler
#else
#define USART5_IRQ_HANDLER null_handler
@@ -64,7 +64,7 @@
#ifdef USE_I2C1
-#include "i2c_hw.h"
+#include "mcu_periph/i2c_arch.h"
#define I2C1_EV_IRQ_HANDLER i2c1_ev_irq_handler
#define I2C1_ER_IRQ_HANDLER i2c1_er_irq_handler
#else
@@ -73,7 +73,7 @@
#endif
#ifdef USE_I2C2
-#include "i2c_hw.h"
+#include "mcu_periph/i2c_arch.h"
#define I2C2_EV_IRQ_HANDLER i2c2_ev_irq_handler
#define I2C2_ER_IRQ_HANDLER i2c2_er_irq_handler
#else
diff --git a/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c b/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c
index 6cd584f842..ca50b9c639 100644
--- a/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c
+++ b/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c
@@ -7,7 +7,7 @@
#include
#include
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
/* gyro int handler */
void exti15_10_irq_handler(void);
diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c
index 316122ebe4..91b609b63d 100644
--- a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c
+++ b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c
@@ -27,10 +27,9 @@
#include
#include
#include
-#include "uart.h"
#include "subsystems/radio_control.h"
#include "subsystems/radio_control/spektrum_arch.h"
-#include "firmwares/rotorcraft/autopilot.h"
+#include "mcu_periph/uart.h"
#define SPEKTRUM_CHANNELS_PER_FRAME 7
diff --git a/sw/airborne/boards/booz/baro_board.c b/sw/airborne/boards/booz/baro_board.c
index cc92db4224..aa43c684a5 100644
--- a/sw/airborne/boards/booz/baro_board.c
+++ b/sw/airborne/boards/booz/baro_board.c
@@ -21,7 +21,7 @@
*/
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
#include "generated/airframe.h"
#include "led.h"
diff --git a/sw/airborne/boards/booz/baro_board.h b/sw/airborne/boards/booz/baro_board.h
index 135bebbdac..f1fae16a48 100644
--- a/sw/airborne/boards/booz/baro_board.h
+++ b/sw/airborne/boards/booz/baro_board.h
@@ -3,7 +3,7 @@
#include "std.h"
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
#include "booz/booz2_analog.h"
/* we don't need that on this board */
diff --git a/sw/airborne/boards/booz/test_baro.c b/sw/airborne/boards/booz/test_baro.c
index 05b81ae065..f00cbe54e9 100644
--- a/sw/airborne/boards/booz/test_baro.c
+++ b/sw/airborne/boards/booz/test_baro.c
@@ -29,12 +29,11 @@
#include BOARD_CONFIG
-#include "init_hw.h"
-#include "interrupt_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "downlink.h"
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
static inline void main_init( void );
static inline void main_periodic_task( void );
@@ -57,11 +56,11 @@ int main(void) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
booz2_analog_init();
baro_init();
- int_enable();
+ mcu_int_enable();
}
diff --git a/sw/airborne/boards/booz_1.0.h b/sw/airborne/boards/booz_1.0.h
index 51e461a3c9..7634648333 100644
--- a/sw/airborne/boards/booz_1.0.h
+++ b/sw/airborne/boards/booz_1.0.h
@@ -93,6 +93,8 @@
#define PWM1_PINSEL_BIT 14
+#define BOARD_HAS_BARO
+
/*
* Modem
*/
diff --git a/sw/airborne/boards/classix_1.0.h b/sw/airborne/boards/classix_1.0.h
new file mode 100644
index 0000000000..6d875f04da
--- /dev/null
+++ b/sw/airborne/boards/classix_1.0.h
@@ -0,0 +1,95 @@
+#ifndef CONFIG_CLASSIX_H
+#define CONFIG_CLASSIX_H
+
+/* Master oscillator freq. */
+#define FOSC (12000000)
+/* PLL multiplier */
+#define PLL_MUL (5)
+/* CPU clock freq. */
+#define CCLK (FOSC * PLL_MUL)
+/* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */
+#define PBSD_BITS 0x00
+#define PBSD_VAL 4
+/* Peripheral bus clock freq. */
+#define PCLK (CCLK / PBSD_VAL)
+
+
+
+#ifdef FBW
+#define LED_1_BANK 1
+#define LED_1_PIN 24
+
+#define LED_2_BANK 1
+#define LED_2_PIN 31
+
+
+/* PPM : rc rx on P0.16 : FBW_RC1 connector
+#define PPM_PINSEL PINSEL1
+#define PPM_PINSEL_VAL 0x03
+#define PPM_PINSEL_BIT 0
+*/
+
+
+/* PPM : rc rx on P0.6 : FBW_RC0 connector */
+#define PPM_PINSEL PINSEL0
+#define PPM_PINSEL_VAL 0x02
+#define PPM_PINSEL_BIT 12
+#define PPM_CRI TIR_CR2I
+#define PPM_CCR_CRF TCCR_CR2_F
+#define PPM_CCR_CRR TCCR_CR2_R
+#define PPM_CCR_CRI TCCR_CR2_I
+#define PPM_CR T0CR2
+
+/* SERVOS : 4017 on FBW_RC0 connector */
+
+/* MAT0.1 on P0.5 */
+#define SERVO_CLOCK_PIN 5
+#define SERVO_CLOCK_PINSEL PINSEL0
+#define SERVO_CLOCK_PINSEL_VAL 0x02
+#define SERVO_CLOCK_PINSEL_BIT 10
+
+/* reset on P1.25 */
+#define SERVO_RESET_PIN 25
+#define SERVO_RESET_PINSEL PINSEL2
+
+/* ADCs */
+/* AD0.6 ( on pin P0.4 ) is supply monitoring */
+#define USE_AD0_6
+
+#endif /* FBW */
+
+
+
+#ifdef AP
+
+#define SPI_SELECT_SLAVE0_PORT 0
+#define SPI_SELECT_SLAVE0_PIN 20
+
+#ifndef SITL
+/* sitl handles this board as a mono-processor one: unfortunately these
+ definitions are already in FBW */
+
+#define LED_1_BANK 1
+#define LED_1_PIN 18
+
+#define LED_2_BANK 1
+#define LED_2_PIN 19
+
+#define LED_3_BANK 1
+#define LED_3_PIN 20
+
+#endif /* !SITL */
+
+#endif /* AP */
+
+/* ADC */
+/* Definitions for test_adcs.c, to test ADCs on AP ANALOG1 */
+#define ADC_0 AdcBank1(5)
+#define ADC_1 AdcBank1(6)
+#define ADC_2 AdcBank1(7)
+#define ADC_3 AdcBank1(4)
+#define ADC_4 AdcBank1(3)
+#define ADC_5 AdcBank1(2)
+
+
+#endif /* CONFIG_CLASSIX_H */
diff --git a/sw/airborne/boards/lisa_l/baro_board.c b/sw/airborne/boards/lisa_l/baro_board.c
index 0f30dbd2e9..3bf8cc2a20 100644
--- a/sw/airborne/boards/lisa_l/baro_board.c
+++ b/sw/airborne/boards/lisa_l/baro_board.c
@@ -1,5 +1,5 @@
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
struct Baro baro;
struct BaroBoard baro_board;
diff --git a/sw/airborne/boards/lisa_l/baro_board.h b/sw/airborne/boards/lisa_l/baro_board.h
index 017d41a99b..f6c59fd3c7 100644
--- a/sw/airborne/boards/lisa_l/baro_board.h
+++ b/sw/airborne/boards/lisa_l/baro_board.h
@@ -8,7 +8,7 @@
#define BOARDS_LISA_L_BARO_H
#include "std.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
enum LisaBaroStatus {
LBS_UNINITIALIZED,
diff --git a/sw/airborne/boards/lisa_l/test_baro.c b/sw/airborne/boards/lisa_l/test_baro.c
index dcd8122dd6..20e9dbef66 100644
--- a/sw/airborne/boards/lisa_l/test_baro.c
+++ b/sw/airborne/boards/lisa_l/test_baro.c
@@ -34,7 +34,7 @@
#include "downlink.h"
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
//#include "my_debug_servo.h"
static inline void main_init( void );
diff --git a/sw/airborne/boards/lisa_l_1.0.h b/sw/airborne/boards/lisa_l_1.0.h
index 417fd309f0..8724588595 100644
--- a/sw/airborne/boards/lisa_l_1.0.h
+++ b/sw/airborne/boards/lisa_l_1.0.h
@@ -20,8 +20,9 @@
#define IMU_ACC_DRDY_GPIO_PORTSOURCE GPIO_PortSourceGPIOD
-#define ADC_CHANNEL_VSUPPLY 4
-#define DefaultVoltageOfAdc(adc) (0.01787109375*adc)
+#define ADC_CHANNEL_VSUPPLY 2
+#define DefaultVoltageOfAdc(adc) (0.0059*adc)
+#define BOARD_HAS_BARO
#endif /* CONFIG_LISA_V1_0_H */
diff --git a/sw/airborne/boards/pc/baro_board.c b/sw/airborne/boards/pc/baro_board.c
index dd87d54ffa..52f3cb19fe 100644
--- a/sw/airborne/boards/pc/baro_board.c
+++ b/sw/airborne/boards/pc/baro_board.c
@@ -1,6 +1,6 @@
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
struct Baro baro;
diff --git a/sw/airborne/boards/tiny_1.1.h b/sw/airborne/boards/tiny_1.1.h
index 19c9ac0113..9f0d40070e 100644
--- a/sw/airborne/boards/tiny_1.1.h
+++ b/sw/airborne/boards/tiny_1.1.h
@@ -123,10 +123,7 @@
#endif
#define USE_AD1_6
-
-#ifndef VoltageOfAdc
-#define VoltageOfAdc(adc) (0.01787109375*adc)
-#endif
+#define DefaultVoltageOfAdc(adc) (0.01787109375*adc)
#define SPI_SELECT_SLAVE0_PORT 0
#define SPI_SELECT_SLAVE0_PIN 20
diff --git a/sw/airborne/booz/arch/lpc21/booz2_analog_hw.c b/sw/airborne/booz/arch/lpc21/booz2_analog_hw.c
index 8c1f2a68c7..a991d3e3ed 100644
--- a/sw/airborne/booz/arch/lpc21/booz2_analog_hw.c
+++ b/sw/airborne/booz/arch/lpc21/booz2_analog_hw.c
@@ -24,7 +24,7 @@
#include "booz2_analog.h"
/* analog_arch includes baro ??? naaaa we don't want double references */
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
#include "firmwares/rotorcraft/battery.h"
#ifndef USE_EXTRA_ADC
diff --git a/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c b/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c
index 93912efe1d..5a86889e63 100644
--- a/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c
+++ b/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c
@@ -21,8 +21,8 @@
* Boston, MA 02111-1307, USA.
*/
-#include "uart.h"
-#include "i2c.h"
+#include "mcu_periph/uart.h"
+//#include "mcu_periph/i2c.h"
void uart0_init( void ) {}
void uart1_init( void ) {}
diff --git a/sw/airborne/booz/booz_gps.h b/sw/airborne/booz/booz_gps.h
index addeb62043..7d30611baf 100644
--- a/sw/airborne/booz/booz_gps.h
+++ b/sw/airborne/booz/booz_gps.h
@@ -26,7 +26,7 @@
#include "std.h"
#include "math/pprz_geodetic_int.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
struct Booz_gps_state {
struct EcefCoor_i ecef_pos; /* pos ECEF in cm */
diff --git a/sw/airborne/booz/test/booz2_test_mc.c b/sw/airborne/booz/test/booz2_test_mc.c
index 51cd5ebcdc..ba755f46ce 100644
--- a/sw/airborne/booz/test/booz2_test_mc.c
+++ b/sw/airborne/booz/test/booz2_test_mc.c
@@ -23,17 +23,16 @@
#include
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "commands.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "firmwares/rotorcraft/actuators.h"
static inline void main_init( void );
@@ -53,7 +52,7 @@ int main( void ) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
uart1_init_tx();
@@ -61,7 +60,7 @@ static inline void main_init( void ) {
i2c_init();
actuators_init();
- int_enable();
+ mcu_int_enable();
}
static inline void main_periodic_task( void ) {
diff --git a/sw/airborne/booz/test/booz2_test_usb.c b/sw/airborne/booz/test/booz2_test_usb.c
index f05f9d0787..c694603709 100644
--- a/sw/airborne/booz/test/booz2_test_usb.c
+++ b/sw/airborne/booz/test/booz2_test_usb.c
@@ -28,7 +28,7 @@
#include "sys_time.h"
#include "led.h"
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/chemotaxis.c b/sw/airborne/chemotaxis.c
index 2de26a4afa..6bc9514c92 100644
--- a/sw/airborne/chemotaxis.c
+++ b/sw/airborne/chemotaxis.c
@@ -2,7 +2,7 @@
#include "generated/airframe.h"
#include "estimator.h"
#include "std.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "generated/flight_plan.h"
#include "ap_downlink.h"
#include "chemo_detect.h"
diff --git a/sw/airborne/csc/csc_adc.c b/sw/airborne/csc/csc_adc.c
index be8f0197cf..d81fa19d8a 100644
--- a/sw/airborne/csc/csc_adc.c
+++ b/sw/airborne/csc/csc_adc.c
@@ -1,12 +1,12 @@
#include "csc_adc.h"
#include "csc_ap_link.h"
#include
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "print.h"
#include "LPC21xx.h"
#include "led.h"
-#include "adc.h"
+#include "mcu_periph/adc.h"
#include ACTUATORS
#include "csc_servos.h"
#include "sys_time.h"
diff --git a/sw/airborne/csc/csc_baro.c b/sw/airborne/csc/csc_baro.c
index e51835f845..ed6ddf8278 100644
--- a/sw/airborne/csc/csc_baro.c
+++ b/sw/airborne/csc/csc_baro.c
@@ -10,7 +10,7 @@
#include "csc_booz2_ins.h"
#include "csc_ap_link.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi_arch.h"
#include "csc_baro.h"
diff --git a/sw/airborne/csc/csc_main.c b/sw/airborne/csc/csc_main.c
index 1bae760ee7..90474cd2fc 100644
--- a/sw/airborne/csc/csc_main.c
+++ b/sw/airborne/csc/csc_main.c
@@ -28,11 +28,11 @@
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
#include "interrupt_hw.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "csc_telemetry.h"
#include "generated/periodic.h"
#include "downlink.h"
@@ -66,7 +66,7 @@ struct NedCoor_i booz_ins_gps_speed_cm_s_ned;
static void csc_main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
@@ -100,7 +100,7 @@ static void csc_main_init( void ) {
#ifdef USE_CSC_THROTTLE
csc_throttle_init();
#endif
- int_enable();
+ mcu_int_enable();
}
diff --git a/sw/airborne/csc/csc_protocol.c b/sw/airborne/csc/csc_protocol.c
index 2ff5b7ee21..f3167c7c20 100644
--- a/sw/airborne/csc/csc_protocol.c
+++ b/sw/airborne/csc/csc_protocol.c
@@ -26,7 +26,7 @@
#include
#include "csc_protocol.h"
-#include "can.h"
+#include "mcu_periph/can.h"
#include "csc_msg_def.h"
// #include "init_hw.h"
diff --git a/sw/airborne/csc/csc_throttle.c b/sw/airborne/csc/csc_throttle.c
index 20cbfcb3cf..008a269fe4 100644
--- a/sw/airborne/csc/csc_throttle.c
+++ b/sw/airborne/csc/csc_throttle.c
@@ -31,7 +31,7 @@
//#include "downlink.h"
//#include "messages.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "csc_ap_link.h"
//#include "print.h"
//#include "com_stats.h"
diff --git a/sw/airborne/estimator.c b/sw/airborne/estimator.c
index 589f558238..4cc3220602 100644
--- a/sw/airborne/estimator.c
+++ b/sw/airborne/estimator.c
@@ -1,7 +1,7 @@
/*
* Paparazzi autopilot $Id$
*
- * Copyright (C) 2004-2005 Pascal Brisset, Antoine Drouin
+ * Copyright (C) 2004-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -30,10 +30,10 @@
#include
#include "estimator.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "ap_downlink.h"
#include "gps.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#ifdef EXTRA_DOWNLINK_DEVICE
#include "core/extra_pprz_dl.h"
#endif
@@ -233,3 +233,26 @@ void estimator_update_state_gps( void ) {
DOWNLINK_SEND_ATTITUDE(ExtraPprzTransport,&estimator_phi,&estimator_psi,&estimator_theta);
#endif
}
+
+#include "subsystems/sensors/infrared.h"
+void estimator_update_state_infrared( void ) {
+ estimator_phi = atan2(infrared.roll, infrared.top) - infrared.roll_neutral;
+
+ estimator_theta = atan2(infrared.pitch, infrared.top) - infrared.pitch_neutral;
+
+ if (estimator_theta < -M_PI_2)
+ estimator_theta += M_PI;
+ else if (estimator_theta > M_PI_2)
+ estimator_theta -= M_PI;
+
+ if (estimator_phi >= 0)
+ estimator_phi *= infrared.correction_right;
+ else
+ estimator_phi *= infrared.correction_left;
+
+ if (estimator_theta >= 0)
+ estimator_theta *= infrared.correction_up;
+ else
+ estimator_theta *= infrared.correction_down;
+
+}
diff --git a/sw/airborne/estimator.h b/sw/airborne/estimator.h
index c221d6a463..a26e5cdc89 100644
--- a/sw/airborne/estimator.h
+++ b/sw/airborne/estimator.h
@@ -127,4 +127,6 @@ extern void alt_kalman( float );
#define EstimatorSetRate(p, q) { estimator_p = p; estimator_q = q; }
+extern void estimator_update_state_infrared( void );
+
#endif /* ESTIMATOR_H */
diff --git a/sw/airborne/fbw_downlink.h b/sw/airborne/fbw_downlink.h
index d4280f8e4d..61fe9228bb 100644
--- a/sw/airborne/fbw_downlink.h
+++ b/sw/airborne/fbw_downlink.h
@@ -42,9 +42,10 @@
#include "commands.h"
#include "actuators.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "firmwares/fixedwing/main_fbw.h"
#include "subsystems/radio_control.h"
+#include "subsystems/electrical.h"
#include "inter_mcu.h"
#define DOWNLINK_DEVICE DOWNLINK_FBW_DEVICE
@@ -53,7 +54,7 @@
#define PERIODIC_SEND_COMMANDS(_chan) DOWNLINK_SEND_COMMANDS(_chan, COMMANDS_NB, commands)
#ifdef RADIO_CONTROL
-#define PERIODIC_SEND_FBW_STATUS(_chan) DOWNLINK_SEND_FBW_STATUS(_chan, &(radio_control.status), &(radio_control.frame_rate), &fbw_mode, &fbw_vsupply_decivolt, &fbw_current_milliamp)
+#define PERIODIC_SEND_FBW_STATUS(_chan) DOWNLINK_SEND_FBW_STATUS(_chan, &(radio_control.status), &(radio_control.frame_rate), &fbw_mode, &electrical.vsupply, &electrical.current)
#ifdef RADIO_CONTROL_TYPE_PPM
#define PERIODIC_SEND_PPM(_chan) DOWNLINK_SEND_PPM(_chan, &(radio_control.frame_rate), PPM_NB_CHANNEL, ppm_pulses)
#else
@@ -61,7 +62,7 @@
#endif
#define PERIODIC_SEND_RC(_chan) DOWNLINK_SEND_RC(_chan, RADIO_CONTROL_NB_CHANNEL, radio_control.values)
#else // RADIO_CONTROL
-#define PERIODIC_SEND_FBW_STATUS(_chan) { uint8_t dummy = 0; DOWNLINK_SEND_FBW_STATUS(_chan, &dummy, &dummy, &fbw_mode, &fbw_vsupply_decivolt, &fbw_current_milliamp); }
+#define PERIODIC_SEND_FBW_STATUS(_chan) { uint8_t dummy = 0; DOWNLINK_SEND_FBW_STATUS(_chan, &dummy, &dummy, &fbw_mode, &electrical.vsupply, &electrical.current); }
#define PERIODIC_SEND_PPM(_chan) {}
#define PERIODIC_SEND_RC(_chan) {}
#endif // RADIO_CONTROL
diff --git a/sw/airborne/firmwares/beth/bench_sensors.h b/sw/airborne/firmwares/beth/bench_sensors.h
index de655ad046..9d3df4a776 100644
--- a/sw/airborne/firmwares/beth/bench_sensors.h
+++ b/sw/airborne/firmwares/beth/bench_sensors.h
@@ -8,9 +8,7 @@
#endif
#ifdef USE_CAN1
-#include "can.h"
-#include "can_hw.h"
-#include
+#include "mcu_periph/can.h"
extern uint16_t can_err_flags;
#endif
diff --git a/sw/airborne/firmwares/beth/bench_sensors_can.c b/sw/airborne/firmwares/beth/bench_sensors_can.c
index 597f798151..ada5ccfca7 100644
--- a/sw/airborne/firmwares/beth/bench_sensors_can.c
+++ b/sw/airborne/firmwares/beth/bench_sensors_can.c
@@ -1,5 +1,5 @@
#include "bench_sensors.h"
-#include "can.h"
+#include "mcu_periph/can.h"
#include "led.h"
//uint16_t halfw1,halfw2,halfw3,halfw4;
diff --git a/sw/airborne/firmwares/beth/main_coders.c b/sw/airborne/firmwares/beth/main_coders.c
index 2e927c02ab..31e873270d 100644
--- a/sw/airborne/firmwares/beth/main_coders.c
+++ b/sw/airborne/firmwares/beth/main_coders.c
@@ -1,6 +1,6 @@
#include BOARD_CONFIG
#include "init_hw.h"
-#include "can.h"
+#include "mcu_periph/can.h"
#include "sys_time.h"
#include "downlink.h"
diff --git a/sw/airborne/firmwares/beth/main_stm32.c b/sw/airborne/firmwares/beth/main_stm32.c
index e34bf8518e..bec7f05419 100644
--- a/sw/airborne/firmwares/beth/main_stm32.c
+++ b/sw/airborne/firmwares/beth/main_stm32.c
@@ -24,8 +24,8 @@
#include BOARD_CONFIG
#include "std.h"
-#include "init_hw.h"
-#include "can.h"
+#include "mcu.h"
+#include "mcu_periph/can.h"
#include "sys_time.h"
#include "downlink.h"
#include "booz/booz2_commands.h"
@@ -61,7 +61,7 @@ int main(void) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
actuators_init();
//radio_control_init();
diff --git a/sw/airborne/firmwares/beth/rcv_telemetry.c b/sw/airborne/firmwares/beth/rcv_telemetry.c
index 22d14f6015..904932f7de 100755
--- a/sw/airborne/firmwares/beth/rcv_telemetry.c
+++ b/sw/airborne/firmwares/beth/rcv_telemetry.c
@@ -36,7 +36,7 @@
#include "generated/modules.h"
#include
-#include "common_nav.h"
+#include "subsystems/navigation/common_nav.h"
#include "generated/settings.h"
#include "latlong.h"
diff --git a/sw/airborne/datalink.c b/sw/airborne/firmwares/fixedwing/datalink.c
similarity index 95%
rename from sw/airborne/datalink.c
rename to sw/airborne/firmwares/fixedwing/datalink.c
index 86aa3b7c62..89e9c735b7 100644
--- a/sw/airborne/datalink.c
+++ b/sw/airborne/firmwares/fixedwing/datalink.c
@@ -36,7 +36,7 @@
#include "generated/modules.h"
#ifdef TRAFFIC_INFO
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
#endif // TRAFFIC_INFO
#if defined NAV || defined WIND_INFO
@@ -48,7 +48,7 @@
#endif
#ifdef USE_USB_SERIAL
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#endif
#ifdef HITL
@@ -56,7 +56,7 @@
#endif
-#include "nav.h"
+#include "subsystems/navigation/common_nav.h"
#include "generated/settings.h"
#include "latlong.h"
@@ -64,7 +64,7 @@
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "downlink.h"
#include "ap_downlink.h"
@@ -150,9 +150,9 @@ void dl_parse_msg(void) {
/** Infrared and GPS sensors are replaced by messages on the datalink */
if (msg_id == DL_HITL_INFRARED) {
/** This code simulates infrared.c:ir_update() */
- ir_roll = DL_HITL_INFRARED_roll(dl_buffer);
- ir_pitch = DL_HITL_INFRARED_pitch(dl_buffer);
- ir_top = DL_HITL_INFRARED_top(dl_buffer);
+ infrared.roll = DL_HITL_INFRARED_roll(dl_buffer);
+ infrared.pitch = DL_HITL_INFRARED_pitch(dl_buffer);
+ infrared.top = DL_HITL_INFRARED_top(dl_buffer);
} else if (msg_id == DL_HITL_UBX) {
/** This code simulates gps_ubx.c:parse_ubx() */
if (gps_msg_received) {
diff --git a/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c b/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c
index 962089d78e..6d27c606a0 100644
--- a/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c
+++ b/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c
@@ -30,7 +30,7 @@
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "estimator.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "generated/airframe.h"
#include "firmwares/fixedwing/autopilot.h"
diff --git a/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c b/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c
index 66b382041d..839a0da20b 100644
--- a/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c
+++ b/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c
@@ -31,7 +31,7 @@
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "firmwares/fixedwing/guidance/guidance_v_n.h"
#include "estimator.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "generated/airframe.h"
#include "firmwares/fixedwing/autopilot.h"
diff --git a/sw/airborne/firmwares/fixedwing/main_ap.c b/sw/airborne/firmwares/fixedwing/main_ap.c
index ace3d94f68..deb1512a6e 100644
--- a/sw/airborne/firmwares/fixedwing/main_ap.c
+++ b/sw/airborne/firmwares/fixedwing/main_ap.c
@@ -34,17 +34,15 @@
#include
#include "firmwares/fixedwing/main_ap.h"
+#include "mcu.h"
-#include "interrupt_hw.h"
-#include "init_hw.h"
-#include "adc.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "gps.h"
-#include "infrared.h"
+#include "subsystems/sensors/infrared.h"
#include "gyro.h"
#include "ap_downlink.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "firmwares/fixedwing/autopilot.h"
#include "estimator.h"
#include "generated/settings.h"
@@ -60,24 +58,20 @@
#include "rc_settings.h"
#endif
-#ifdef LED
-#include "led.h"
-#endif
-#if defined USE_I2C0 || USE_I2C1
-#include "i2c.h"
-#endif
-
-#ifdef USE_SPI
-#include "spi.h"
-#endif
#ifdef TRAFFIC_INFO
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
#endif
-#ifdef USE_USB_SERIAL
-#include "usb_serial.h"
+
+#ifdef USE_ANALOG_IMU
+#include "subsystems/imu.h"
+#include "subsystems/ahrs.h"
+#include "subsystems/ahrs/ahrs_aligner.h"
+#include "subsystems/ahrs/ahrs_float_dcm.h"
+static inline void on_gyro_accel_event( void );
+static inline void on_mag_event( void );
#endif
#if ! defined CATASTROPHIC_BAT_LEVEL && defined LOW_BATTERY
@@ -446,6 +440,12 @@ void periodic_task_ap( void ) {
#error "Only 20 and 60 allowed for CONTROL_RATE"
#endif
+#ifdef USE_ANALOG_IMU
+ if (!_20Hz) {
+ imu_periodic();
+ }
+#endif // USE_ANALOG_IMU
+
#if CONTROL_RATE == 20
if (!_20Hz)
#endif
@@ -456,7 +456,7 @@ void periodic_task_ap( void ) {
#endif
#ifdef USE_INFRARED
- ir_update();
+ infrared_update();
estimator_update_state_infrared();
#endif /* USE_INFRARED */
h_ctl_attitude_loop(); /* Set h_ctl_aileron_setpoint & h_ctl_elevator_setpoint */
@@ -480,21 +480,13 @@ void periodic_task_ap( void ) {
void init_ap( void ) {
#ifndef SINGLE_MCU /** init done in main_fbw in single MCU */
- hw_init();
+ mcu_init();
sys_time_init();
-
-#ifdef LED
- led_init();
-#endif
-
-#ifdef ADC
- adc_init();
-#endif
#endif /* SINGLE_MCU */
/************* Sensors initialization ***************/
#ifdef USE_INFRARED
- ir_init();
+ infrared_init();
#endif
#ifdef USE_GYRO
gyro_init();
@@ -502,40 +494,18 @@ void init_ap( void ) {
#ifdef USE_GPS
gps_init();
#endif
-#ifdef USE_UART0
- Uart0Init();
-#endif
-#ifdef USE_UART1
- Uart1Init();
-#endif
-#ifdef USE_UART2
- Uart2Init();
-#endif
-#ifdef USE_UART3
- Uart3Init();
-#endif
-#ifdef USE_USB_SERIAL
- VCOM_init();
-#endif
#ifdef USE_GPIO
GpioInit();
#endif
-#ifdef USE_I2C0
- i2c0_init();
-#endif
-#ifdef USE_I2C1
- i2c1_init();
-#endif
-#ifdef USE_I2C2
- i2c2_init();
+#ifdef USE_ANALOG_IMU
+ imu_init();
+ ahrs_aligner_init();
+ ahrs_init();
#endif
/************* Links initialization ***************/
-#if defined USE_SPI
- spi_init();
-#endif
#if defined MCU_SPI_LINK
link_mcu_init();
#endif
@@ -555,7 +525,7 @@ void init_ap( void ) {
modules_init();
/** - start interrupt task */
- int_enable();
+ mcu_int_enable();
/** wait 0.5s (historical :-) */
sys_time_usleep(500000);
@@ -583,13 +553,16 @@ void init_ap( void ) {
#ifdef TRAFFIC_INFO
traffic_info_init();
#endif
-
}
/*********** EVENT ***********************************************************/
void event_task_ap( void ) {
+#ifdef USE_ANALOG_IMU
+ ImuEvent(on_gyro_accel_event, on_mag_event);
+#endif // USE_ANALOG_IMU
+
#ifdef USE_GPS
#if !(defined HITL) && !(defined UBX_EXTERNAL) /** else comes through the datalink */
if (GpsBuffer()) {
@@ -649,11 +622,7 @@ void event_task_ap( void ) {
#endif /** DATALINK */
#ifdef MCU_SPI_LINK
- if (spi_message_received) {
- /* Got a message on SPI. */
- spi_message_received = FALSE;
link_mcu_event_task();
- }
#endif
if (inter_mcu_received_fbw) {
@@ -664,3 +633,30 @@ void event_task_ap( void ) {
modules_event_task();
} /* event_task_ap() */
+
+#ifdef USE_ANALOG_IMU
+static inline void on_gyro_accel_event( void ) {
+ ImuScaleGyro(imu);
+ ImuScaleAccel(imu);
+ if (ahrs.status == AHRS_UNINIT) {
+ ahrs_aligner_run();
+ if (ahrs_aligner.status == AHRS_ALIGNER_LOCKED)
+ ahrs_align();
+ }
+ else {
+ ahrs_propagate();
+ ahrs_update_accel();
+ ahrs_update_fw_estimator();
+ }
+}
+
+static inline void on_mag_event(void) {
+ /*
+ ImuScaleMag(imu);
+ if (ahrs.status == AHRS_RUNNING) {
+ ahrs_update_mag();
+ ahrs_update_fw_estimator();
+ }
+ */
+}
+#endif // USE_ANALOG_IMU
diff --git a/sw/airborne/firmwares/fixedwing/main_fbw.c b/sw/airborne/firmwares/fixedwing/main_fbw.c
index ed29dab3e6..4db0b1860c 100644
--- a/sw/airborne/firmwares/fixedwing/main_fbw.c
+++ b/sw/airborne/firmwares/fixedwing/main_fbw.c
@@ -1,22 +1,22 @@
/*
* Paparazzi $Id$
*
- * Copyright (C) 2003-2006 Pascal Brisset, Antoine Drouin
+ * Copyright (C) 2003-2010 The Paparazzi Team
*
- * This file is part of paparazzi.
+ * This file is part of Paparazzi.
*
- * paparazzi is free software; you can redistribute it and/or modify
+ * Paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
- * paparazzi is distributed in the hope that it will be useful,
+ * Paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING. If not, write to
+ * along with Paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
@@ -31,52 +31,27 @@
* ( for parameters like the supply )
*/
-#include "firmwares/fixedwing/main_fbw.h"
#include "generated/airframe.h"
-#include "init_hw.h"
-#include "interrupt_hw.h"
-#include "led.h"
-#include "uart.h"
-#include "spi.h"
-#include "adc.h"
-
-#ifdef USE_USB_SERIAL
-#include "usb_serial.h"
-#endif
-
+#include "firmwares/fixedwing/main_fbw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "commands.h"
#include "firmwares/fixedwing/actuators.h"
+#include "subsystems/electrical.h"
#include "subsystems/radio_control.h"
-#include "fbw_downlink.h"
#include "firmwares/fixedwing/autopilot.h"
+#include "fbw_downlink.h"
#include "paparazzi.h"
-#include "estimator.h"
#ifdef MCU_SPI_LINK
#include "link_mcu.h"
#endif
#ifdef MILLIAMP_PER_PERCENT
-# warning "deprecated MILLIAMP_PER_PERCENT --> Please use MILLIAMP_AT_FULL_THROTTLE"
+#error "deprecated MILLIAMP_PER_PERCENT --> Please use MILLIAMP_AT_FULL_THROTTLE"
#endif
-#ifdef ADC
-struct adc_buf vsupply_adc_buf;
-#ifndef VoltageOfAdc
-#define VoltageOfAdc(adc) DefaultVoltageOfAdc(adc)
-#endif
-#ifdef ADC_CHANNEL_CURRENT
-struct adc_buf current_adc_buf;
-#ifndef MilliAmpereOfAdc
-#define MilliAmpereOfAdc(adc) DefaultMilliAmpereOfAdc(adc)
-#endif
-#endif
-#endif
-
-uint8_t fbw_vsupply_decivolt;
-int32_t fbw_current_milliamp;
uint8_t fbw_mode;
@@ -84,34 +59,10 @@ uint8_t fbw_mode;
/********** INIT *************************************************************/
void init_fbw( void ) {
- hw_init();
- sys_time_init();
-#ifdef LED
- led_init();
-#endif
-#ifdef USE_UART0
- uart0_init();
-#endif
-#ifdef USE_UART1
- uart1_init();
-#endif
-#ifdef USE_UART2
- uart2_init();
-#endif
-#ifdef USE_UART3
- uart3_init();
-#endif
- // FIXME: remove STM32 flag
-#ifdef ADC
- adc_init();
-#ifndef STM32
- adc_buf_channel(ADC_CHANNEL_VSUPPLY, &vsupply_adc_buf, DEFAULT_AV_NB_SAMPLE);
-# ifdef ADC_CHANNEL_CURRENT
- adc_buf_channel(ADC_CHANNEL_CURRENT, ¤t_adc_buf, DEFAULT_AV_NB_SAMPLE);
-# endif
-#endif /* ! STM32 */
-#endif /* ADC */
+ mcu_init();
+ sys_time_init();
+ electrical_init();
#ifdef ACTUATORS
actuators_init();
@@ -125,14 +76,13 @@ void init_fbw( void ) {
inter_mcu_init();
#endif
#ifdef MCU_SPI_LINK
- spi_init();
link_mcu_restart();
#endif
fbw_mode = FBW_MODE_FAILSAFE;
#ifndef SINGLE_MCU
- int_enable();
+ mcu_int_enable();
#endif
}
@@ -160,14 +110,7 @@ void event_task_fbw( void) {
#ifdef INTER_MCU
#ifdef MCU_SPI_LINK
- if (spi_message_received) {
- /* Got a message on SPI. */
- spi_message_received = FALSE;
-
- /* Sets link_mcu_received */
- /* Sets inter_mcu_received_ap if checksum is ok */
link_mcu_event_task();
- }
#endif /* MCU_SPI_LINK */
@@ -226,20 +169,8 @@ void periodic_task_fbw( void ) {
fbw_downlink_periodic_task();
#endif
- if (!_10Hz)
- {
-#ifdef ADC
- fbw_vsupply_decivolt = VoltageOfAdc((10*(vsupply_adc_buf.sum/vsupply_adc_buf.av_nb_sample)));
-# ifdef ADC_CHANNEL_CURRENT
- fbw_current_milliamp = MilliAmpereOfAdc((current_adc_buf.sum/current_adc_buf.av_nb_sample));
-# endif
-#endif
-
-#if ((! defined ADC_CHANNEL_CURRENT) && defined MILLIAMP_AT_FULL_THROTTLE)
-#ifdef COMMAND_THROTTLE
- fbw_current_milliamp = Min(((float)commands[COMMAND_THROTTLE]) * ((float)MILLIAMP_AT_FULL_THROTTLE) / ((float)MAX_PPRZ), 65000);
-#endif
-# endif
+ if (!_10Hz) {
+ electrical_periodic();
}
#ifdef ACTUATORS
diff --git a/sw/airborne/firmwares/fixedwing/main_fbw.h b/sw/airborne/firmwares/fixedwing/main_fbw.h
index d21aa0e451..729a38a1ee 100644
--- a/sw/airborne/firmwares/fixedwing/main_fbw.h
+++ b/sw/airborne/firmwares/fixedwing/main_fbw.h
@@ -31,7 +31,6 @@
#define FBW_H
#include "std.h"
-#include "adc.h"
/** Fly by wire modes */
#define FBW_MODE_MANUAL 0
@@ -40,8 +39,6 @@
#define FBW_MODE_OF_PPRZ(mode) ((mode) < TRESHOLD_MANUAL_PPRZ ? FBW_MODE_MANUAL : FBW_MODE_AUTO)
extern uint8_t fbw_mode;
-extern uint8_t fbw_vsupply_decivolt;
-extern int32_t fbw_current_milliamp;
extern bool_t failsafe_mode;
void init_fbw( void );
diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c
index 0594546b02..4b138cd8b0 100644
--- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c
+++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c
@@ -33,7 +33,7 @@
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/stabilization/stabilization_adaptive.h"
#include "estimator.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "generated/airframe.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "firmwares/fixedwing/autopilot.h"
diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c
index de18d02c61..d779ed7cf5 100644
--- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c
+++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c
@@ -32,7 +32,7 @@
#include "std.h"
#include "led.h"
#include "estimator.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "generated/airframe.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "firmwares/fixedwing/autopilot.h"
diff --git a/sw/airborne/firmwares/logger/main_logger.c b/sw/airborne/firmwares/logger/main_logger.c
index 8f5adf2df1..69a104dde1 100644
--- a/sw/airborne/firmwares/logger/main_logger.c
+++ b/sw/airborne/firmwares/logger/main_logger.c
@@ -78,12 +78,10 @@
*/
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
+#include "mcu_periph/uart.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
-#include "uart_hw.h"
-#include "uart.h"
#include "usb_msc_hw.h"
@@ -513,17 +511,10 @@ int main(void)
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
-#ifdef USE_UART0
- Uart0Init();
-#endif
-#ifdef USE_UART1
- Uart1Init();
-#endif
-
#ifdef USE_MAX11040
max11040_init_ssp();
max11040_init();
diff --git a/sw/airborne/firmwares/motor_bench/main_motor_bench.c b/sw/airborne/firmwares/motor_bench/main_motor_bench.c
index 152fc6f1d3..93c902282f 100644
--- a/sw/airborne/firmwares/motor_bench/main_motor_bench.c
+++ b/sw/airborne/firmwares/motor_bench/main_motor_bench.c
@@ -1,9 +1,8 @@
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
#include "mb_tacho.h"
#include "mb_servo.h"
#include "i2c.h"
@@ -13,13 +12,12 @@
#include "mb_scale.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "generated/settings.h"
-#include "adc.h"
#include "mb_modes.h"
//#include "mb_static.h"
@@ -42,7 +40,7 @@ int main( void ) {
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
led_init();
sys_time_init();
mb_tacho_init();
@@ -55,14 +53,13 @@ static inline void main_init( void ) {
mb_servo_init();
mb_servo_set_range( 1090000, 1910000 );
- adc_init();
mb_current_init();
mb_scale_init();
uart0_init();
mb_mode_init();
- int_enable();
+ mcu_int_enable();
}
static inline void main_periodic_task( void ) {
diff --git a/sw/airborne/firmwares/motor_bench/main_turntable.c b/sw/airborne/firmwares/motor_bench/main_turntable.c
index b4382be154..d170077efc 100644
--- a/sw/airborne/firmwares/motor_bench/main_turntable.c
+++ b/sw/airborne/firmwares/motor_bench/main_turntable.c
@@ -3,7 +3,7 @@
#include "sys_time.h"
#include "led.h"
#include "interrupt_hw.h"
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/firmwares/motor_bench/mb_current.c b/sw/airborne/firmwares/motor_bench/mb_current.c
index 5e3046cde4..2089e9f814 100644
--- a/sw/airborne/firmwares/motor_bench/mb_current.c
+++ b/sw/airborne/firmwares/motor_bench/mb_current.c
@@ -1,6 +1,6 @@
#include "mb_current.h"
-#include "adc.h"
+#include "mcu_periph/adc.h"
static struct adc_buf mb_current_buf;
diff --git a/sw/airborne/firmwares/motor_bench/mb_modes.c b/sw/airborne/firmwares/motor_bench/mb_modes.c
index 920f07c763..650736de0e 100644
--- a/sw/airborne/firmwares/motor_bench/mb_modes.c
+++ b/sw/airborne/firmwares/motor_bench/mb_modes.c
@@ -2,7 +2,7 @@
//#include "mb_static.h"
-#include "adc.h"
+#include "mcu_periph/adc.h"
#include "sys_time.h"
diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c
index be043b9669..ae69747ecc 100644
--- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c
+++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c
@@ -1,12 +1,12 @@
#include "firmwares/rotorcraft/actuators.h"
-#include "actuators_asctec.h"
+#include "firmwares/rotorcraft/actuators/actuators_asctec.h"
#ifdef ACTUATORS_ASCTEC_V2_PROTOCOL
#include "firmwares/rotorcraft/actuators/supervision.h"
#endif
#include "booz/booz2_commands.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "sys_time.h"
diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h
index a82e4ef968..9b9dc58916 100644
--- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h
+++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h
@@ -24,7 +24,7 @@
#ifndef ACTUATORS_ASCTEC_H
#define ACTUATORS_ASCTEC_H
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
enum actuators_astec_cmd { NONE,
TEST,
diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c
index e86651621e..90bb98f8f9 100644
--- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c
+++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c
@@ -22,10 +22,10 @@
*/
#include "firmwares/rotorcraft/actuators.h"
-#include "actuators_mkk.h"
+#include "firmwares/rotorcraft/actuators/actuators_mkk.h"
#include "booz/booz2_commands.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "sys_time.h"
diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h
index 8b6d821098..77b36eb980 100644
--- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h
+++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h
@@ -25,7 +25,7 @@
#define ACTUATORS_MKK_H
#include "std.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "generated/airframe.h"
diff --git a/sw/airborne/booz/booz2_datalink.c b/sw/airborne/firmwares/rotorcraft/datalink.c
similarity index 99%
rename from sw/airborne/booz/booz2_datalink.c
rename to sw/airborne/firmwares/rotorcraft/datalink.c
index 2fae20a594..adb77a1825 100644
--- a/sw/airborne/booz/booz2_datalink.c
+++ b/sw/airborne/firmwares/rotorcraft/datalink.c
@@ -32,7 +32,7 @@
#include "downlink.h"
#include "messages.h"
#include "dl_protocol.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#ifdef BOOZ_FMS_TYPE
#include "booz_fms.h"
diff --git a/sw/airborne/firmwares/rotorcraft/main.c b/sw/airborne/firmwares/rotorcraft/main.c
index 5f6cd5485d..9c5b87f70c 100644
--- a/sw/airborne/firmwares/rotorcraft/main.c
+++ b/sw/airborne/firmwares/rotorcraft/main.c
@@ -25,10 +25,9 @@
#define MODULES_C
#include
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
#include "downlink.h"
#include "firmwares/rotorcraft/telemetry.h"
@@ -42,7 +41,7 @@
#include "booz_gps.h"
#include "booz/booz2_analog.h"
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
#include "firmwares/rotorcraft/battery.h"
@@ -95,7 +94,7 @@ STATIC_INLINE void main_init( void ) {
}
#endif
- hw_init();
+ mcu_init();
sys_time_init();
@@ -130,7 +129,7 @@ STATIC_INLINE void main_init( void ) {
modules_init();
- int_enable();
+ mcu_int_enable();
}
@@ -144,33 +143,32 @@ STATIC_INLINE void main_periodic( void ) {
/* set actuators */
actuators_set(autopilot_motors_on);
- PeriodicPrescaleBy10( \
- { \
- radio_control_periodic_task(); \
- if (radio_control.status != RC_OK && \
- autopilot_mode != AP_MODE_KILL && \
- autopilot_mode != AP_MODE_NAV) \
- autopilot_set_mode(AP_MODE_FAILSAFE); \
- }, \
- { \
- /* booz_fms_periodic(); FIXME */ \
- }, \
- { \
- /*BoozControlSurfacesSetFromCommands();*/ \
- }, \
- { \
- LED_PERIODIC(); \
- }, \
- { baro_periodic();
- }, \
- {}, \
- {}, \
- {}, \
- {}, \
- { \
- Booz2TelemetryPeriodic(); \
- } \
- ); \
+ PeriodicPrescaleBy10( \
+ { \
+ radio_control_periodic_task(); \
+ if (radio_control.status != RC_OK && \
+ autopilot_mode != AP_MODE_KILL && \
+ autopilot_mode != AP_MODE_NAV) \
+ autopilot_set_mode(AP_MODE_FAILSAFE); \
+ }, \
+ { \
+ /* booz_fms_periodic(); FIXME */ \
+ }, \
+ { \
+ /*BoozControlSurfacesSetFromCommands();*/ \
+ }, \
+ { \
+ LED_PERIODIC(); \
+ }, \
+ { baro_periodic(); \
+ }, \
+ {}, \
+ {}, \
+ {}, \
+ {}, \
+ { \
+ Booz2TelemetryPeriodic(); \
+ } );
#ifdef USE_GPS
if (radio_control.status != RC_OK && \
diff --git a/sw/airborne/firmwares/rotorcraft/main.h b/sw/airborne/firmwares/rotorcraft/main.h
index 7bf6d26716..9e9a651b53 100644
--- a/sw/airborne/firmwares/rotorcraft/main.h
+++ b/sw/airborne/firmwares/rotorcraft/main.h
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * Copyright (C) 2008-2009 Antoine Drouin
+ * Copyright (C) 2008-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
diff --git a/sw/airborne/firmwares/rotorcraft/navigation.c b/sw/airborne/firmwares/rotorcraft/navigation.c
index b742b5da7a..463927fe1e 100644
--- a/sw/airborne/firmwares/rotorcraft/navigation.c
+++ b/sw/airborne/firmwares/rotorcraft/navigation.c
@@ -306,7 +306,7 @@ void nav_periodic_task() {
#include "downlink.h"
#include "messages.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
void nav_move_waypoint(uint8_t wp_id, struct EnuCoor_i * new_pos) {
if (wp_id < nb_waypoint) {
INT32_VECT3_COPY(waypoints[wp_id],(*new_pos));
diff --git a/sw/airborne/firmwares/rotorcraft/telemetry.h b/sw/airborne/firmwares/rotorcraft/telemetry.h
index fddcc79b98..1cf5801b80 100644
--- a/sw/airborne/firmwares/rotorcraft/telemetry.h
+++ b/sw/airborne/firmwares/rotorcraft/telemetry.h
@@ -26,7 +26,7 @@
#include "std.h"
#include "messages.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "downlink.h"
@@ -50,8 +50,8 @@
#include "booz_gps.h"
#include "subsystems/ins.h"
#include "subsystems/ahrs.h"
-
-#include "i2c_hw.h"
+//FIXME: wtf ??!!
+#include "mcu_periph/i2c_arch.h"
extern uint8_t telemetry_mode_Main_DefaultChannel;
diff --git a/sw/airborne/firmwares/setup/setup_actuators.c b/sw/airborne/firmwares/setup/setup_actuators.c
index 9c8afa4f32..7404d02b18 100644
--- a/sw/airborne/firmwares/setup/setup_actuators.c
+++ b/sw/airborne/firmwares/setup/setup_actuators.c
@@ -1,6 +1,5 @@
#include "std.h"
-#include "init_hw.h"
-#include "interrupt_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
#include "firmwares/fixedwing/actuators.h"
@@ -8,7 +7,7 @@
#include "generated/airframe.h"
#define DATALINK_C
#include "datalink.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "pprz_transport.h"
#include "firmwares/fixedwing/main_fbw.h"
#include "downlink.h"
@@ -48,7 +47,7 @@ void dl_parse_msg( void ) {
#define PprzUartInit() Link(Init())
void init_fbw( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
@@ -63,7 +62,7 @@ void init_fbw( void ) {
// SetServo(SERVO_GAZ, SERVO_GAZ_MIN);
- int_enable();
+ mcu_int_enable();
}
void periodic_task_fbw(void) {
diff --git a/sw/airborne/firmwares/tutorial/main_demo3.c b/sw/airborne/firmwares/tutorial/main_demo3.c
index e1b2689e34..29ae419e12 100644
--- a/sw/airborne/firmwares/tutorial/main_demo3.c
+++ b/sw/airborne/firmwares/tutorial/main_demo3.c
@@ -1,10 +1,9 @@
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "print.h"
static inline void main_init( void );
diff --git a/sw/airborne/firmwares/tutorial/main_demo4.c b/sw/airborne/firmwares/tutorial/main_demo4.c
index 1eb1e97e85..83352b5faf 100644
--- a/sw/airborne/firmwares/tutorial/main_demo4.c
+++ b/sw/airborne/firmwares/tutorial/main_demo4.c
@@ -1,9 +1,8 @@
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
@@ -21,11 +20,11 @@ int main( void ) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
uart0_init_tx();
- int_enable();
+ mcu_int_enable();
}
static inline void main_periodic_task( void ) {
diff --git a/sw/airborne/firmwares/tutorial/main_demo5.c b/sw/airborne/firmwares/tutorial/main_demo5.c
index 138fe63b0d..5cb2b2c430 100644
--- a/sw/airborne/firmwares/tutorial/main_demo5.c
+++ b/sw/airborne/firmwares/tutorial/main_demo5.c
@@ -1,9 +1,8 @@
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
@@ -25,11 +24,11 @@ int main( void ) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
uart0_init_tx();
- int_enable();
+ mcu_int_enable();
}
static inline void main_periodic_task( void ) {
diff --git a/sw/airborne/firmwares/tutorial/main_demo6.c b/sw/airborne/firmwares/tutorial/main_demo6.c
index 88985c93e7..af9d8f777a 100644
--- a/sw/airborne/firmwares/tutorial/main_demo6.c
+++ b/sw/airborne/firmwares/tutorial/main_demo6.c
@@ -3,7 +3,7 @@
#include "sys_time.h"
#include "led.h"
#include "interrupt_hw.h"
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/firmwares/vor/lpc_vor_main.c b/sw/airborne/firmwares/vor/lpc_vor_main.c
index aa136c3c0f..dd1e2e77d6 100644
--- a/sw/airborne/firmwares/vor/lpc_vor_main.c
+++ b/sw/airborne/firmwares/vor/lpc_vor_main.c
@@ -22,18 +22,18 @@ int main( void ) {
if (vor_adc_sample_available) {
int16_t off_sample = vor_adc_sample - 512;
// off_sample *= 2;
-
+
vor_int_demod_run (off_sample);
-
+
if (vid_qdr_available) {
vid_qdr_available = FALSE;
main_report();
}
-
+
VorDacSet(vor_adc_sample);
vor_adc_sample_available = FALSE;
}
-
+
}
return 0;
}
diff --git a/sw/airborne/gps.c b/sw/airborne/gps.c
index 1f196f9a66..2e56c6b38f 100644
--- a/sw/airborne/gps.c
+++ b/sw/airborne/gps.c
@@ -38,7 +38,7 @@
#include "generated/periodic.h"
#ifdef USE_USB_SERIAL
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#endif
diff --git a/sw/airborne/gps.h b/sw/airborne/gps.h
index 06ffadced9..b6c28317b8 100644
--- a/sw/airborne/gps.h
+++ b/sw/airborne/gps.h
@@ -106,7 +106,7 @@ struct svinfo {
extern struct svinfo gps_svinfos[GPS_NB_CHANNELS];
#ifndef SITL
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define __GpsLink(dev, _x) dev##_x
#define _GpsLink(dev, _x) __GpsLink(dev, _x)
@@ -128,7 +128,7 @@ extern struct svinfo gps_svinfos[GPS_NB_CHANNELS];
#define GpsToggleLed() {}
#endif
-#if defined(GPS) || defined(USE_GPS_XSENS) || defined(SITL)
+#if defined(USE_GPS) || defined(USE_GPS_XSENS) || defined(SITL)
# define GpsTimeoutError (cpu_time_sec - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS)
#else
# define GpsTimeoutError 1
diff --git a/sw/airborne/gps_nmea.c b/sw/airborne/gps_nmea.c
index a8b787551b..6d843b92b6 100644
--- a/sw/airborne/gps_nmea.c
+++ b/sw/airborne/gps_nmea.c
@@ -43,10 +43,9 @@
#include "generated/flight_plan.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "gps.h"
-//include "gps_ubx.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "latlong.h"
@@ -98,8 +97,6 @@ void ubxsend_cfg_rst(uint16_t bbr , uint8_t reset_mode) {
#ifdef GPS_CONFIGURE
/* GPS dynamic configuration */
-#include "uart.h"
-
void gps_configure_uart ( void ) {
//UbxSend_CFG_PRT(0x01, 0x0, 0x0, 0x000008D0, GPS_BAUD, UBX_PROTO_MASK, UBX_PROTO_MASK, 0x0, 0x0);
//while (GpsUartRunning) ; /* FIXME */
diff --git a/sw/airborne/gps_ubx.c b/sw/airborne/gps_ubx.c
index 5a3a5e4192..581a3cb4ce 100644
--- a/sw/airborne/gps_ubx.c
+++ b/sw/airborne/gps_ubx.c
@@ -35,13 +35,13 @@
#include
//for baudrate
#include "fms_serial_port.h"
-#endif
+#endif /* FMS_PERIODIC_FREQ */
#include "generated/flight_plan.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "gps.h"
#include "gps_ubx.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "latlong.h"
#ifdef GPS_TIMESTAMP
@@ -152,7 +152,6 @@ void gps_init( void ) {
#ifdef GPS_CONFIGURE
/* GPS dynamic configuration */
-#include "uart.h"
#ifndef GPS_PORT_ID
#define GPS_PORT_ID GPS_PORT_UART1
diff --git a/sw/airborne/gps_xsens.c b/sw/airborne/gps_xsens.c
index 3aae822ad6..077d2353af 100644
--- a/sw/airborne/gps_xsens.c
+++ b/sw/airborne/gps_xsens.c
@@ -33,7 +33,7 @@
#include "sys_time.h"
#include "generated/airframe.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/gyro.c b/sw/airborne/gyro.c
index 4982ef69cc..b8f6bfa77c 100644
--- a/sw/airborne/gyro.c
+++ b/sw/airborne/gyro.c
@@ -30,7 +30,7 @@
#include BOARD_CONFIG
#include "gyro.h"
#include "std.h"
-#include "adc.h"
+#include "mcu_periph/adc.h"
#include "generated/airframe.h"
#include "estimator.h"
diff --git a/sw/airborne/infrared.h b/sw/airborne/infrared.h
deleted file mode 100644
index 298a70b0cf..0000000000
--- a/sw/airborne/infrared.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Paparazzi mcu0 $Id$
- *
- * Copyright (C) 2003 Pascal Brisset, Antoine Drouin
- *
- * This file is part of paparazzi.
- *
- * paparazzi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * paparazzi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING. If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef INFRARED_H
-#define INFRARED_H
-
-#include "std.h"
-#include "generated/airframe.h"
-
-extern float ir_roll_neutral; /* Rad */
-extern float ir_pitch_neutral; /* Rad */
-
-extern int16_t ir_ir1; /* First horizontal channel */
-extern int16_t ir_ir2; /* Second horizontal channel */
-extern int16_t ir_roll; /* averaged roll adc */
-extern int16_t ir_pitch; /* averaged pitch adc */
-extern int16_t ir_top; /* averaged vertical ir adc */
-
-extern float ir_correction_left;
-extern float ir_correction_right;
-extern float ir_correction_up;
-extern float ir_correction_down;
-
-void ir_init(void);
-void ir_update(void);
-void estimator_update_state_infrared( void );
-
-extern float ir_lateral_correction;
-extern float ir_longitudinal_correction;
-extern float ir_vertical_correction;
-
-
-#endif /* INFRARED_H */
diff --git a/sw/airborne/inter_mcu.h b/sw/airborne/inter_mcu.h
index 2ed669266d..c56355df0d 100644
--- a/sw/airborne/inter_mcu.h
+++ b/sw/airborne/inter_mcu.h
@@ -42,6 +42,7 @@
#include "paparazzi.h"
#include "generated/airframe.h"
#include "subsystems/radio_control.h"
+#include "subsystems/electrical.h"
#include "firmwares/fixedwing/main_fbw.h"
#ifndef SINGLE_MCU
@@ -117,8 +118,8 @@ static inline void inter_mcu_fill_fbw_state (void) {
status |= (fbw_mode == FBW_MODE_FAILSAFE ? _BV(STATUS_MODE_FAILSAFE) : 0);
fbw_state->status = status;
- fbw_state->vsupply = fbw_vsupply_decivolt;
- fbw_state->current = fbw_current_milliamp;
+ fbw_state->vsupply = electrical.vsupply;
+ fbw_state->current = electrical.current;
}
/** Prepares date for next comm with AP. Set ::ap_ok to TRUE */
diff --git a/sw/airborne/link_mcu.c b/sw/airborne/link_mcu.c
index 1bb27affce..ae3122f758 100644
--- a/sw/airborne/link_mcu.c
+++ b/sw/airborne/link_mcu.c
@@ -23,7 +23,7 @@
*/
#include "link_mcu.h"
-#include "spi.h"
+#include "mcu_periph/spi.h"
struct link_mcu_msg link_mcu_from_ap_msg;
struct link_mcu_msg link_mcu_from_fbw_msg;
@@ -57,13 +57,18 @@ void link_mcu_restart(void) {
}
void link_mcu_event_task( void ) {
- /* A message has been received */
- ComputeChecksum(link_mcu_from_ap_msg);
- link_mcu_received = TRUE;
- if (link_mcu_from_ap_msg.checksum == crc)
- inter_mcu_received_ap = TRUE;
- else
- fbw_state->nb_err++;
+ if (spi_message_received) {
+ /* Got a message on SPI. */
+ spi_message_received = FALSE;
+
+ /* A message has been received */
+ ComputeChecksum(link_mcu_from_ap_msg);
+ link_mcu_received = TRUE;
+ if (link_mcu_from_ap_msg.checksum == crc)
+ inter_mcu_received_ap = TRUE;
+ else
+ fbw_state->nb_err++;
+ }
}
#endif /* FBW */
@@ -97,12 +102,16 @@ void link_mcu_send(void) {
}
void link_mcu_event_task( void ) {
- /* A message has been received */
- ComputeChecksum(link_mcu_from_fbw_msg);
- if (link_mcu_from_fbw_msg.checksum == crc)
- inter_mcu_received_fbw = TRUE;
- else
- link_mcu_nb_err++;
+ if (spi_message_received) {
+ /* Got a message on SPI. */
+ spi_message_received = FALSE;
+ /* A message has been received */
+ ComputeChecksum(link_mcu_from_fbw_msg);
+ if (link_mcu_from_fbw_msg.checksum == crc)
+ inter_mcu_received_fbw = TRUE;
+ else
+ link_mcu_nb_err++;
+ }
}
#endif /* AP */
diff --git a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c
index a8fc59c643..5a115a0c74 100644
--- a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c
+++ b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c
@@ -27,7 +27,7 @@
#include "lisa/lisa_overo_link.h"
#include "lisa/lisa_spistream.h"
#include "generated/airframe.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
static inline void main_init(void);
static inline void main_periodic(void);
diff --git a/sw/airborne/lisa/lisa_stm_passthrough_main.c b/sw/airborne/lisa/lisa_stm_passthrough_main.c
index bc468456df..60a3725cd6 100644
--- a/sw/airborne/lisa/lisa_stm_passthrough_main.c
+++ b/sw/airborne/lisa/lisa_stm_passthrough_main.c
@@ -22,7 +22,7 @@
*
*/
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "downlink.h"
#include "booz/booz2_commands.h"
@@ -45,9 +45,9 @@
#include "csc_msg_def.h"
#include "csc_protocol.h"
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
-#include "adc.h"
+#include "mcu_periph/adc.h"
static inline void main_init(void);
static inline void main_periodic(void);
@@ -103,7 +103,7 @@ int main(void) {
static inline void main_init(void) {
- hw_init();
+ mcu_init();
sys_time_init();
imu_init();
baro_init();
@@ -111,7 +111,6 @@ static inline void main_init(void) {
actuators_init();
overo_link_init();
cscp_init();
- adc_init();
#ifdef PASSTHROUGH_CYGNUS
autopilot_init();
diff --git a/sw/airborne/lisa/test/hs_gyro.c b/sw/airborne/lisa/test/hs_gyro.c
index c95e033358..e82e1dd4be 100644
--- a/sw/airborne/lisa/test/hs_gyro.c
+++ b/sw/airborne/lisa/test/hs_gyro.c
@@ -24,16 +24,15 @@
#include
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "subsystems/imu.h"
-#include "interrupt_hw.h"
#ifndef MEASURED_SENSOR
#define MEASURED_SENSOR gyro_unscaled.p
@@ -60,11 +59,11 @@ int main( void ) {
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
imu_init();
- int_enable();
+ mcu_int_enable();
}
static inline void main_periodic_task( void ) {
diff --git a/sw/airborne/lisa/test/lisa_tunnel.c b/sw/airborne/lisa/test/lisa_tunnel.c
index e35a86630d..1a7bec287a 100644
--- a/sw/airborne/lisa/test/lisa_tunnel.c
+++ b/sw/airborne/lisa/test/lisa_tunnel.c
@@ -24,10 +24,10 @@
#include
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
+#include "mcu_periph/uart.h"
#include "sys_time.h"
#include "led.h"
-#include "uart.h"
static inline void main_init( void );
static inline void main_periodic_task( void );
diff --git a/sw/airborne/lisa/test/test_board.c b/sw/airborne/lisa/test/test_board.c
index efb4088ff1..292fb22bca 100644
--- a/sw/airborne/lisa/test/test_board.c
+++ b/sw/airborne/lisa/test/test_board.c
@@ -29,11 +29,11 @@
#include "test_board.h"
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
+#include "mcu_periph/uart.h"
#include "sys_time.h"
#include "downlink.h"
#include "led.h"
-#include "uart.h"
#include "datalink.h"
#include "generated/settings.h"
diff --git a/sw/airborne/lisa/test_adc.c b/sw/airborne/lisa/test_adc.c
index 3f8e00e99a..7132bc90e3 100644
--- a/sw/airborne/lisa/test_adc.c
+++ b/sw/airborne/lisa/test_adc.c
@@ -26,11 +26,10 @@
#include
#include BOARD_CONFIG
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "adc.h"
-#include "adc_hw.h"
+#include "mcu_periph/adc.h"
#include "downlink.h"
int main_periodic(void);
@@ -46,7 +45,7 @@ static struct adc_buf adc3_buf;
extern uint8_t adc_new_data_trigger;
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
adc_init();
adc_buf_channel(0, &adc0_buf, 8);
diff --git a/sw/airborne/lisa/test_servos.c b/sw/airborne/lisa/test_servos.c
index d095c00319..4bf9235b67 100644
--- a/sw/airborne/lisa/test_servos.c
+++ b/sw/airborne/lisa/test_servos.c
@@ -50,6 +50,8 @@ static inline void main_periodic( void ) {
static float foo = 0.;
foo += 0.0025;
int32_t bar = 1500 + 500. * sin(foo);
+ // int32_t bar = 1450;
+ // int32_t bar = 1950;
actuators_pwm_values[0] = bar;
actuators_pwm_values[1] = bar;
actuators_pwm_values[2] = bar;
diff --git a/sw/airborne/mcu.c b/sw/airborne/mcu.c
new file mode 100644
index 0000000000..d1f02766d7
--- /dev/null
+++ b/sw/airborne/mcu.c
@@ -0,0 +1,103 @@
+/*
+ * Paparazzi microcontroller initialisation function
+ *
+ * Copyright (C) 2010 The Paparazzi team
+ *
+ * This file is part of Paparazzi.
+ *
+ * Paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * Paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "mcu.h"
+
+#ifdef PERIPHERALS_AUTO_INIT
+#ifdef USE_LED
+#include "led.h"
+#endif
+#if defined RADIO_CONTROL
+#if defined RADIO_CONTROL_LINK || defined RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT
+#include "subsystems/radio_control.h"
+#endif
+#endif
+#if defined USE_UART0 || defined USE_UART1 || defined USE_UART2 || defined USE_UART3 || defined USE_UART4 || defined USE_UART5
+#include "mcu_periph/uart.h"
+#endif
+#if defined USE_I2C0 || defined USE_I2C1 || defined USE_I2C2
+#include "mcu_periph/i2c.h"
+#endif
+#if defined USE_ADC
+#include "mcu_periph/adc.h"
+#endif
+#ifdef USE_USB_SERIAL
+#include "mcu_periph/usb_serial.h"
+#endif
+#ifdef USE_SPI
+#include "mcu_periph/spi.h"
+#endif
+#endif /* PERIPHERALS_AUTO_INIT */
+
+void mcu_init(void) {
+
+ mcu_arch_init();
+
+#ifdef PERIPHERALS_AUTO_INIT
+#ifdef USE_LED
+ led_init();
+#endif
+ /* for now this means using spektrum */
+#if defined RADIO_CONTROL & defined RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT & defined RADIO_CONTROL_BIND_IMPL_FUNC
+ RADIO_CONTROL_BIND_IMPL_FUNC();
+#endif
+#ifdef USE_UART0
+ uart0_init();
+#endif
+#ifdef USE_UART1
+ uart1_init();
+#endif
+#ifdef USE_UART2
+ uart2_init();
+#endif
+#ifdef USE_UART3
+ uart3_init();
+#endif
+#ifdef USE_UART4
+ uart4_init();
+#endif
+#ifdef USE_UART5
+ uart5_init();
+#endif
+#ifdef USE_I2C0
+ i2c0_init();
+#endif
+#ifdef USE_I2C1
+ i2c1_init();
+#endif
+#ifdef USE_I2C2
+ i2c2_init();
+#endif
+#ifdef USE_ADC
+ adc_init();
+#endif
+#ifdef USE_USB_SERIAL
+ VCOM_init();
+#endif
+#ifdef USE_SPI
+ spi_init();
+#endif
+#endif /* PERIPHERALS_AUTO_INIT */
+
+}
diff --git a/sw/airborne/mcu.h b/sw/airborne/mcu.h
new file mode 100644
index 0000000000..0372433374
--- /dev/null
+++ b/sw/airborne/mcu.h
@@ -0,0 +1,45 @@
+/*
+ * Paparazzi microcontroller functions
+ *
+ * Copyright (C) 2010 The Paparazzi team
+ *
+ * This file is part of Paparazzi.
+ *
+ * Paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * Paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+/** \file mcu.h
+ * \brief arch independant mcu ( Micro Controller Unit ) utilities
+ */
+
+#ifndef MCU_H
+#define MCU_H
+
+
+#include
+
+/*
+ * Microcontroller initialisation
+ * This function is responisble for setting up the microcontroller
+ * after Reset.
+ */
+extern void mcu_init(void);
+
+
+#endif /* MCU_H */
+
+
diff --git a/sw/airborne/adc.h b/sw/airborne/mcu_periph/adc.h
similarity index 96%
rename from sw/airborne/adc.h
rename to sw/airborne/mcu_periph/adc.h
index 803b9c5100..bb2f9362c2 100644
--- a/sw/airborne/adc.h
+++ b/sw/airborne/mcu_periph/adc.h
@@ -35,7 +35,7 @@
#define _ADC_H_
#include
-#include "adc_hw.h"
+#include "mcu_periph/adc_arch.h"
/* Allow driver implementation to define
* number of available ADCs implicitly
@@ -58,7 +58,7 @@
See @ref adc_buf_channel.
*/
struct adc_buf {
- uint16_t sum; /* Sum of samples in buffer (avg = sum / av_nb_sample) */
+ uint32_t sum; /* Sum of samples in buffer (avg = sum / av_nb_sample) */
uint16_t values[MAX_AV_NB_SAMPLE]; /* Buffer for sample values from ADC */
uint8_t head; /* Position index of write head in buffer */
uint8_t av_nb_sample; /* Number of samples to use in buffer (used for avg) */
diff --git a/sw/airborne/can.c b/sw/airborne/mcu_periph/can.c
similarity index 95%
rename from sw/airborne/can.c
rename to sw/airborne/mcu_periph/can.c
index a40c2e54f9..2087eceb77 100644
--- a/sw/airborne/can.c
+++ b/sw/airborne/mcu_periph/can.c
@@ -24,8 +24,8 @@
#include
-#include "can.h"
-#include "can_hw.h"
+#include "mcu_periph/can.h"
+#include "mcu_periph/can_arch.h"
can_rx_callback_t can_rx_callback;
diff --git a/sw/airborne/can.h b/sw/airborne/mcu_periph/can.h
similarity index 100%
rename from sw/airborne/can.h
rename to sw/airborne/mcu_periph/can.h
diff --git a/sw/airborne/i2c.c b/sw/airborne/mcu_periph/i2c.c
similarity index 94%
rename from sw/airborne/i2c.c
rename to sw/airborne/mcu_periph/i2c.c
index 9036dc8004..0249105d36 100644
--- a/sw/airborne/i2c.c
+++ b/sw/airborne/mcu_periph/i2c.c
@@ -1,4 +1,4 @@
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#ifdef USE_I2C0
diff --git a/sw/airborne/i2c.h b/sw/airborne/mcu_periph/i2c.h
similarity index 97%
rename from sw/airborne/i2c.h
rename to sw/airborne/mcu_periph/i2c.h
index 52150b097e..6c6b400682 100644
--- a/sw/airborne/i2c.h
+++ b/sw/airborne/mcu_periph/i2c.h
@@ -1,9 +1,9 @@
-#ifndef I2C_H
-#define I2C_H
+#ifndef MCU_PERIPH_I2C_H
+#define MCU_PERIPH_I2C_H
#include "std.h"
-#include "i2c_hw.h"
+#include "mcu_periph/i2c_arch.h"
enum I2CTransactionType {
I2CTransTx,
diff --git a/sw/airborne/spi.c b/sw/airborne/mcu_periph/spi.c
similarity index 97%
rename from sw/airborne/spi.c
rename to sw/airborne/mcu_periph/spi.c
index 5ca6193333..2451ed7e79 100644
--- a/sw/airborne/spi.c
+++ b/sw/airborne/mcu_periph/spi.c
@@ -23,7 +23,7 @@
*/
#include "std.h"
-#include "spi.h"
+#include "mcu_periph/spi.h"
uint8_t* spi_buffer_input;
uint8_t* spi_buffer_output;
diff --git a/sw/airborne/spi.h b/sw/airborne/mcu_periph/spi.h
similarity index 96%
rename from sw/airborne/spi.h
rename to sw/airborne/mcu_periph/spi.h
index dd6b0fe8f9..9cdd614a4b 100644
--- a/sw/airborne/spi.h
+++ b/sw/airborne/mcu_periph/spi.h
@@ -22,7 +22,7 @@
*
*/
-/** \file spi.h
+/** \file mcu_periph/spi.h
* \brief arch independant SPI (Serial Peripheral Interface) API */
@@ -32,7 +32,7 @@
#ifdef USE_SPI
#include "std.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi_arch.h"
extern uint8_t* spi_buffer_input;
extern uint8_t* spi_buffer_output;
diff --git a/sw/airborne/uart.h b/sw/airborne/mcu_periph/uart.h
similarity index 94%
rename from sw/airborne/uart.h
rename to sw/airborne/mcu_periph/uart.h
index 03e043ae5f..32bc3588d2 100644
--- a/sw/airborne/uart.h
+++ b/sw/airborne/mcu_periph/uart.h
@@ -1,7 +1,7 @@
/*
* Paparazzi $Id$
*
- * Copyright (C) 2006 Pascal Brisset, Antoine Drouin
+ * Copyright (C) 2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -22,15 +22,15 @@
*
*/
-/** \file uart.h
+/** \file mcu_periph/uart.h
* \brief arch independant UART (Universal Asynchronous Receiver/Transmitter) API
*
*/
-#ifndef UART_H
-#define UART_H
+#ifndef MCU_PERIPH_UART_H
+#define MCU_PERIPH_UART_H
-#include "uart_hw.h"
+#include "mcu_periph/uart_arch.h"
#include "std.h"
@@ -121,4 +121,4 @@ extern bool_t uart3_check_free_space( uint8_t len);
#endif /* USE_UART3 */
-#endif /* UART_H */
+#endif /* MCU_PERIPH_UART_H */
diff --git a/sw/airborne/usb_serial.h b/sw/airborne/mcu_periph/usb_serial.h
similarity index 100%
rename from sw/airborne/usb_serial.h
rename to sw/airborne/mcu_periph/usb_serial.h
diff --git a/sw/airborne/modules/MPPT/MPPT.c b/sw/airborne/modules/MPPT/MPPT.c
index 389f997e9f..2df9df684f 100644
--- a/sw/airborne/modules/MPPT/MPPT.c
+++ b/sw/airborne/modules/MPPT/MPPT.c
@@ -26,7 +26,7 @@
#include
#include "MPPT.h"
#include "firmwares/fixedwing/main_fbw.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#define MPPT_SLAVE_ADDR 0x40
@@ -53,7 +53,7 @@ struct i2c_transaction mppt_trans;
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/adcs/adc_generic.c b/sw/airborne/modules/adcs/adc_generic.c
index d7e8f26f52..c2d6419b09 100644
--- a/sw/airborne/modules/adcs/adc_generic.c
+++ b/sw/airborne/modules/adcs/adc_generic.c
@@ -1,6 +1,6 @@
#include "adc_generic.h"
-#include "adc.h"
-#include "uart.h"
+#include "mcu_periph/adc.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include BOARD_CONFIG
@@ -18,6 +18,10 @@ uint16_t adc_generic_val2;
#define ADC_CHANNEL_GENERIC_NB_SAMPLES DEFAULT_AV_NB_SAMPLE
#endif
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifdef ADC_CHANNEL_GENERIC1
static struct adc_buf buf_generic1;
#endif
diff --git a/sw/airborne/modules/adcs/max11040.c b/sw/airborne/modules/adcs/max11040.c
index 6ef76fd7e2..0cafe4993e 100644
--- a/sw/airborne/modules/adcs/max11040.c
+++ b/sw/airborne/modules/adcs/max11040.c
@@ -28,7 +28,7 @@
*/
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "max11040.h"
diff --git a/sw/airborne/modules/cam_control/cam.c b/sw/airborne/modules/cam_control/cam.c
index 6da22201ff..94fd11d943 100644
--- a/sw/airborne/modules/cam_control/cam.c
+++ b/sw/airborne/modules/cam_control/cam.c
@@ -28,11 +28,11 @@
#include
#include "cam.h"
-#include "common_nav.h"
+#include "subsystems/navigation/common_nav.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "estimator.h"
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
#ifdef POINT_CAM
#include "point.h"
#endif // POINT_CAM
diff --git a/sw/airborne/modules/cam_control/cam_roll.c b/sw/airborne/modules/cam_control/cam_roll.c
index b93d1bbccc..60c0beae7c 100644
--- a/sw/airborne/modules/cam_control/cam_roll.c
+++ b/sw/airborne/modules/cam_control/cam_roll.c
@@ -28,12 +28,12 @@
#include
#include "cam.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "estimator.h"
#include "inter_mcu.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#define MIN_PPRZ_CAM ((int16_t)(MAX_PPRZ * 0.05))
#define DELTA_ALPHA 0.2
diff --git a/sw/airborne/modules/cam_control/cam_track.h b/sw/airborne/modules/cam_control/cam_track.h
index 873e0324bf..0cfc6e6644 100644
--- a/sw/airborne/modules/cam_control/cam_track.h
+++ b/sw/airborne/modules/cam_control/cam_track.h
@@ -45,7 +45,7 @@ extern volatile uint8_t cam_msg_received;
extern void parse_cam_msg( void );
extern void parse_cam_buffer( uint8_t );
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define __CamLink(dev, _x) dev##_x
#define _CamLink(dev, _x) __CamLink(dev, _x)
diff --git a/sw/airborne/modules/core/extra_pprz_dl.c b/sw/airborne/modules/core/extra_pprz_dl.c
index 231287f7d3..3e36b305e1 100644
--- a/sw/airborne/modules/core/extra_pprz_dl.c
+++ b/sw/airborne/modules/core/extra_pprz_dl.c
@@ -25,7 +25,7 @@
#include
#include "extra_pprz_dl.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
volatile bool_t extra_pprz_msg_received = FALSE;
uint8_t extra_pprz_ovrn, extra_pprz_error;
diff --git a/sw/airborne/modules/core/sys_mon.c b/sw/airborne/modules/core/sys_mon.c
index 6999c6f6a1..badec58d30 100644
--- a/sw/airborne/modules/core/sys_mon.c
+++ b/sw/airborne/modules/core/sys_mon.c
@@ -26,7 +26,7 @@
#include "sys_time.h"
#ifdef USE_USB_SERIAL
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#endif
/* Global vars */
@@ -57,7 +57,7 @@ void init_sysmon(void) {
sum_n_event = 0;
}
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
diff --git a/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c b/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c
index 645cbe1294..9c330ad88e 100644
--- a/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c
+++ b/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c
@@ -22,7 +22,7 @@
/** \file atmega_i2c_cam_ctrl.c
- * \brief Interface with digital camera though AVR AtMega chip
+ * \brief Interface with digital camera though AVR AtMega chip
*
* Send Commands over I2C
*/
@@ -30,13 +30,13 @@
#include "atmega_i2c_cam_ctrl.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "estimator.h"
@@ -55,7 +55,7 @@ static struct i2c_transaction atmega_i2c_cam_ctrl_trans;
uint8_t atmega_i2c_cam_ctrl_just_sent_command = 0;
-void atmega_i2c_cam_ctrl_init(void)
+void atmega_i2c_cam_ctrl_init(void)
{
atmega_i2c_cam_ctrl_trans.status = I2CTransDone;
dc_init();
@@ -89,9 +89,9 @@ void atmega_i2c_cam_ctrl_send(uint8_t cmd)
}
}
-void atmega_i2c_cam_ctrl_event( void )
+void atmega_i2c_cam_ctrl_event( void )
{
- if (atmega_i2c_cam_ctrl_trans.status == I2CTransSuccess)
+ if (atmega_i2c_cam_ctrl_trans.status == I2CTransSuccess)
{
unsigned char cam_ret[1];
cam_ret[0] = atmega_i2c_cam_ctrl_trans.buf[0];
diff --git a/sw/airborne/modules/digital_cam/dc.c b/sw/airborne/modules/digital_cam/dc.c
index 29543af74a..99543a6f56 100644
--- a/sw/airborne/modules/digital_cam/dc.c
+++ b/sw/airborne/modules/digital_cam/dc.c
@@ -38,7 +38,7 @@ uint16_t dc_photo_nr = 0;
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "estimator.h"
diff --git a/sw/airborne/modules/digital_cam/dc.h b/sw/airborne/modules/digital_cam/dc.h
index 06fc9d1f0e..bed149f856 100644
--- a/sw/airborne/modules/digital_cam/dc.h
+++ b/sw/airborne/modules/digital_cam/dc.h
@@ -74,7 +74,7 @@ static inline void dc_send_command(uint8_t cmd);
/* Auotmatic Digital Camera Photo Triggering */
typedef enum {
DC_AUTOSHOOT_STOP = 0,
- DC_AUTOSHOOT_PERIODIC = 1,
+ DC_AUTOSHOOT_PERIODIC = 1,
DC_AUTOSHOOT_DISTANCE = 2,
DC_AUTOSHOOT_EXT_TRIG = 3
} dc_autoshoot_type;
@@ -89,7 +89,7 @@ extern uint8_t dc_autoshoot_meter_grid;
/* Send Down the coordinates of where the photo was taken */
#ifdef SENSOR_SYNC_SEND
void dc_send_shot_position(void);
-#else
+#else
#define dc_send_shot_position() {}
#endif
@@ -109,7 +109,7 @@ static inline void dc_init(void)
}
/* shoot on grid */
-static inline void dc_shot_on_utm_north_close_to_100m_grid( void )
+static inline void dc_shot_on_utm_north_close_to_100m_grid( void )
{
uint32_t dist_to_100m_grid = (gps_utm_north / 100) % 100;
if (dist_to_100m_grid < dc_autoshoot_meter_grid || 100 - dist_to_100m_grid < dc_autoshoot_meter_grid)
@@ -119,14 +119,14 @@ static inline void dc_shot_on_utm_north_close_to_100m_grid( void )
}
/* periodic 4Hz function */
-static inline void dc_periodic_4Hz( void )
+static inline void dc_periodic_4Hz( void )
{
static uint8_t dc_shutter_timer = 0;
#ifdef DC_AUTOSHOOT_QUARTERSEC_PERIOD
if (dc_autoshoot == DC_AUTOSHOOT_PERIODIC)
{
- if (dc_shutter_timer)
+ if (dc_shutter_timer)
{
dc_shutter_timer--;
} else {
@@ -145,6 +145,6 @@ static inline void dc_periodic_4Hz( void )
}
-
+
#endif // DC_H
diff --git a/sw/airborne/modules/digital_cam/led_cam_ctrl.c b/sw/airborne/modules/digital_cam/led_cam_ctrl.c
index af9acb254a..d76fcce68e 100644
--- a/sw/airborne/modules/digital_cam/led_cam_ctrl.c
+++ b/sw/airborne/modules/digital_cam/led_cam_ctrl.c
@@ -22,9 +22,6 @@
#include "led_cam_ctrl.h"
-// Include Digital IO
-#include "led.h"
-
// Button Timer
uint8_t dc_timer;
diff --git a/sw/airborne/modules/digital_cam/led_cam_ctrl.h b/sw/airborne/modules/digital_cam/led_cam_ctrl.h
index fcf6a17b88..6fe8ef72c8 100644
--- a/sw/airborne/modules/digital_cam/led_cam_ctrl.h
+++ b/sw/airborne/modules/digital_cam/led_cam_ctrl.h
@@ -47,9 +47,12 @@
// Include Standard Camera Control Interface
#include "dc.h"
+// Include Digital IO
+#include "led.h"
+
extern uint8_t dc_timer;
-static inline void led_cam_ctrl_init(void)
+static inline void led_cam_ctrl_init(void)
{
// Call common DC init
dc_init();
@@ -66,8 +69,8 @@ static inline void led_cam_ctrl_init(void)
#define DC_RELEASE LED_OFF
#endif
-#ifndef SHUTTER_DELAY
-#define SHUTTER_DELAY 2 /* 4Hz -> 0.5s */
+#ifndef DC_SHUTTER_DELAY
+#define DC_SHUTTER_DELAY 2 /* 4Hz -> 0.5s */
#endif
#ifndef DC_SHUTTER_LED
@@ -77,7 +80,7 @@ static inline void led_cam_ctrl_init(void)
/* Command The Camera */
static inline void dc_send_command(uint8_t cmd)
{
- dc_timer = SHUTTER_DELAY;
+ dc_timer = DC_SHUTTER_DELAY;
switch (cmd)
{
case DC_SHOOT:
@@ -85,12 +88,12 @@ static inline void dc_send_command(uint8_t cmd)
dc_send_shot_position();
break;
#ifdef DC_ZOOM_IN_LED
- case DC_ZOOM_IN:
+ case DC_TALLER:
DC_PUSH(DC_ZOOM_IN_LED);
break;
#endif
#ifdef DC_ZOOM_OUT_LED
- case DC_ZOOM_OUT:
+ case DC_WIDER:
DC_PUSH(DC_ZOOM_OUT_LED);
break;
#endif
@@ -104,7 +107,7 @@ static inline void dc_send_command(uint8_t cmd)
/* 4Hz Periodic */
-static inline void led_cam_ctrl_periodic( void )
+static inline void led_cam_ctrl_periodic( void )
{
if (dc_timer) {
dc_timer--;
diff --git a/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c b/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c
index c682e4ae37..97d5d74ac1 100644
--- a/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c
+++ b/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c
@@ -33,13 +33,13 @@
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "estimator.h"
-void atmega_i2c_cam_ctrl_init(void)
+void atmega_i2c_cam_ctrl_init(void)
{
dc_init();
}
@@ -75,16 +75,16 @@ void atmega_i2c_cam_ctrl_send(uint8_t cmd)
else if (cmd == DC_GET_STATUS)
{
mode++;
- if (mode > 15)
+ if (mode > 15)
mode = 0;
}
-
+
cam_ret[0] = mode + zoom * 0x20;
RunOnceEvery(6,DOWNLINK_SEND_PAYLOAD(DefaultChannel, 1, cam_ret ));
-
+
}
-void atmega_i2c_cam_ctrl_event( void )
+void atmega_i2c_cam_ctrl_event( void )
{
}
diff --git a/sw/airborne/modules/display/lcd_dogm.h b/sw/airborne/modules/display/lcd_dogm.h
index 8dfa74d1fb..17f68f753d 100644
--- a/sw/airborne/modules/display/lcd_dogm.h
+++ b/sw/airborne/modules/display/lcd_dogm.h
@@ -3,7 +3,7 @@
#include
#include "std.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi.h"
#include "led.h"
/* EA DOGM163, 3 line LCD at 3.3V */
diff --git a/sw/airborne/modules/enose/enose.c b/sw/airborne/modules/enose/enose.c
index c3e816bb92..7d8b333b28 100644
--- a/sw/airborne/modules/enose/enose.c
+++ b/sw/airborne/modules/enose/enose.c
@@ -1,9 +1,9 @@
#include
-#include "enose/enose.h"
+#include "modules/enose/enose.h"
-#include "i2c.h"
-#include "adc.h"
+#include "mcu_periph/i2c.h"
+#include "mcu_periph/adc.h"
#include BOARD_CONFIG
@@ -47,7 +47,7 @@ void enose_set_heat(uint8_t no_sensor, uint8_t value) {
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/gps_i2c/gps_i2c.c b/sw/airborne/modules/gps_i2c/gps_i2c.c
index 9d4548c26c..6717e3cea0 100644
--- a/sw/airborne/modules/gps_i2c/gps_i2c.c
+++ b/sw/airborne/modules/gps_i2c/gps_i2c.c
@@ -20,8 +20,8 @@
*
*/
-#include "gps_i2c.h"
-#include "i2c.h"
+#include "modules/gps_i2c.h"
+#include "mcu_periph/i2c.h"
#include "gps.h"
uint8_t gps_i2c_rx_buf[GPS_I2C_BUF_SIZE];
diff --git a/sw/airborne/modules/gsm/gsm.c b/sw/airborne/modules/gsm/gsm.c
index 7d4d4e26d5..7229bdc344 100644
--- a/sw/airborne/modules/gsm/gsm.c
+++ b/sw/airborne/modules/gsm/gsm.c
@@ -58,21 +58,21 @@ Receiving:
#include
#include "gsm.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "std.h"
#ifdef USE_USB_SERIAL
-#include "usb_serial.h"
+#include "mcu_periph/usb_serial.h"
#endif
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "downlink.h"
#include "ap_downlink.h"
#include "gps.h"
#include "autopilot.h"
#include "estimator.h"
-#include "common_nav.h"
+#include "subsystems/navigation/common_nav.h"
#include "generated/settings.h"
#ifndef GSM_LINK
diff --git a/sw/airborne/modules/ins/fw_ins_vn100.c b/sw/airborne/modules/ins/fw_ins_vn100.c
index 06002880c2..1b08545606 100644
--- a/sw/airborne/modules/ins/fw_ins_vn100.c
+++ b/sw/airborne/modules/ins/fw_ins_vn100.c
@@ -26,8 +26,8 @@
* \brief driver for the VectorNav VN100 (Fixed-Wing part)
*/
-#include "ins_vn100.h"
-#include "spi.h"
+#include "modules/ins/ins_vn100.h"
+#include "mcu_periph/spi.h"
void ins_init( void ) {
@@ -92,7 +92,7 @@ void ins_periodic_task( void ) {
}
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/ins/ins_arduimu.c b/sw/airborne/modules/ins/ins_arduimu.c
index 68db855b0d..c4e14dd7cd 100644
--- a/sw/airborne/modules/ins/ins_arduimu.c
+++ b/sw/airborne/modules/ins/ins_arduimu.c
@@ -6,9 +6,9 @@ Autoren@ZHAW: schmiemi
#include
-#include "ins_arduimu.h"
+#include "modules/ins/ins_arduimu.h"
#include "firmwares/fixedwing/main_fbw.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
// test
#include "estimator.h"
@@ -30,7 +30,7 @@ int32_t GPS_Data[14];
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/ins/ins_module.h b/sw/airborne/modules/ins/ins_module.h
index 0f2575d241..7c707d011e 100644
--- a/sw/airborne/modules/ins/ins_module.h
+++ b/sw/airborne/modules/ins/ins_module.h
@@ -71,7 +71,7 @@ void parse_ins_msg( void );
void parse_ins_buffer( uint8_t );
#ifndef SITL
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define __InsLink(dev, _x) dev##_x
#define _InsLink(dev, _x) __InsLink(dev, _x)
diff --git a/sw/airborne/modules/ins/ins_osam_ugear.c b/sw/airborne/modules/ins/ins_osam_ugear.c
index 969c542de7..adc3bdd00c 100644
--- a/sw/airborne/modules/ins/ins_osam_ugear.c
+++ b/sw/airborne/modules/ins/ins_osam_ugear.c
@@ -35,8 +35,8 @@
#include "gps_ubx.h"
#include "latlong.h"
#include "sys_time.h"
-#include "generated/airframe.h"
-#include "nav.h"
+#include "airframe.h"
+#include "generated/subsystems/nav.h"
#include "estimator.h"
#include "xsens_protocol.h"
diff --git a/sw/airborne/modules/ins/ins_vn100.c b/sw/airborne/modules/ins/ins_vn100.c
index ba36debbdd..d0670ca565 100644
--- a/sw/airborne/modules/ins/ins_vn100.c
+++ b/sw/airborne/modules/ins/ins_vn100.c
@@ -176,7 +176,7 @@ void parse_ins_msg( void ) {
}
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/max3100/max3100_hw.c b/sw/airborne/modules/max3100/max3100_hw.c
index 00158e6f1a..af85b690cb 100644
--- a/sw/airborne/modules/max3100/max3100_hw.c
+++ b/sw/airborne/modules/max3100/max3100_hw.c
@@ -27,7 +27,7 @@
#include "max3100_hw.h"
#include "ap_downlink.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
uint8_t volatile max3100_status;
diff --git a/sw/airborne/modules/max3100/max3100_hw.h b/sw/airborne/modules/max3100/max3100_hw.h
index fb3f831334..97bfa18cba 100644
--- a/sw/airborne/modules/max3100/max3100_hw.h
+++ b/sw/airborne/modules/max3100/max3100_hw.h
@@ -3,7 +3,7 @@
#include
#include "std.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi_arch.h"
#include "led.h"
/* Pin configuration for max3100 IRQ */
diff --git a/sw/airborne/modules/meteo/dust_gp2y.c b/sw/airborne/modules/meteo/dust_gp2y.c
index ad1be858c2..0b2ae16f69 100644
--- a/sw/airborne/modules/meteo/dust_gp2y.c
+++ b/sw/airborne/modules/meteo/dust_gp2y.c
@@ -30,10 +30,10 @@
*/
-#include "dust_gp2y.h"
-#include "i2c.h"
+#include "modules/meteo/dust_gp2y.h"
+#include "mcu_periph/i2c.h"
#include "sys_time.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
@@ -43,6 +43,10 @@ float dust_gp2y_density_f;
struct i2c_transaction gp2y_trans;
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifndef GP2Y_I2C_DEV
#define GP2Y_I2C_DEV i2c0
#endif
diff --git a/sw/airborne/modules/meteo/humid_dpicco.c b/sw/airborne/modules/meteo/humid_dpicco.c
index 99bbb9f97b..118711c058 100644
--- a/sw/airborne/modules/meteo/humid_dpicco.c
+++ b/sw/airborne/modules/meteo/humid_dpicco.c
@@ -5,14 +5,18 @@
*/
-#include "humid_dpicco.h"
+#include "modules/meteo/humid_dpicco.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifndef DPICCO_I2C_DEV
#define DPICCO_I2C_DEV i2c0
#endif
diff --git a/sw/airborne/modules/meteo/humid_hih.c b/sw/airborne/modules/meteo/humid_hih.c
index d07eb9fba4..2e61b5ca45 100644
--- a/sw/airborne/modules/meteo/humid_hih.c
+++ b/sw/airborne/modules/meteo/humid_hih.c
@@ -29,13 +29,17 @@
*/
#include
-#include "humid_hih.h"
-#include "temp_tmp102.h"
-#include "adc.h"
-#include "uart.h"
+#include "modules/meteo/humid_hih.h"
+#include "modules/meteo/temp_tmp102.h"
+#include "mcu_periph/adc.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifndef ADC_CHANNEL_HUMID_HIH
#define ADC_CHANNEL_HUMID_HIH ADC_3
#endif
diff --git a/sw/airborne/modules/meteo/humid_sht.c b/sw/airborne/modules/meteo/humid_sht.c
index 6dd38cd44d..768244a861 100644
--- a/sw/airborne/modules/meteo/humid_sht.c
+++ b/sw/airborne/modules/meteo/humid_sht.c
@@ -8,13 +8,17 @@
#include "std.h"
#include "LPC21xx.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "humid_sht.h"
#include "led.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
uint16_t humidsht, tempsht;
float fhumidsht, ftempsht;
bool_t humid_sht_available;
diff --git a/sw/airborne/modules/meteo/humid_sht_i2c.c b/sw/airborne/modules/meteo/humid_sht_i2c.c
index a1554d64bd..8fdccf61e4 100644
--- a/sw/airborne/modules/meteo/humid_sht_i2c.c
+++ b/sw/airborne/modules/meteo/humid_sht_i2c.c
@@ -28,10 +28,10 @@
*/
-#include "humid_sht_i2c.h"
+#include "modules/meteo/humid_sht_i2c.h"
-#include "i2c.h"
-#include "uart.h"
+#include "mcu_periph/i2c.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/meteo/ir_mlx.c b/sw/airborne/modules/meteo/ir_mlx.c
index c1f02a9e3b..8166f16192 100644
--- a/sw/airborne/modules/meteo/ir_mlx.c
+++ b/sw/airborne/modules/meteo/ir_mlx.c
@@ -29,15 +29,19 @@
*/
-#include "ir_mlx.h"
+#include "modules/meteo/ir_mlx.h"
#include "sys_time.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifndef MLX_I2C_DEV
#define MLX_I2C_DEV i2c0
#endif
diff --git a/sw/airborne/modules/meteo/light_temt.c b/sw/airborne/modules/meteo/light_temt.c
index 0a8d9fd7af..cfccd86d23 100644
--- a/sw/airborne/modules/meteo/light_temt.c
+++ b/sw/airborne/modules/meteo/light_temt.c
@@ -29,9 +29,9 @@
*/
-#include "light_temt.h"
-#include "adc.h"
-#include "uart.h"
+#include "modules/meteo/light_temt.h"
+#include "mcu_periph/adc.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
@@ -43,6 +43,10 @@
#define ADC_CHANNEL_LIGHT_NB_SAMPLES 16
#endif
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
uint16_t adc_light_temt;
static struct adc_buf buf_light_temt;
diff --git a/sw/airborne/modules/meteo/temp_lm75.c b/sw/airborne/modules/meteo/temp_lm75.c
index 0690536f4c..510fd190a0 100644
--- a/sw/airborne/modules/meteo/temp_lm75.c
+++ b/sw/airborne/modules/meteo/temp_lm75.c
@@ -29,14 +29,18 @@
*/
-#include "temp_lm75.h"
+#include "modules/meteo/temp_lm75.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
uint8_t lm75_meas_started;
struct i2c_transaction lm75_trans;
diff --git a/sw/airborne/modules/meteo/temp_temod.c b/sw/airborne/modules/meteo/temp_temod.c
index 6d34906f38..350d2e73d3 100644
--- a/sw/airborne/modules/meteo/temp_temod.c
+++ b/sw/airborne/modules/meteo/temp_temod.c
@@ -28,16 +28,20 @@
*/
-#include "temp_temod.h"
-#include "i2c.h"
+#include "modules/meteo/temp_temod.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
float ftmd_temperature;
struct i2c_transaction tmd_trans;
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifndef TEMOD_I2C_DEV
#define TEMOD_I2C_DEV i2c0
#endif
@@ -48,7 +52,6 @@ struct i2c_transaction tmd_trans;
#define TEMOD_SLAVE_ADDR 0xF0
-
void temod_init(void) {
tmd_trans.status = I2CTransDone;
}
diff --git a/sw/airborne/modules/meteo/temp_tmp102.c b/sw/airborne/modules/meteo/temp_tmp102.c
index b0acba7ec7..33c23edd7c 100644
--- a/sw/airborne/modules/meteo/temp_tmp102.c
+++ b/sw/airborne/modules/meteo/temp_tmp102.c
@@ -29,14 +29,18 @@
*/
-#include "temp_tmp102.h"
+#include "modules/meteo/temp_tmp102.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
uint8_t tmp_meas_started;
float ftmp_temperature;
struct i2c_transaction tmp_trans;
diff --git a/sw/airborne/modules/meteo/wind_gfi.c b/sw/airborne/modules/meteo/wind_gfi.c
index 32c8f6b415..27d81ddb1a 100644
--- a/sw/airborne/modules/meteo/wind_gfi.c
+++ b/sw/airborne/modules/meteo/wind_gfi.c
@@ -29,11 +29,11 @@
*/
-#include "wind_gfi.h"
+#include "modules/meteo/wind_gfi.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/meteo/windturbine.c b/sw/airborne/modules/meteo/windturbine.c
index c482cb9cda..5e356d5536 100644
--- a/sw/airborne/modules/meteo/windturbine.c
+++ b/sw/airborne/modules/meteo/windturbine.c
@@ -38,7 +38,7 @@
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/multi/formation.h b/sw/airborne/modules/multi/formation.h
index 6a81365a7f..e4c52af109 100644
--- a/sw/airborne/modules/multi/formation.h
+++ b/sw/airborne/modules/multi/formation.h
@@ -7,8 +7,8 @@
#ifndef FORMATION_H
#define FORMATION_H
-#include "nav.h"
-#include "traffic_info.h"
+#include "subsystems/nav.h"
+#include "subsystems/navigation/traffic_info.h"
#define FORM_MODE_GLOBAL 0
#define FORM_MODE_COURSE 1
diff --git a/sw/airborne/modules/multi/potential.h b/sw/airborne/modules/multi/potential.h
index 91aee88d60..63e659a4dc 100644
--- a/sw/airborne/modules/multi/potential.h
+++ b/sw/airborne/modules/multi/potential.h
@@ -7,8 +7,8 @@
#ifndef POTENTIAL_H
#define POTENTIAL_H
-#include "nav.h"
-#include "traffic_info.h"
+#include "subsystems/nav.h"
+#include "subsystems/navigation/traffic_info.h"
struct force_ {
float east;
diff --git a/sw/airborne/modules/multi/tcas.c b/sw/airborne/modules/multi/tcas.c
index 5a92c8885f..6030bb3f7d 100644
--- a/sw/airborne/modules/multi/tcas.c
+++ b/sw/airborne/modules/multi/tcas.c
@@ -30,7 +30,7 @@
#include "multi/tcas.h"
#include "generated/airframe.h"
#include "estimator.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "gps.h"
#include "generated/flight_plan.h"
diff --git a/sw/airborne/modules/multi/tcas.h b/sw/airborne/modules/multi/tcas.h
index d4299f1d1c..54134d3499 100644
--- a/sw/airborne/modules/multi/tcas.h
+++ b/sw/airborne/modules/multi/tcas.h
@@ -31,7 +31,7 @@
#define TCAS_H
#include "std.h"
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
extern float tcas_alt_setpoint;
extern float tcas_tau_ta, tcas_tau_ra, tcas_dmod, tcas_alim;
diff --git a/sw/airborne/modules/poles/nav_poles.c b/sw/airborne/modules/poles/nav_poles.c
index 7a7558f9f4..2a09f63e8a 100644
--- a/sw/airborne/modules/poles/nav_poles.c
+++ b/sw/airborne/modules/poles/nav_poles.c
@@ -1,5 +1,5 @@
-#include "nav_poles.h"
-#include "common_nav.h"
+#include "subsystems/navigation/nav_poles.h"
+#include "subsystems/navigation/common_nav.h"
uint8_t nav_poles_count = 0;
diff --git a/sw/airborne/modules/sensors/airspeed_adc.c b/sw/airborne/modules/sensors/airspeed_adc.c
index d554246d24..776a15ae91 100644
--- a/sw/airborne/modules/sensors/airspeed_adc.c
+++ b/sw/airborne/modules/sensors/airspeed_adc.c
@@ -20,8 +20,8 @@
*
*/
-#include "sensors/airspeed_adc.h"
-#include "adc.h"
+#include "modules/sensors/airspeed_adc.h"
+#include "mcu_periph/adc.h"
#include BOARD_CONFIG
#include "generated/airframe.h"
#include "estimator.h"
diff --git a/sw/airborne/modules/sensors/airspeed_ets.c b/sw/airborne/modules/sensors/airspeed_ets.c
index e00164cb96..4921e9c6a2 100644
--- a/sw/airborne/modules/sensors/airspeed_ets.c
+++ b/sw/airborne/modules/sensors/airspeed_ets.c
@@ -36,8 +36,8 @@
*/
#include "sensors/airspeed_ets.h"
#include "estimator.h"
-#include "i2c.h"
-#include "uart.h"
+#include "mcu_periph/i2c.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include
@@ -65,6 +65,10 @@
#define AIRSPEED_ETS_I2C_DEV i2c0
#endif
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
// Global variables
uint16_t airspeed_ets_raw;
uint16_t airspeed_ets_offset;
diff --git a/sw/airborne/modules/sensors/airspeed_ets.h b/sw/airborne/modules/sensors/airspeed_ets.h
index 6ce9db430c..1b27ddd181 100644
--- a/sw/airborne/modules/sensors/airspeed_ets.h
+++ b/sw/airborne/modules/sensors/airspeed_ets.h
@@ -39,7 +39,7 @@
#define AIRSPEED_ETS_H
#include "std.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
extern uint16_t airspeed_ets_raw;
extern uint16_t airspeed_ets_offset;
diff --git a/sw/airborne/modules/sensors/alt_srf08.c b/sw/airborne/modules/sensors/alt_srf08.c
index fca3474dda..733b25f5af 100644
--- a/sw/airborne/modules/sensors/alt_srf08.c
+++ b/sw/airborne/modules/sensors/alt_srf08.c
@@ -27,13 +27,17 @@
*
*/
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "alt_srf08.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
#include "led.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifndef SRF08_I2C_DEV
#define SRF08_I2C_DEV i2c0
#endif
diff --git a/sw/airborne/modules/sensors/baro_MS5534A.c b/sw/airborne/modules/sensors/baro_MS5534A.c
index d44dde9dc9..d922cff51b 100644
--- a/sw/airborne/modules/sensors/baro_MS5534A.c
+++ b/sw/airborne/modules/sensors/baro_MS5534A.c
@@ -28,13 +28,13 @@
* uses: MOSI, MISO, SCK and 32kHz @ P0.7 with 5V for the -A type
*/
-#include "baro_MS5534A.h"
-#include "spi.h"
-#include "uart.h"
+#include "modules/sensors/baro_MS5534A.h"
+#include "mcu_periph/spi.h"
+#include "mcu_periph/uart.h"
#ifndef BARO_NO_DOWNLINK
#include "ap_downlink.h"
#endif
-#include "nav.h"
+#include "subsystems/nav.h"
#include "estimator.h"
bool_t baro_MS5534A_do_reset;
diff --git a/sw/airborne/modules/sensors/baro_bmp.c b/sw/airborne/modules/sensors/baro_bmp.c
index 34860b1ca0..cb28db06c1 100644
--- a/sw/airborne/modules/sensors/baro_bmp.c
+++ b/sw/airborne/modules/sensors/baro_bmp.c
@@ -32,12 +32,16 @@
#include "baro_bmp.h"
#include "sys_time.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#ifndef SENSOR_SYNC_SEND
#warning set SENSOR_SYNC_SEND to use baro_bmp
#endif
diff --git a/sw/airborne/modules/sensors/baro_ets.c b/sw/airborne/modules/sensors/baro_ets.c
index d1164a0d19..462956a181 100644
--- a/sw/airborne/modules/sensors/baro_ets.c
+++ b/sw/airborne/modules/sensors/baro_ets.c
@@ -36,7 +36,7 @@
*/
#include "sensors/baro_ets.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "estimator.h"
#include
diff --git a/sw/airborne/modules/sensors/baro_ets.h b/sw/airborne/modules/sensors/baro_ets.h
index 337c4c041c..bfdc568b6d 100644
--- a/sw/airborne/modules/sensors/baro_ets.h
+++ b/sw/airborne/modules/sensors/baro_ets.h
@@ -39,7 +39,7 @@
#define BARO_ETS_H
#include "std.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#define BARO_ETS_DT 0.05
diff --git a/sw/airborne/modules/sensors/baro_scp.c b/sw/airborne/modules/sensors/baro_scp.c
index 80808ee28e..8cc888dc60 100644
--- a/sw/airborne/modules/sensors/baro_scp.c
+++ b/sw/airborne/modules/sensors/baro_scp.c
@@ -1,21 +1,27 @@
#include "std.h"
-#include "init_hw.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
+#include "mcu.h"
-#include "uart.h"
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
-#include "spi_hw.h"
+#include "mcu_periph/spi.h"
-#include "baro_scp.h"
+#include "modules/sensors/baro_scp.h"
#ifndef SENSOR_SYNC_SEND
#warning set SENSOR_SYNC_SEND to use baro_scp
#endif
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
#define STA_UNINIT 0
#define STA_INITIALISING 1
#define STA_IDLE 2
diff --git a/sw/airborne/modules/sensors/baro_scp_i2c.c b/sw/airborne/modules/sensors/baro_scp_i2c.c
index f45f89abd0..9a8d848f70 100644
--- a/sw/airborne/modules/sensors/baro_scp_i2c.c
+++ b/sw/airborne/modules/sensors/baro_scp_i2c.c
@@ -8,9 +8,13 @@
#include "baro_scp_i2c.h"
#include "sys_time.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "led.h"
-#include "uart.h"
+
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
@@ -18,6 +22,10 @@
#warning set SENSOR_SYNC_SEND to use baro_scp_i2c
#endif
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
uint8_t baro_scp_status;
uint32_t baro_scp_pressure;
uint16_t baro_scp_temperature;
diff --git a/sw/airborne/modules/sensors/infrared_i2c.h b/sw/airborne/modules/sensors/infrared_i2c.h
index 2b91acfb22..0b3422667c 100644
--- a/sw/airborne/modules/sensors/infrared_i2c.h
+++ b/sw/airborne/modules/sensors/infrared_i2c.h
@@ -29,8 +29,8 @@
#include "std.h"
#include "generated/airframe.h"
-#include "infrared.h"
-#include "i2c.h"
+#include "subsystems/sensors/infrared.h"
+#include "mcu_periph/i2c.h"
extern int16_t ir_i2c_ir1;
extern int16_t ir_i2c_ir2;
diff --git a/sw/airborne/modules/sensors/mag_micromag_fw.c b/sw/airborne/modules/sensors/mag_micromag_fw.c
index a1544a698a..91fa517cef 100644
--- a/sw/airborne/modules/sensors/mag_micromag_fw.c
+++ b/sw/airborne/modules/sensors/mag_micromag_fw.c
@@ -1,7 +1,11 @@
-#include "mag_micromag_fw.h"
-#include "sensors/mag_micromag_fw_hw.h"
+#include "modules/sensors/mag_micromag_fw.h"
+#include "modules/sensors/mag_micromag_fw_hw.h"
#include "led.h"
-#include "uart.h"
+
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/sensors/pressure_board_navarro.h b/sw/airborne/modules/sensors/pressure_board_navarro.h
index 91bb7a909a..2bd4edba89 100644
--- a/sw/airborne/modules/sensors/pressure_board_navarro.h
+++ b/sw/airborne/modules/sensors/pressure_board_navarro.h
@@ -36,7 +36,7 @@
#define PRESSURE_BOARD_NAVARRO_H
#include "std.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
extern uint16_t altitude_adc;
extern uint16_t airspeed_adc;
diff --git a/sw/airborne/modules/sensors/trigger_ext.c b/sw/airborne/modules/sensors/trigger_ext.c
index 74205b8e76..635ff50df6 100644
--- a/sw/airborne/modules/sensors/trigger_ext.c
+++ b/sw/airborne/modules/sensors/trigger_ext.c
@@ -34,7 +34,7 @@
#include "modules/sensors/trig_ext_hw.h"
#include "gps.h"
#include "sys_time.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/modules/vehicle_interface/vi_overo_link.c b/sw/airborne/modules/vehicle_interface/vi_overo_link.c
index 7a38cb0b15..da14c6bcdb 100644
--- a/sw/airborne/modules/vehicle_interface/vi_overo_link.c
+++ b/sw/airborne/modules/vehicle_interface/vi_overo_link.c
@@ -26,7 +26,7 @@
#include "lisa/lisa_overo_link.h"
#include "subsystems/imu.h"
#include
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
#include
diff --git a/sw/airborne/3dmg.c b/sw/airborne/obsolete/3dmg.c
similarity index 100%
rename from sw/airborne/3dmg.c
rename to sw/airborne/obsolete/3dmg.c
diff --git a/sw/airborne/3dmg.h b/sw/airborne/obsolete/3dmg.h
similarity index 100%
rename from sw/airborne/3dmg.h
rename to sw/airborne/obsolete/3dmg.h
diff --git a/sw/airborne/peripherals/ami601.h b/sw/airborne/peripherals/ami601.h
index 0036413962..38be9a347a 100644
--- a/sw/airborne/peripherals/ami601.h
+++ b/sw/airborne/peripherals/ami601.h
@@ -2,7 +2,7 @@
#define AMI601_H
#include "std.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
extern void ami601_init( void );
diff --git a/sw/airborne/peripherals/hmc5843.h b/sw/airborne/peripherals/hmc5843.h
index a3d75c297d..ed31ebeed3 100644
--- a/sw/airborne/peripherals/hmc5843.h
+++ b/sw/airborne/peripherals/hmc5843.h
@@ -25,7 +25,7 @@
#define HMC5843_H
#include "std.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "peripherals/hmc5843_arch.h"
diff --git a/sw/airborne/pprz_debug.h b/sw/airborne/pprz_debug.h
index 966a004c19..79d764b26f 100644
--- a/sw/airborne/pprz_debug.h
+++ b/sw/airborne/pprz_debug.h
@@ -31,7 +31,7 @@
#ifdef PPRZ_DEBUG
#include "std.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/pprz_transport.c b/sw/airborne/pprz_transport.c
index 7985e6decd..90b4a93e06 100644
--- a/sw/airborne/pprz_transport.c
+++ b/sw/airborne/pprz_transport.c
@@ -24,7 +24,7 @@
#include
#include "pprz_transport.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
uint8_t ck_a, ck_b;
volatile bool_t pprz_msg_received = FALSE;
diff --git a/sw/airborne/print.h b/sw/airborne/print.h
index 6b1dbc95d9..902d29b45c 100644
--- a/sw/airborne/print.h
+++ b/sw/airborne/print.h
@@ -25,8 +25,8 @@
#ifndef PRINT_H
#define PRINT_H
-#include "uart.h"
-#include "usb_serial.h"
+#include "mcu_periph/uart.h"
+#include "mcu_periph/usb_serial.h"
#define _PrintString(out_fun, s) { \
uint8_t i = 0; \
diff --git a/sw/airborne/rc_settings.c b/sw/airborne/rc_settings.c
index 02095a24eb..91cdc614e7 100644
--- a/sw/airborne/rc_settings.c
+++ b/sw/airborne/rc_settings.c
@@ -28,8 +28,8 @@
#include "rc_settings.h"
#include "generated/radio.h"
#include "autopilot.h"
-#include "infrared.h"
-#include "nav.h"
+#include "subsystems/nav.h"
+#include "subsystems/sensors/infrared.h"
#include "estimator.h"
#include "inter_mcu.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
diff --git a/sw/airborne/sd_card/main.c b/sw/airborne/sd_card/main.c
index 5be480f5f7..a77f922b58 100644
--- a/sw/airborne/sd_card/main.c
+++ b/sw/airborne/sd_card/main.c
@@ -1,9 +1,8 @@
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "interrupt_hw.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
@@ -12,7 +11,7 @@
#include "generated/settings.h"
#include "dl_protocol.h"
-#include "spi.h"
+#include "mcu_periph/spi.h"
#include "sd_card.h"
static inline void main_init( void );
diff --git a/sw/airborne/subsystems/ahrs.c b/sw/airborne/subsystems/ahrs.c
index fb8dc44e39..d499139908 100644
--- a/sw/airborne/subsystems/ahrs.c
+++ b/sw/airborne/subsystems/ahrs.c
@@ -1,7 +1,5 @@
/*
- * $Id$
- *
- * Copyright (C) 2009 Felix Ruess
+ * Copyright (C) 2008-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
diff --git a/sw/airborne/subsystems/ahrs.h b/sw/airborne/subsystems/ahrs.h
index c0d088fbb3..7d358b9288 100644
--- a/sw/airborne/subsystems/ahrs.h
+++ b/sw/airborne/subsystems/ahrs.h
@@ -33,6 +33,12 @@
#define AHRS_UNINIT 0
#define AHRS_RUNNING 1
+/* underlying includes (needed for parameters) */
+#ifdef AHRS_TYPE_H
+#include AHRS_TYPE_H
+#endif
+
+
struct Ahrs {
struct Int32Quat ltp_to_imu_quat;
diff --git a/sw/airborne/subsystems/ahrs/ahrs_aligner.c b/sw/airborne/subsystems/ahrs/ahrs_aligner.c
index 1c689de290..7b3630e4cb 100644
--- a/sw/airborne/subsystems/ahrs/ahrs_aligner.c
+++ b/sw/airborne/subsystems/ahrs/ahrs_aligner.c
@@ -91,7 +91,7 @@ void ahrs_aligner_run(void) {
ahrs_aligner.low_noise_cnt++;
else
if ( ahrs_aligner.low_noise_cnt > 0)
- ahrs_aligner.low_noise_cnt--;
+ ahrs_aligner.low_noise_cnt--;
if (ahrs_aligner.low_noise_cnt > LOW_NOISE_TIME) {
ahrs_aligner.status = AHRS_ALIGNER_LOCKED;
diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c
new file mode 100644
index 0000000000..62f21993a1
--- /dev/null
+++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c
@@ -0,0 +1,404 @@
+/*
+ * Released under Creative Commons License
+ *
+ * 2010 The Paparazzi Team
+ *
+ *
+ * Based on Code by Jordi Munoz and William Premerlani, Supported by Chris Anderson (Wired) and Nathan Sindle (SparkFun).
+ * Version 1.0 for flat board updated by Doug Weibel and Jose Julio
+ *
+ * Modified at Hochschule Bremen, Germany
+ * 2010 Heinrich Warmers, Christoph Niemann, Oliver Riesener
+ *
+ */
+
+/** \file ahrs_float_dcm.c
+ * \brief Attitude estimation for fixedwings based on the DCM
+ * Theory: http://code.google.com/p/gentlenav/downloads/list file DCMDraft2.pdf
+ *
+ */
+
+#include "std.h"
+
+#include "subsystems/ahrs.h"
+#include "subsystems/ahrs/ahrs_float_dcm.h"
+#include "subsystems/ahrs/ahrs_float_utils.h"
+#include "subsystems/ahrs/ahrs_aligner.h"
+#include "subsystems/imu.h"
+
+#include "subsystems/ahrs/ahrs_float_dcm_algebra.h"
+
+#ifdef USE_GPS
+#include "gps.h"
+#endif
+
+#include
+
+//FIXME this is still needed for fixedwing integration
+#include "estimator.h"
+
+struct AhrsFloatDCM ahrs_impl;
+
+// remotely settable
+float ins_roll_neutral = INS_ROLL_NEUTRAL_DEFAULT;
+float ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT;
+
+// Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down.
+// Positive pitch : nose up
+// Positive roll : right wing down
+// Positive yaw : clockwise
+
+// DCM Working variables
+float G_Dt=0.05;
+
+struct FloatVect3 accel_float = {0,0,0};
+
+float Omega_Vector[3]= {0,0,0}; //Corrected Gyro_Vector data
+float Omega_P[3]= {0,0,0}; //Omega Proportional correction
+float Omega_I[3]= {0,0,0}; //Omega Integrator
+float Omega[3]= {0,0,0};
+
+float DCM_Matrix[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
+float Update_Matrix[3][3] = {{0,1,2},{3,4,5},{6,7,8}}; //Gyros here
+float Temporary_Matrix[3][3] = {{0,0,0},{0,0,0},{0,0,0}};
+
+#ifdef USE_MAGNETOMETER
+float MAG_Heading;
+#endif
+
+static inline void compute_body_orientation_and_rates(void);
+void Normalize(void);
+void Drift_correction(void);
+void Euler_angles(void);
+void Matrix_update(void);
+
+/**************************************************/
+
+void ahrs_update_fw_estimator( void )
+{
+ Euler_angles();
+
+ //warning, only eulers written to ahrs struct so far
+ //compute_body_orientation_and_rates();
+
+ // export results to estimator
+ estimator_phi = ahrs_float.ltp_to_imu_euler.phi - ins_roll_neutral;
+ estimator_theta = ahrs_float.ltp_to_imu_euler.theta - ins_pitch_neutral;
+ estimator_psi = ahrs_float.ltp_to_imu_euler.psi;
+}
+
+
+void ahrs_init(void) {
+ ahrs_float.status = AHRS_UNINIT;
+
+ /*
+ * Initialises our IMU alignement variables
+ * This should probably done in the IMU code instead
+ */
+ struct FloatEulers body_to_imu_euler =
+ {IMU_BODY_TO_IMU_PHI, IMU_BODY_TO_IMU_THETA, IMU_BODY_TO_IMU_PSI};
+ FLOAT_QUAT_OF_EULERS(ahrs_impl.body_to_imu_quat, body_to_imu_euler);
+ FLOAT_RMAT_OF_EULERS(ahrs_impl.body_to_imu_rmat, body_to_imu_euler);
+
+ /* set ltp_to_body to zero */
+ FLOAT_QUAT_ZERO(ahrs_float.ltp_to_body_quat);
+ FLOAT_EULERS_ZERO(ahrs_float.ltp_to_body_euler);
+ FLOAT_RMAT_ZERO(ahrs_float.ltp_to_body_rmat);
+ FLOAT_RATES_ZERO(ahrs_float.body_rate);
+
+ /* set ltp_to_imu so that body is zero */
+ QUAT_COPY(ahrs_float.ltp_to_imu_quat, ahrs_impl.body_to_imu_quat);
+ RMAT_COPY(ahrs_float.ltp_to_imu_rmat, ahrs_impl.body_to_imu_rmat);
+ EULERS_COPY(ahrs_float.ltp_to_imu_euler, body_to_imu_euler);
+ FLOAT_RATES_ZERO(ahrs_float.imu_rate);
+}
+
+void ahrs_align(void)
+{
+ /* Compute an initial orientation using euler angles */
+ ahrs_float_get_euler_from_accel_mag(&ahrs_float.ltp_to_imu_euler, &ahrs_aligner.lp_accel, &ahrs_aligner.lp_mag);
+
+ /* Convert initial orientation in quaternion and rotation matrice representations. */
+ FLOAT_QUAT_OF_EULERS(ahrs_float.ltp_to_imu_quat, ahrs_float.ltp_to_imu_euler);
+ FLOAT_RMAT_OF_QUAT(ahrs_float.ltp_to_imu_rmat, ahrs_float.ltp_to_imu_quat);
+
+ /* Compute initial body orientation */
+ compute_body_orientation_and_rates();
+
+ /* use averaged gyro as initial value for bias */
+ struct Int32Rates bias0;
+ RATES_COPY(bias0, ahrs_aligner.lp_gyro);
+ RATES_FLOAT_OF_BFP(ahrs_impl.gyro_bias, bias0);
+
+ ahrs.status = AHRS_RUNNING;
+}
+
+
+void ahrs_propagate(void)
+{
+ /* convert imu data to floating point */
+ struct FloatRates gyro_float;
+ RATES_FLOAT_OF_BFP(gyro_float, imu.gyro);
+
+ /* unbias rate measurement */
+ RATES_DIFF(ahrs_float.imu_rate, gyro_float, ahrs_impl.gyro_bias);
+
+ Matrix_update();
+ Normalize();
+ //INFO, ahrs struct only updated in ahrs_update_fw_estimator
+}
+
+void ahrs_update_accel(void)
+{
+ ACCELS_FLOAT_OF_BFP(accel_float, imu.accel);
+
+#ifdef USE_GPS
+ if (gps_mode==3) { //Remove centrifugal acceleration.
+ accel_float.y += gps_speed_3d/100. * Omega[2]; // Centrifugal force on Acc_y = GPS_speed*GyroZ
+ accel_float.z -= gps_speed_3d/100. * Omega[1]; // Centrifugal force on Acc_z = GPS_speed*GyroY
+ }
+#endif
+
+ Drift_correction();
+}
+
+void ahrs_update_mag(void)
+{
+ //TODO
+}
+
+void Normalize(void)
+{
+ float error=0;
+ float temporary[3][3];
+ float renorm=0;
+ boolean problem=FALSE;
+
+ // Find the non-orthogonality of X wrt Y
+ error= -Vector_Dot_Product(&DCM_Matrix[0][0],&DCM_Matrix[1][0])*.5; //eq.19
+
+ // Add half the XY error to X, and half to Y
+ Vector_Scale(&temporary[0][0], &DCM_Matrix[1][0], error); //eq.19
+ Vector_Scale(&temporary[1][0], &DCM_Matrix[0][0], error); //eq.19
+ Vector_Add(&temporary[0][0], &temporary[0][0], &DCM_Matrix[0][0]); //eq.19
+ Vector_Add(&temporary[1][0], &temporary[1][0], &DCM_Matrix[1][0]); //eq.19
+
+ // The third axis is simply set perpendicular to the first 2. (there is not correction of XY based on Z)
+ Vector_Cross_Product(&temporary[2][0],&temporary[0][0],&temporary[1][0]); // c= a x b //eq.20
+
+ // Normalize lenght of X
+ renorm= Vector_Dot_Product(&temporary[0][0],&temporary[0][0]);
+ // a) if norm is close to 1, use the fast 1st element from the tailer expansion of SQRT
+ // b) if the norm is further from 1, use a real sqrt
+ // c) norm is huge: disaster! reset! mayday!
+ if (renorm < 1.5625f && renorm > 0.64f) {
+ renorm= .5 * (3-renorm); //eq.21
+ } else if (renorm < 100.0f && renorm > 0.01f) {
+ renorm= 1. / sqrt(renorm);
+#if PERFORMANCE_REPORTING == 1
+ renorm_sqrt_count++;
+#endif
+ } else {
+ problem = TRUE;
+#if PERFORMANCE_REPORTING == 1
+ renorm_blowup_count++;
+#endif
+ }
+ Vector_Scale(&DCM_Matrix[0][0], &temporary[0][0], renorm);
+
+ // Normalize lenght of Y
+ renorm= Vector_Dot_Product(&temporary[1][0],&temporary[1][0]);
+ if (renorm < 1.5625f && renorm > 0.64f) {
+ renorm= .5 * (3-renorm); //eq.21
+ } else if (renorm < 100.0f && renorm > 0.01f) {
+ renorm= 1. / sqrt(renorm);
+#if PERFORMANCE_REPORTING == 1
+ renorm_sqrt_count++;
+#endif
+ } else {
+ problem = TRUE;
+#if PERFORMANCE_REPORTING == 1
+ renorm_blowup_count++;
+#endif
+ }
+ Vector_Scale(&DCM_Matrix[1][0], &temporary[1][0], renorm);
+
+ // Normalize lenght of Z
+ renorm= Vector_Dot_Product(&temporary[2][0],&temporary[2][0]);
+ if (renorm < 1.5625f && renorm > 0.64f) {
+ renorm= .5 * (3-renorm); //eq.21
+ } else if (renorm < 100.0f && renorm > 0.01f) {
+ renorm= 1. / sqrt(renorm);
+#if PERFORMANCE_REPORTING == 1
+ renorm_sqrt_count++;
+#endif
+ } else {
+ problem = TRUE;
+#if PERFORMANCE_REPORTING == 1
+ renorm_blowup_count++;
+#endif
+ }
+ Vector_Scale(&DCM_Matrix[2][0], &temporary[2][0], renorm);
+
+ // Reset on trouble
+ if (problem) { // Our solution is blowing up and we will force back to initial condition. Hope we are not upside down!
+ DCM_Matrix[0][0]= 1.0f;
+ DCM_Matrix[0][1]= 0.0f;
+ DCM_Matrix[0][2]= 0.0f;
+ DCM_Matrix[1][0]= 0.0f;
+ DCM_Matrix[1][1]= 1.0f;
+ DCM_Matrix[1][2]= 0.0f;
+ DCM_Matrix[2][0]= 0.0f;
+ DCM_Matrix[2][1]= 0.0f;
+ DCM_Matrix[2][2]= 1.0f;
+ problem = FALSE;
+ }
+}
+
+
+void Drift_correction(void)
+{
+ //Compensation the Roll, Pitch and Yaw drift.
+ static float Scaled_Omega_P[3];
+ static float Scaled_Omega_I[3];
+ float Accel_magnitude;
+ float Accel_weight;
+ float Integrator_magnitude;
+
+ // Local Working Variables
+ float errorRollPitch[3];
+ float errorYaw[3];
+ float errorCourse;
+
+ //*****Roll and Pitch***************
+
+ // Calculate the magnitude of the accelerometer vector
+ Accel_magnitude = sqrt(accel_float.x*accel_float.x + accel_float.y*accel_float.y + accel_float.z*accel_float.z);
+ Accel_magnitude = Accel_magnitude / GRAVITY; // Scale to gravity.
+ // Dynamic weighting of accelerometer info (reliability filter)
+ // Weight for accelerometer info (<0.5G = 0.0, 1G = 1.0 , >1.5G = 0.0)
+ Accel_weight = Chop(1 - 2*fabs(1 - Accel_magnitude),0,1); //
+
+ #if PERFORMANCE_REPORTING == 1
+ {
+
+ float tempfloat = ((Accel_weight - 0.5) * 256.0f); //amount added was determined to give imu_health a time constant about twice the time constant of the roll/pitch drift correction
+ imu_health += tempfloat;
+ Bound(imu_health,129,65405);
+ }
+ #endif
+
+ Vector_Cross_Product(&errorRollPitch[0],&accel_float.x,&DCM_Matrix[2][0]); //adjust the ground of reference
+ Vector_Scale(&Omega_P[0],&errorRollPitch[0],Kp_ROLLPITCH*Accel_weight);
+
+ Vector_Scale(&Scaled_Omega_I[0],&errorRollPitch[0],Ki_ROLLPITCH*Accel_weight);
+ Vector_Add(Omega_I,Omega_I,Scaled_Omega_I);
+
+ //*****YAW***************
+
+#ifdef USE_MAGNETOMETER
+ // We make the gyro YAW drift correction based on compass magnetic heading
+ float mag_heading_x = cos(MAG_Heading);
+ float mag_heading_y = sin(MAG_Heading);
+ errorCourse=(DCM_Matrix[0][0]*mag_heading_y) - (DCM_Matrix[1][0]*mag_heading_x); //Calculating YAW error
+ Vector_Scale(errorYaw,&DCM_Matrix[2][0],errorCourse); //Applys the yaw correction to the XYZ rotation of the aircraft, depeding the position.
+
+ Vector_Scale(&Scaled_Omega_P[0],&errorYaw[0],Kp_YAW);
+ Vector_Add(Omega_P,Omega_P,Scaled_Omega_P);//Adding Proportional.
+
+ Vector_Scale(&Scaled_Omega_I[0],&errorYaw[0],Ki_YAW);
+ Vector_Add(Omega_I,Omega_I,Scaled_Omega_I);//adding integrator to the Omega_I
+
+#elif defined USE_GPS // Use GPS Ground course to correct yaw gyro drift
+
+ if(gps_mode==3 && gps_gspeed>= 500) { //got a 3d fix and ground speed is more than 0.5 m/s
+ float ground_course = gps_course/10. - 180.; //This is the runaway direction of you "plane" in degrees
+ float COGX = cos(RadOfDeg(ground_course)); //Course overground X axis
+ float COGY = sin(RadOfDeg(ground_course)); //Course overground Y axis
+
+ errorCourse=(DCM_Matrix[0][0]*COGY) - (DCM_Matrix[1][0]*COGX); //Calculating YAW error
+ Vector_Scale(errorYaw,&DCM_Matrix[2][0],errorCourse); //Applys the yaw correction to the XYZ rotation of the aircraft, depeding the position.
+
+ Vector_Scale(&Scaled_Omega_P[0],&errorYaw[0],Kp_YAW);
+ Vector_Add(Omega_P,Omega_P,Scaled_Omega_P);//Adding Proportional.
+
+ Vector_Scale(&Scaled_Omega_I[0],&errorYaw[0],Ki_YAW);
+ Vector_Add(Omega_I,Omega_I,Scaled_Omega_I);//adding integrator to the Omega_I
+ }
+#endif
+
+ // Here we will place a limit on the integrator so that the integrator cannot ever exceed half the saturation limit of the gyros
+ Integrator_magnitude = sqrt(Vector_Dot_Product(Omega_I,Omega_I));
+ if (Integrator_magnitude > DegOfRad(300)) {
+ Vector_Scale(Omega_I,Omega_I,0.5f*DegOfRad(300)/Integrator_magnitude);
+ }
+
+
+}
+/**************************************************/
+
+void Matrix_update(void)
+{
+ Vector_Add(&Omega[0], &ahrs_float.imu_rate.p, &Omega_I[0]); //adding proportional term
+ Vector_Add(&Omega_Vector[0], &Omega[0], &Omega_P[0]); //adding Integrator term
+
+ #if OUTPUTMODE==1 // With corrected data (drift correction)
+ Update_Matrix[0][0]=0;
+ Update_Matrix[0][1]=-G_Dt*Omega_Vector[2];//-z
+ Update_Matrix[0][2]=G_Dt*Omega_Vector[1];//y
+ Update_Matrix[1][0]=G_Dt*Omega_Vector[2];//z
+ Update_Matrix[1][1]=0;
+ Update_Matrix[1][2]=-G_Dt*Omega_Vector[0];//-x
+ Update_Matrix[2][0]=-G_Dt*Omega_Vector[1];//-y
+ Update_Matrix[2][1]=G_Dt*Omega_Vector[0];//x
+ Update_Matrix[2][2]=0;
+ #else // Uncorrected data (no drift correction)
+ Update_Matrix[0][0]=0;
+ Update_Matrix[0][1]=-G_Dt*ahrs_float.imu_rate.r;//-z
+ Update_Matrix[0][2]=G_Dt*ahrs_float.imu_rate.q;//y
+ Update_Matrix[1][0]=G_Dt*ahrs_float.imu_rate.r;//z
+ Update_Matrix[1][1]=0;
+ Update_Matrix[1][2]=-G_Dt*ahrs_float.imu_rate.p;
+ Update_Matrix[2][0]=-G_Dt*ahrs_float.imu_rate.q;
+ Update_Matrix[2][1]=G_Dt*ahrs_float.imu_rate.p;
+ Update_Matrix[2][2]=0;
+ #endif
+
+ Matrix_Multiply(DCM_Matrix,Update_Matrix,Temporary_Matrix); //a*b=c
+
+ for(int x=0; x<3; x++) //Matrix Addition (update)
+ {
+ for(int y=0; y<3; y++)
+ {
+ DCM_Matrix[x][y]+=Temporary_Matrix[x][y];
+ }
+ }
+}
+
+void Euler_angles(void)
+{
+#if (OUTPUTMODE==2) // Only accelerometer info (debugging purposes)
+ ahrs_float.ltp_to_imu_euler.phi = atan2(accel_float.y,accel_float.z); // atan2(acc_y,acc_z)
+ ahrs_float.ltp_to_imu_euler.theta = -asin((accel_float.x)/GRAVITY); // asin(acc_x)
+ ahrs_float.ltp_to_imu_euler.psi = 0;
+#else
+ ahrs_float.ltp_to_imu_euler.phi = atan2(DCM_Matrix[2][1],DCM_Matrix[2][2]);
+ ahrs_float.ltp_to_imu_euler.theta = -asin(DCM_Matrix[2][0]);
+ ahrs_float.ltp_to_imu_euler.psi = atan2(DCM_Matrix[1][0],DCM_Matrix[0][0]);
+ ahrs_float.ltp_to_imu_euler.psi += M_PI; // Rotating the angle 180deg to fit for PPRZ
+#endif
+}
+
+/*
+ * Compute body orientation and rates from imu orientation and rates
+ */
+static inline void compute_body_orientation_and_rates(void) {
+
+ FLOAT_QUAT_COMP_INV(ahrs_float.ltp_to_body_quat,
+ ahrs_float.ltp_to_imu_quat, ahrs_impl.body_to_imu_quat);
+ FLOAT_RMAT_COMP_INV(ahrs_float.ltp_to_body_rmat,
+ ahrs_float.ltp_to_imu_rmat, ahrs_impl.body_to_imu_rmat);
+ FLOAT_EULERS_OF_RMAT(ahrs_float.ltp_to_body_euler, ahrs_float.ltp_to_body_rmat);
+ FLOAT_RMAT_TRANSP_RATEMULT(ahrs_float.body_rate, ahrs_impl.body_to_imu_rmat, ahrs_float.imu_rate);
+
+}
diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h
new file mode 100644
index 0000000000..6bf2551539
--- /dev/null
+++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h
@@ -0,0 +1,69 @@
+/*
+ * Released under Creative Commons License
+ *
+ * 2010 The Paparazzi Team
+ *
+ *
+ * Based on Code by Jordi Munoz and William Premerlani, Supported by Chris Anderson (Wired) and Nathan Sindle (SparkFun).
+ * Version 1.0 for flat board updated by Doug Weibel and Jose Julio
+ *
+ * Modified at Hochschule Bremen, Germany
+ * 2010 Heinrich Warmers, Christoph Niemann, Oliver Riesener
+ *
+ */
+
+/** \file ahrs_float_dcm.h
+ * \brief Attitude estimation for fixedwings based on the DCM
+ * Theory: http://code.google.com/p/gentlenav/downloads/list file DCMDraft2.pdf
+ *
+ */
+
+#ifndef AHRS_FLOAT_DCM_H
+#define AHRS_FLOAT_DCM_H
+
+#include
+#include "math/pprz_algebra_float.h"
+
+struct AhrsFloatDCM {
+ struct FloatRates gyro_bias;
+ struct FloatRates rate_correction;
+ /*
+ Holds float version of IMU alignement
+ in order to be able to run against the fixed point
+ version of the IMU
+ */
+ struct FloatQuat body_to_imu_quat;
+ struct FloatRMat body_to_imu_rmat;
+};
+extern struct AhrsFloatDCM ahrs_impl;
+
+extern float ins_roll_neutral;
+extern float ins_pitch_neutral;
+
+void ahrs_update_fw_estimator(void);
+
+// DCM Parameters
+
+//#define Kp_ROLLPITCH 0.2
+#define Kp_ROLLPITCH 0.015
+#define Ki_ROLLPITCH 0.000010
+#define Kp_YAW 1.2 //High yaw drift correction gain - use with caution!
+#define Ki_YAW 0.00005
+
+#define GRAVITY 9.81
+
+
+#define OUTPUTMODE 1
+// Mode 0 = DCM integration without Ki gyro bias
+// Mode 1 = DCM integration with Kp and Ki
+// Mode 2 = direct accelerometer -> euler
+
+
+#define PERFORMANCE_REPORTING 0
+#if PERFORMANCE_REPORTING == 1
+extern int renorm_sqrt_count;
+extern int renorm_blowup_count;
+extern float imu_health;
+#endif
+
+#endif // AHRS_FLOAT_DCM_H
diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm_algebra.h b/sw/airborne/subsystems/ahrs/ahrs_float_dcm_algebra.h
new file mode 100644
index 0000000000..c639ad12b1
--- /dev/null
+++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm_algebra.h
@@ -0,0 +1,57 @@
+//Algebra helper functions for DCM
+
+static inline float Vector_Dot_Product(float vector1[3],float vector2[3])
+{
+ return vector1[0]*vector2[0] + vector1[1]*vector2[1] + vector1[2]*vector2[2];
+}
+
+static inline void Vector_Cross_Product(float vectorOut[3], float v1[3],float v2[3])
+{
+ vectorOut[0]= (v1[1]*v2[2]) - (v1[2]*v2[1]);
+ vectorOut[1]= (v1[2]*v2[0]) - (v1[0]*v2[2]);
+ vectorOut[2]= (v1[0]*v2[1]) - (v1[1]*v2[0]);
+}
+
+static inline void Vector_Scale(float vectorOut[3],float vectorIn[3], float scale2)
+{
+ vectorOut[0]=vectorIn[0]*scale2;
+ vectorOut[1]=vectorIn[1]*scale2;
+ vectorOut[2]=vectorIn[2]*scale2;
+}
+
+static inline void Vector_Add(float vectorOut[3],float vectorIn1[3], float vectorIn2[3])
+{
+ vectorOut[0]=vectorIn1[0]+vectorIn2[0];
+ vectorOut[1]=vectorIn1[1]+vectorIn2[1];
+ vectorOut[2]=vectorIn1[2]+vectorIn2[2];
+}
+
+/*
+ #define Matrix_Multiply( _m_a2b, _m_b2c, _m_a2c) { \
+ _m_a2c[0] = (_m_b2c[0]*_m_a2b[0] + _m_b2c[1]*_m_a2b[3] + _m_b2c[2]*_m_a2b[6]); \
+ _m_a2c[1] = (_m_b2c[0]*_m_a2b[1] + _m_b2c[1]*_m_a2b[4] + _m_b2c[2]*_m_a2b[7]); \
+ _m_a2c[2] = (_m_b2c[0]*_m_a2b[2] + _m_b2c[1]*_m_a2b[5] + _m_b2c[2]*_m_a2b[8]); \
+ _m_a2c[3] = (_m_b2c[3]*_m_a2b[0] + _m_b2c[4]*_m_a2b[3] + _m_b2c[5]*_m_a2b[6]); \
+ _m_a2c[4] = (_m_b2c[3]*_m_a2b[1] + _m_b2c[4]*_m_a2b[4] + _m_b2c[5]*_m_a2b[7]); \
+ _m_a2c[5] = (_m_b2c[3]*_m_a2b[2] + _m_b2c[4]*_m_a2b[5] + _m_b2c[5]*_m_a2b[8]); \
+ _m_a2c[6] = (_m_b2c[6]*_m_a2b[0] + _m_b2c[7]*_m_a2b[3] + _m_b2c[8]*_m_a2b[6]); \
+ _m_a2c[7] = (_m_b2c[6]*_m_a2b[1] + _m_b2c[7]*_m_a2b[4] + _m_b2c[8]*_m_a2b[7]); \
+ _m_a2c[8] = (_m_b2c[6]*_m_a2b[2] + _m_b2c[7]*_m_a2b[5] + _m_b2c[8]*_m_a2b[8]); \
+ }
+*/
+
+static inline void Matrix_Multiply(float a[3][3], float b[3][3],float mat[3][3])
+{
+ float op[3];
+ for(int x=0; x<3; x++)
+ {
+ for(int y=0; y<3; y++)
+ {
+ for(int w=0; w<3; w++)
+ {
+ op[w]=a[x][w]*b[w][y];
+ }
+ mat[x][y]=op[0]+op[1]+op[2];
+ }
+ }
+}
diff --git a/sw/airborne/subsystems/electrical.c b/sw/airborne/subsystems/electrical.c
new file mode 100644
index 0000000000..e80426f697
--- /dev/null
+++ b/sw/airborne/subsystems/electrical.c
@@ -0,0 +1,51 @@
+#include "subsystems/electrical.h"
+
+#include "mcu_periph/adc.h"
+#include "commands.h"
+
+#include "generated/airframe.h"
+#include BOARD_CONFIG
+
+struct Electrical electrical;
+
+static struct {
+ struct adc_buf vsupply_adc_buf;
+#ifdef ADC_CHANNEL_CURRENT
+ struct adc_buf current_adc_buf;
+#endif
+} electrical_priv;
+
+#ifndef VoltageOfAdc
+#define VoltageOfAdc(adc) DefaultVoltageOfAdc(adc)
+#endif
+#ifndef MilliAmpereOfAdc
+#define MilliAmpereOfAdc(adc) DefaultMilliAmpereOfAdc(adc)
+#endif
+
+
+void electrical_init(void) {
+ electrical.vsupply = 0;
+ electrical.current = 0;
+
+ adc_buf_channel(ADC_CHANNEL_VSUPPLY, &electrical_priv.vsupply_adc_buf, DEFAULT_AV_NB_SAMPLE);
+#ifdef ADC_CHANNEL_CURRENT
+ adc_buf_channel(ADC_CHANNEL_CURRENT, &electrical_priv.current_adc_buf, DEFAULT_AV_NB_SAMPLE);
+#endif
+}
+
+void electrical_periodic(void) {
+#ifndef SITL
+ electrical.vsupply = VoltageOfAdc((10*(electrical_priv.vsupply_adc_buf.sum/electrical_priv.vsupply_adc_buf.av_nb_sample)));
+#endif
+
+#ifdef ADC_CHANNEL_CURRENT
+#ifndef SITL
+ electrical.current = MilliAmpereOfAdc((electrical_priv.current_adc_buf.sum/electrical_priv.current_adc_buf.av_nb_sample));
+#endif
+#else
+#if defined MILLIAMP_AT_FULL_THROTTLE && defined COMMAND_THROTTLE
+ electrical.current = ((float)commands[COMMAND_THROTTLE]) * ((float)MILLIAMP_AT_FULL_THROTTLE) / ((float)MAX_PPRZ);
+#endif
+#endif /* ADC_CHANNEL_CURRENT */
+
+}
diff --git a/sw/airborne/subsystems/electrical.h b/sw/airborne/subsystems/electrical.h
new file mode 100644
index 0000000000..c36cea22b3
--- /dev/null
+++ b/sw/airborne/subsystems/electrical.h
@@ -0,0 +1,18 @@
+#ifndef SUBSYSTEMS_ELECTRICAL_H
+#define SUBSYSTEMS_ELECTRICAL_H
+
+#include "std.h"
+
+struct Electrical {
+
+ uint8_t vsupply; /* supply in decivolts */
+ int32_t current; /* current in miliamps */
+
+};
+
+extern struct Electrical electrical;
+
+extern void electrical_init(void);
+extern void electrical_periodic(void);
+
+#endif /* SUBSYSTEMS_ELECTRICAL_H */
diff --git a/sw/airborne/subsystems/imu.c b/sw/airborne/subsystems/imu.c
index b41aeaa53f..e6baede3e8 100644
--- a/sw/airborne/subsystems/imu.c
+++ b/sw/airborne/subsystems/imu.c
@@ -23,8 +23,6 @@
#include "subsystems/imu.h"
-#include "generated/airframe.h"
-
struct Imu imu;
void imu_init(void) {
@@ -32,6 +30,7 @@ void imu_init(void) {
/* initialises neutrals */
RATES_ASSIGN(imu.gyro_neutral, IMU_GYRO_P_NEUTRAL, IMU_GYRO_Q_NEUTRAL, IMU_GYRO_R_NEUTRAL);
VECT3_ASSIGN(imu.accel_neutral, IMU_ACCEL_X_NEUTRAL, IMU_ACCEL_Y_NEUTRAL, IMU_ACCEL_Z_NEUTRAL);
+ //FIXME should not assume that every imu has a mag and this id defined?
VECT3_ASSIGN(imu.mag_neutral, IMU_MAG_X_NEUTRAL, IMU_MAG_Y_NEUTRAL, IMU_MAG_Z_NEUTRAL);
/*
diff --git a/sw/airborne/subsystems/imu.h b/sw/airborne/subsystems/imu.h
index cffa2b6f4a..57d1c4135c 100644
--- a/sw/airborne/subsystems/imu.h
+++ b/sw/airborne/subsystems/imu.h
@@ -26,6 +26,7 @@
#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
+#include "generated/airframe.h"
/* must be defined by underlying hardware */
extern void imu_impl_init(void);
diff --git a/sw/airborne/subsystems/imu/imu_analog.c b/sw/airborne/subsystems/imu/imu_analog.c
new file mode 100644
index 0000000000..91727c687f
--- /dev/null
+++ b/sw/airborne/subsystems/imu/imu_analog.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 The Paparazzi Team
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "imu_analog.h"
+#include "mcu_periph/adc.h"
+#include "mcu_periph/uart.h"
+
+volatile bool_t analog_imu_available;
+
+static struct adc_buf analog_imu_adc_buf[NB_ANALOG_IMU_ADC];
+
+void imu_impl_init(void) {
+
+ analog_imu_available = FALSE;
+
+ adc_buf_channel(ADC_CHANNEL_GYRO_P, &analog_imu_adc_buf[0], ADC_CHANNEL_GYRO_NB_SAMPLES);
+ adc_buf_channel(ADC_CHANNEL_GYRO_Q, &analog_imu_adc_buf[1], ADC_CHANNEL_GYRO_NB_SAMPLES);
+ adc_buf_channel(ADC_CHANNEL_GYRO_R, &analog_imu_adc_buf[2], ADC_CHANNEL_GYRO_NB_SAMPLES);
+ adc_buf_channel(ADC_CHANNEL_ACCEL_X, &analog_imu_adc_buf[3], ADC_CHANNEL_ACCEL_NB_SAMPLES);
+ adc_buf_channel(ADC_CHANNEL_ACCEL_Y, &analog_imu_adc_buf[4], ADC_CHANNEL_ACCEL_NB_SAMPLES);
+ adc_buf_channel(ADC_CHANNEL_ACCEL_Z, &analog_imu_adc_buf[5], ADC_CHANNEL_ACCEL_NB_SAMPLES);
+
+}
+
+void imu_periodic(void) {
+ imu.gyro_unscaled.p = analog_imu_adc_buf[0].sum / ADC_CHANNEL_GYRO_NB_SAMPLES;
+ imu.gyro_unscaled.q = analog_imu_adc_buf[1].sum / ADC_CHANNEL_GYRO_NB_SAMPLES;
+ imu.gyro_unscaled.r = analog_imu_adc_buf[2].sum / ADC_CHANNEL_GYRO_NB_SAMPLES;
+ imu.accel_unscaled.x = analog_imu_adc_buf[3].sum / ADC_CHANNEL_ACCEL_NB_SAMPLES;
+ imu.accel_unscaled.y = analog_imu_adc_buf[4].sum / ADC_CHANNEL_ACCEL_NB_SAMPLES;
+ imu.accel_unscaled.z = analog_imu_adc_buf[5].sum / ADC_CHANNEL_ACCEL_NB_SAMPLES;
+
+ analog_imu_available = TRUE;
+}
diff --git a/sw/airborne/subsystems/imu/imu_analog.h b/sw/airborne/subsystems/imu/imu_analog.h
new file mode 100644
index 0000000000..c0ef110251
--- /dev/null
+++ b/sw/airborne/subsystems/imu/imu_analog.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 The Paparazzi Team
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef IMU_ANALOG_H
+#define IMU_ANALOG_H
+
+#include "subsystems/imu.h"
+
+#define NB_ANALOG_IMU_ADC 6
+
+extern volatile bool_t analog_imu_available;
+
+#define ImuEvent(_gyro_accel_handler, _mag_handler) { \
+ if (analog_imu_available) { \
+ analog_imu_available = FALSE; \
+ _gyro_accel_handler(); \
+ } \
+ ImuMagEvent(_mag_handler); \
+ }
+
+#define ImuMagEvent(_mag_handler) { \
+ if (0) { \
+ _mag_handler(); \
+ } \
+ }
+
+
+
+
+#endif /* IMU_ANALOG_H */
diff --git a/sw/airborne/subsystems/imu/imu_aspirin.c b/sw/airborne/subsystems/imu/imu_aspirin.c
index f57aef4dfc..887bd724c8 100644
--- a/sw/airborne/subsystems/imu/imu_aspirin.c
+++ b/sw/airborne/subsystems/imu/imu_aspirin.c
@@ -1,6 +1,6 @@
#include "subsystems/imu.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
struct ImuAspirin imu_aspirin;
diff --git a/sw/airborne/subsystems/imu/imu_aspirin.h b/sw/airborne/subsystems/imu/imu_aspirin.h
index ea13d0a6d8..740fad584c 100644
--- a/sw/airborne/subsystems/imu/imu_aspirin.h
+++ b/sw/airborne/subsystems/imu/imu_aspirin.h
@@ -27,7 +27,7 @@
#include "generated/airframe.h"
#include "subsystems/imu.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "peripherals/itg3200.h"
#include "peripherals/hmc5843.h"
#include "peripherals/adxl345.h"
diff --git a/sw/airborne/subsystems/ins.c b/sw/airborne/subsystems/ins.c
index 779fec6f0c..df47371b6f 100644
--- a/sw/airborne/subsystems/ins.c
+++ b/sw/airborne/subsystems/ins.c
@@ -1,8 +1,5 @@
/*
- * $Id$
- *
- * Copyright (C) 2008-2009 Antoine Drouin
- * Copyright (C) 2009 Felix Ruess
+ * Copyright (C) 2008-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -25,7 +22,7 @@
#include "subsystems/ins.h"
#include "subsystems/imu.h"
-#include "firmwares/rotorcraft/baro.h"
+#include "subsystems/sensors/baro.h"
#include "booz_gps.h"
#include "generated/airframe.h"
diff --git a/sw/airborne/subsystems/ins.h b/sw/airborne/subsystems/ins.h
index 9296453cf7..d2d374c121 100644
--- a/sw/airborne/subsystems/ins.h
+++ b/sw/airborne/subsystems/ins.h
@@ -1,7 +1,5 @@
/*
- * $Id$
- *
- * Copyright (C) 2008-2009 Antoine Drouin
+ * Copyright (C) 2008-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
diff --git a/sw/airborne/nav.c b/sw/airborne/subsystems/nav.c
similarity index 99%
rename from sw/airborne/nav.c
rename to sw/airborne/subsystems/nav.c
index f1ae2f0387..7e644c2478 100644
--- a/sw/airborne/nav.c
+++ b/sw/airborne/subsystems/nav.c
@@ -21,7 +21,7 @@
* Boston, MA 02111-1307, USA.
*
*/
-/** \file nav.c
+/** \file subsystems/nav.c
* \brief Regroup functions to compute navigation
*
*/
@@ -30,14 +30,14 @@
#include
-#include "nav.h"
+#include "subsystems/nav.h"
#include "gps.h"
#include "estimator.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "firmwares/fixedwing/autopilot.h"
#include "inter_mcu.h"
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
#include "latlong.h"
#define RCLost() bit_is_set(fbw_state->status, RADIO_REALLY_LOST)
@@ -362,7 +362,7 @@ void nav_route_xy(float last_wp_x, float last_wp_y, float wp_x, float wp_y) {
fly_to_xy(last_wp_x + nav_leg_progress*leg_x +nav_shift*leg_y/nav_leg_length, last_wp_y + nav_leg_progress*leg_y-nav_shift*leg_x/nav_leg_length);
}
-#include "common_nav.c"
+#include "subsystems/navigation/common_nav.c"
#ifndef FAILSAFE_HOME_RADIUS
#define FAILSAFE_HOME_RADIUS DEFAULT_CIRCLE_RADIUS
diff --git a/sw/airborne/nav.h b/sw/airborne/subsystems/nav.h
similarity index 98%
rename from sw/airborne/nav.h
rename to sw/airborne/subsystems/nav.h
index 8aa4286220..1594b9f81f 100644
--- a/sw/airborne/nav.h
+++ b/sw/airborne/subsystems/nav.h
@@ -35,8 +35,8 @@
#include "std.h"
#include "paparazzi.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
-#include "nav_survey_rectangle.h"
-#include "common_nav.h"
+#include "subsystems/navigation/nav_survey_rectangle.h"
+#include "subsystems/navigation/common_nav.h"
#define G 9.806
#define Square(_x) ((_x)*(_x))
diff --git a/sw/airborne/OSAMNav.c b/sw/airborne/subsystems/navigation/OSAMNav.c
similarity index 99%
rename from sw/airborne/OSAMNav.c
rename to sw/airborne/subsystems/navigation/OSAMNav.c
index 1186a4abb3..efd1c72099 100644
--- a/sw/airborne/OSAMNav.c
+++ b/sw/airborne/subsystems/navigation/OSAMNav.c
@@ -1,4 +1,4 @@
-#include "OSAMNav.h"
+#include "subsystems/navigation/OSAMNav.h"
/************** Flower Navigation **********************************************/
@@ -365,6 +365,9 @@ bool_t InitializePolygonSurvey(uint8_t EntryWP, uint8_t Size, float sw, float Or
CSurveyStatus = Init;
+ if (Size == 0)
+ return TRUE;
+
//Don't initialize if Polygon is too big or if the orientation is not between 0 and 90
if(Size <= PolygonSize && Orientation >= -90 && Orientation <= 90)
{
diff --git a/sw/airborne/OSAMNav.h b/sw/airborne/subsystems/navigation/OSAMNav.h
similarity index 98%
rename from sw/airborne/OSAMNav.h
rename to sw/airborne/subsystems/navigation/OSAMNav.h
index 86528dc341..e98813e858 100644
--- a/sw/airborne/OSAMNav.h
+++ b/sw/airborne/subsystems/navigation/OSAMNav.h
@@ -2,7 +2,7 @@
#define OSAMNav_H
#include "std.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "estimator.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
diff --git a/sw/airborne/bomb.c b/sw/airborne/subsystems/navigation/bomb.c
similarity index 98%
rename from sw/airborne/bomb.c
rename to sw/airborne/subsystems/navigation/bomb.c
index c39b7f11a5..733109994c 100644
--- a/sw/airborne/bomb.c
+++ b/sw/airborne/subsystems/navigation/bomb.c
@@ -23,8 +23,8 @@
*/
#include "estimator.h"
-#include "nav.h"
-#include "bomb.h"
+#include "subsystems/nav.h"
+#include "subsystems/navigation/bomb.h"
#include "generated/flight_plan.h"
#include "generated/airframe.h"
#include "inter_mcu.h"
diff --git a/sw/airborne/bomb.h b/sw/airborne/subsystems/navigation/bomb.h
similarity index 100%
rename from sw/airborne/bomb.h
rename to sw/airborne/subsystems/navigation/bomb.h
diff --git a/sw/airborne/common_nav.c b/sw/airborne/subsystems/navigation/common_nav.c
similarity index 98%
rename from sw/airborne/common_nav.c
rename to sw/airborne/subsystems/navigation/common_nav.c
index c553a6f0d5..8a6551fa5b 100644
--- a/sw/airborne/common_nav.c
+++ b/sw/airborne/subsystems/navigation/common_nav.c
@@ -22,7 +22,7 @@
*
*/
-#include "common_nav.h"
+#include "subsystems/navigation/common_nav.h"
#include "estimator.h"
#include "generated/flight_plan.h"
#include "gps.h"
diff --git a/sw/airborne/common_nav.h b/sw/airborne/subsystems/navigation/common_nav.h
similarity index 100%
rename from sw/airborne/common_nav.h
rename to sw/airborne/subsystems/navigation/common_nav.h
diff --git a/sw/airborne/discsurvey.c b/sw/airborne/subsystems/navigation/discsurvey.c
similarity index 96%
rename from sw/airborne/discsurvey.c
rename to sw/airborne/subsystems/navigation/discsurvey.c
index 9dd9f25135..1bd817d43e 100644
--- a/sw/airborne/discsurvey.c
+++ b/sw/airborne/subsystems/navigation/discsurvey.c
@@ -1,9 +1,9 @@
-#include "discsurvey.h"
+#include "subsystems/navigation/discsurvey.h"
#include "generated/airframe.h"
#include "estimator.h"
#include "std.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "generated/flight_plan.h"
#include "ap_downlink.h"
diff --git a/sw/airborne/discsurvey.h b/sw/airborne/subsystems/navigation/discsurvey.h
similarity index 100%
rename from sw/airborne/discsurvey.h
rename to sw/airborne/subsystems/navigation/discsurvey.h
diff --git a/sw/airborne/flightzone.c b/sw/airborne/subsystems/navigation/flightzone.c
similarity index 100%
rename from sw/airborne/flightzone.c
rename to sw/airborne/subsystems/navigation/flightzone.c
diff --git a/sw/airborne/flightzone.h b/sw/airborne/subsystems/navigation/flightzone.h
similarity index 100%
rename from sw/airborne/flightzone.h
rename to sw/airborne/subsystems/navigation/flightzone.h
diff --git a/sw/airborne/nav_cube.c b/sw/airborne/subsystems/navigation/nav_cube.c
similarity index 98%
rename from sw/airborne/nav_cube.c
rename to sw/airborne/subsystems/navigation/nav_cube.c
index 2db1f53a37..827d94bf99 100644
--- a/sw/airborne/nav_cube.c
+++ b/sw/airborne/subsystems/navigation/nav_cube.c
@@ -28,8 +28,8 @@
*/
#include "generated/airframe.h"
-#include "nav_cube.h"
-#include "nav.h"
+#include "subsystems/navigation/nav_cube.h"
+#include "subsystems/nav.h"
#include "generated/flight_plan.h"
int32_t cube_alpha;
diff --git a/sw/airborne/nav_cube.h b/sw/airborne/subsystems/navigation/nav_cube.h
similarity index 100%
rename from sw/airborne/nav_cube.h
rename to sw/airborne/subsystems/navigation/nav_cube.h
diff --git a/sw/airborne/nav_line.c b/sw/airborne/subsystems/navigation/nav_line.c
similarity index 98%
rename from sw/airborne/nav_line.c
rename to sw/airborne/subsystems/navigation/nav_line.c
index dc18c7730d..961d39a683 100644
--- a/sw/airborne/nav_line.c
+++ b/sw/airborne/subsystems/navigation/nav_line.c
@@ -28,8 +28,8 @@
*/
#include "generated/airframe.h"
-#include "nav_line.h"
-#include "nav.h"
+#include "subsystems/navigation/nav_line.h"
+#include "subsystems/nav.h"
/** Status along the pattern */
enum line_status { LR12, LQC21, LTC2, LQC22, LR21, LQC12, LTC1, LQC11 };
diff --git a/sw/airborne/nav_line.h b/sw/airborne/subsystems/navigation/nav_line.h
similarity index 100%
rename from sw/airborne/nav_line.h
rename to sw/airborne/subsystems/navigation/nav_line.h
diff --git a/sw/airborne/nav_survey_rectangle.c b/sw/airborne/subsystems/navigation/nav_survey_rectangle.c
similarity index 99%
rename from sw/airborne/nav_survey_rectangle.c
rename to sw/airborne/subsystems/navigation/nav_survey_rectangle.c
index e202530733..ef50181871 100644
--- a/sw/airborne/nav_survey_rectangle.c
+++ b/sw/airborne/subsystems/navigation/nav_survey_rectangle.c
@@ -1,4 +1,4 @@
-#include "nav_survey_rectangle.h"
+#include "subsystems/navigation/nav_survey_rectangle.h"
#include "estimator.h"
static struct point survey_from;
diff --git a/sw/airborne/nav_survey_rectangle.h b/sw/airborne/subsystems/navigation/nav_survey_rectangle.h
similarity index 95%
rename from sw/airborne/nav_survey_rectangle.h
rename to sw/airborne/subsystems/navigation/nav_survey_rectangle.h
index ce14d2ea0b..21b8f07c3d 100644
--- a/sw/airborne/nav_survey_rectangle.h
+++ b/sw/airborne/subsystems/navigation/nav_survey_rectangle.h
@@ -3,7 +3,7 @@
#ifndef NAV_SURVEY_RECTANGLE_H
#define NAV_SURVEY_RECTANGLE_H
-#include "nav.h"
+#include "subsystems/nav.h"
typedef enum {NS, WE} survey_orientation_t;
diff --git a/sw/airborne/snav.c b/sw/airborne/subsystems/navigation/snav.c
similarity index 98%
rename from sw/airborne/snav.c
rename to sw/airborne/subsystems/navigation/snav.c
index a344b38fd9..1d08b189b7 100644
--- a/sw/airborne/snav.c
+++ b/sw/airborne/subsystems/navigation/snav.c
@@ -3,9 +3,9 @@
#include
#include "generated/airframe.h"
-#include "snav.h"
+#include "subsystems/navigation/snav.h"
#include "estimator.h"
-#include "nav.h"
+#include "subsystems/nav.h"
#include "gps.h"
#define Sign(_x) ((_x) > 0 ? 1 : (-1))
diff --git a/sw/airborne/snav.h b/sw/airborne/subsystems/navigation/snav.h
similarity index 100%
rename from sw/airborne/snav.h
rename to sw/airborne/subsystems/navigation/snav.h
diff --git a/sw/airborne/traffic_info.c b/sw/airborne/subsystems/navigation/traffic_info.c
similarity index 96%
rename from sw/airborne/traffic_info.c
rename to sw/airborne/subsystems/navigation/traffic_info.c
index 830e37bb8d..f2e396b44f 100644
--- a/sw/airborne/traffic_info.c
+++ b/sw/airborne/subsystems/navigation/traffic_info.c
@@ -27,7 +27,7 @@
*/
#include
-#include "traffic_info.h"
+#include "subsystems/navigation/traffic_info.h"
#include "generated/airframe.h"
uint8_t acs_idx;
diff --git a/sw/airborne/traffic_info.h b/sw/airborne/subsystems/navigation/traffic_info.h
similarity index 100%
rename from sw/airborne/traffic_info.h
rename to sw/airborne/subsystems/navigation/traffic_info.h
diff --git a/sw/airborne/subsystems/radio_control/joby.h b/sw/airborne/subsystems/radio_control/joby.h
index b7640e7991..2b57661e9c 100644
--- a/sw/airborne/subsystems/radio_control/joby.h
+++ b/sw/airborne/subsystems/radio_control/joby.h
@@ -26,7 +26,7 @@
#define RADIO_CONTROL_JOBY_H
#include "std.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#define RC_JOBY_MAGIC_START 13999
diff --git a/sw/airborne/subsystems/radio_control/spektrum_dx7se.h b/sw/airborne/subsystems/radio_control/spektrum_dx7se.h
index f0016291e7..05cbd55c56 100644
--- a/sw/airborne/subsystems/radio_control/spektrum_dx7se.h
+++ b/sw/airborne/subsystems/radio_control/spektrum_dx7se.h
@@ -24,7 +24,8 @@
#ifndef RADIO_CONTROL_SPEKTRUM_DX7SE_H
#define RADIO_CONTROL_SPEKTRUM_DX7SE_H
-#define RADIO_NB_CHANNEL 7
+#define RADIO_CONTROL_NB_CHANNEL 7
+
#define RADIO_ROLL 0
#define RADIO_THROTTLE 1
#define RADIO_PITCH 2
diff --git a/sw/airborne/firmwares/rotorcraft/baro.h b/sw/airborne/subsystems/sensors/baro.h
similarity index 73%
rename from sw/airborne/firmwares/rotorcraft/baro.h
rename to sw/airborne/subsystems/sensors/baro.h
index 2523823087..8c5669060f 100644
--- a/sw/airborne/firmwares/rotorcraft/baro.h
+++ b/sw/airborne/subsystems/sensors/baro.h
@@ -23,12 +23,12 @@
/*
*
- * Brief: common baro for a rotorcraft firmware
+ * Brief: common barometric sensor implementation
*
*/
-#ifndef ROTORCRAFT_BARO_H
-#define ROTORCRAFT_BARO_H
+#ifndef SUBSYSTEMS_SENSORS_BARO_H
+#define SUBSYSTEMS_SENSORS_BARO_H
#include
@@ -37,6 +37,7 @@ enum BaroStatus {
BS_RUNNING
};
+/* pressure in which units ? */
struct Baro {
int32_t absolute;
int32_t differential;
@@ -45,20 +46,12 @@ struct Baro {
extern struct Baro baro;
-#if 0
#include BOARD_CONFIG
-#define BOARD_MODEL_BOOZ 0
-#define BOARD_MODEL_LISA_L 1
-#if defined BOARD_MODEL && BOARD_MODEL==BOARD_MODEL_BOOZ
-#include "boards/booz/baro_board.h"
-#elsif defined BOARD_MODEL && BOARD_MODEL==BOARD_MODEL_LISA_L
-#include "boards/lisa_l/baro_board.h"
-#endif
-#else /* 0 */
+#if defined BOARD_HAS_BARO
#include "baro_board.h"
-#endif /* 0 */
+#endif
extern void baro_init(void);
extern void baro_periodic(void);
-#endif /* ROTORCRAFT_BARO_H */
+#endif /* SUBSYSTEMS_SENSORS_BARO_H */
diff --git a/sw/airborne/infrared.c b/sw/airborne/subsystems/sensors/infrared.c
similarity index 65%
rename from sw/airborne/infrared.c
rename to sw/airborne/subsystems/sensors/infrared.c
index 543de22d11..c90784dd89 100644
--- a/sw/airborne/infrared.c
+++ b/sw/airborne/subsystems/sensors/infrared.c
@@ -1,7 +1,7 @@
/*
- * Paparazzi mcu0 $Id$
+ * $Id$
*
- * Copyright (C) 2003 Pascal Brisset, Antoine Drouin
+ * Copyright (C) 2003-2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -21,7 +21,8 @@
* Boston, MA 02111-1307, USA.
*
*/
-/** \file infrared.c
+
+/** \file subsystems/sensors/infrared.c
* \brief Regroup all functions link to \a ir
*/
@@ -30,36 +31,39 @@
#include
-#include "infrared.h"
-#include "adc.h"
-#include "gps.h"
-#include "firmwares/fixedwing/autopilot.h"
-#include "estimator.h"
-#include "ap_downlink.h"
-#include "sys_time.h"
+#include "subsystems/sensors/infrared.h"
+#include "mcu_periph/adc.h"
+
+#include BOARD_CONFIG
#include "generated/airframe.h"
+
#if defined IR_ESTIMATED_PHI_PI_4 || defined IR_ESTIMATED_PHI_MINUS_PI_4 || defined IR_ESTIMATED_THETA_PI_4
#error "IR_ESTIMATED_PHI_PI_4 correction has been deprecated. Please remove the definition from your airframe config file"
#endif
#ifdef INFRARED
#error "The flag INFRARED has been deprecated. Please replace it with USE_INFRARED."
#endif
+#if defined IR_ADC_ROLL_NEUTRAL || defined IR_ADC_PITCH_NEUTRAL
+#error "Neutrals on ROLL and PITCH deprecated. Please define IR_ADC_IR1_NEUTRAL and IR_ADC_IR2_NEUTRAL"
+#endif
+#ifdef IR_360
+#warning "IR_360 flag deprecated. Now default"
+#endif
+#ifdef IR_360_LATERAL_CORRECTION
+#error "IR_360_LATERAL_CORRECTION now IR_LATERAL_CORRECTION"
+#endif
+
+#ifdef IR_360_LONGITUDINAL_CORRECTION
+#error "IR_360_LONGITUDINAL_CORRECTION now IR_LONGITUDINAL_CORRECTION"
+#endif
+
+#ifdef IR_360_VERTICAL_CORRECTION
+#error "IR_360_VERTICAL_CORRECTION now IR_VERTICAL_CORRECTION"
+#endif
-int16_t ir_ir1;
-int16_t ir_ir2;
-int16_t ir_roll;
-int16_t ir_pitch;
-int16_t ir_top;
-
-float ir_roll_neutral;
-float ir_pitch_neutral;
-
-float ir_correction_left;
-float ir_correction_right;
-float ir_correction_down;
-float ir_correction_up;
+struct Infrared infrared;
#if !defined IR_CORRECTION_LEFT
#define IR_CORRECTION_LEFT 1.
@@ -91,23 +95,6 @@ static struct adc_buf buf_ir_top;
#define ADC_CHANNEL_IR_NB_SAMPLES DEFAULT_AV_NB_SAMPLE
#endif
-float ir_lateral_correction;
-float ir_longitudinal_correction;
-float ir_vertical_correction;
-
-
-#ifdef IR_360_LATERAL_CORRECTION
-#error "IR_360_LATERAL_CORRECTION now IR_LATERAL_CORRECTION"
-#endif
-
-#ifdef IR_360_LONGITUDINAL_CORRECTION
-#error "IR_360_LONGITUDINAL_CORRECTION now IR_LONGITUDINAL_CORRECTION"
-#endif
-
-#ifdef IR_360_VERTICAL_CORRECTION
-#error "IR_360_VERTICAL_CORRECTION now IR_VERTICAL_CORRECTION"
-#endif
-
#ifndef IR_LATERAL_CORRECTION
#define IR_LATERAL_CORRECTION 1.
#endif
@@ -120,57 +107,48 @@ float ir_vertical_correction;
#define IR_VERTICAL_CORRECTION 1.
#endif
-#ifdef IR_360
-#warning "IR_360 flag deprecated. Now default"
-#endif
-
/** \brief Initialisation of \a ir */
/** Initialize \a adc_buf_channel
*/
-void ir_init(void) {
+void infrared_init(void) {
#if ! (defined SITL || defined HITL)
adc_buf_channel(ADC_CHANNEL_IR1, &buf_ir1, ADC_CHANNEL_IR_NB_SAMPLES);
adc_buf_channel(ADC_CHANNEL_IR2, &buf_ir2, ADC_CHANNEL_IR_NB_SAMPLES);
-
#ifdef ADC_CHANNEL_IR_TOP
adc_buf_channel(ADC_CHANNEL_IR_TOP, &buf_ir_top, ADC_CHANNEL_IR_NB_SAMPLES);
#endif
#endif
- ir_roll_neutral = RadOfDeg(IR_ROLL_NEUTRAL_DEFAULT);
- ir_pitch_neutral = RadOfDeg(IR_PITCH_NEUTRAL_DEFAULT);
+ infrared.roll_neutral = RadOfDeg(IR_ROLL_NEUTRAL_DEFAULT);
+ infrared.pitch_neutral = RadOfDeg(IR_PITCH_NEUTRAL_DEFAULT);
- ir_correction_left = IR_CORRECTION_LEFT;
- ir_correction_right = IR_CORRECTION_RIGHT;
- ir_correction_up = IR_CORRECTION_UP;
- ir_correction_down = IR_CORRECTION_DOWN;
+ infrared.correction_left = IR_CORRECTION_LEFT;
+ infrared.correction_right = IR_CORRECTION_RIGHT;
+ infrared.correction_up = IR_CORRECTION_UP;
+ infrared.correction_down = IR_CORRECTION_DOWN;
- ir_lateral_correction = IR_LATERAL_CORRECTION;
- ir_longitudinal_correction = IR_LONGITUDINAL_CORRECTION;
- ir_vertical_correction = IR_VERTICAL_CORRECTION;
+ infrared.lateral_correction = IR_LATERAL_CORRECTION;
+ infrared.longitudinal_correction = IR_LONGITUDINAL_CORRECTION;
+ infrared.vertical_correction = IR_VERTICAL_CORRECTION;
#if ! (defined ADC_CHANNEL_IR_TOP || defined HITL || defined SITL)
- ir_top = IR_DEFAULT_CONTRAST;
+ infrared.top = IR_DEFAULT_CONTRAST;
#endif
}
-#if defined IR_ADC_ROLL_NEUTRAL || defined IR_ADC_PITCH_NEUTRAL
-#error "Neutrals on ROLL and PITCH deprecated. Please define IR_ADC_IR1_NEUTRAL and IR_ADC_IR2_NEUTRAL"
-#endif
-
#ifndef IR_IR1_SIGN
#define IR_IR1_SIGN 1
-#endif // IR_IR1_SIGN
+#endif /* IR_IR1_SIGN */
#ifndef IR_IR2_SIGN
#define IR_IR2_SIGN 1
-#endif // IR_IR2_SIGN
+#endif /* IR_IR2_SIGN */
#ifndef IR_TOP_SIGN
#define IR_TOP_SIGN 1
-#endif // IR_TOP_SIGN
+#endif /* IR_TOP_SIGN */
/* Sensor installation */
#if defined IR_HORIZ_SENSOR_ALIGNED
@@ -195,37 +173,17 @@ void ir_init(void) {
/** \brief Update \a ir_roll and ir_pitch from ADCs or from simulator
* message in HITL and SITL modes
*/
-void ir_update(void) {
+void infrared_update(void) {
#if ! (defined SITL || defined HITL)
- ir_ir1 = (IR_IR1_SIGN)*(buf_ir1.sum/buf_ir1.av_nb_sample - IR_ADC_IR1_NEUTRAL);
- ir_ir2 = (IR_IR2_SIGN)*(buf_ir2.sum/buf_ir2.av_nb_sample - IR_ADC_IR2_NEUTRAL);
- ir_roll = ir_lateral_correction * IR_RollOfIrs(ir_ir1, ir_ir2);
- ir_pitch = ir_longitudinal_correction * IR_PitchOfIrs(ir_ir1, ir_ir2);
+ infrared.ir1 = (IR_IR1_SIGN)*((int32_t)(buf_ir1.sum/buf_ir1.av_nb_sample) - IR_ADC_IR1_NEUTRAL);
+ infrared.ir2 = (IR_IR2_SIGN)*((int32_t)(buf_ir2.sum/buf_ir2.av_nb_sample) - IR_ADC_IR2_NEUTRAL);
+ infrared.roll = infrared.lateral_correction * IR_RollOfIrs(infrared.ir1, infrared.ir2);
+ infrared.pitch = infrared.longitudinal_correction * IR_PitchOfIrs(infrared.ir1, infrared.ir2);
#ifdef ADC_CHANNEL_IR_TOP
- ir_top = ir_vertical_correction * IR_TopOfIr(buf_ir_top.sum/buf_ir_top.av_nb_sample - IR_ADC_TOP_NEUTRAL);
+ infrared.ir3 = (int32_t)(buf_ir_top.sum/buf_ir_top.av_nb_sample) - IR_ADC_TOP_NEUTRAL;
+ infrared.top = infrared.vertical_correction * IR_TopOfIr(infrared.ir3);
#endif // IR_TOP
#endif /* !SITL && !HITL */
/** #else ir_roll set by simulator in sim_ir.c */
}
-void estimator_update_state_infrared( void ) {
- estimator_phi = atan2(ir_roll, ir_top) - ir_roll_neutral;
-
- estimator_theta = atan2(ir_pitch, ir_top) - ir_pitch_neutral;
-
- if (estimator_theta < -M_PI_2)
- estimator_theta += M_PI;
- else if (estimator_theta > M_PI_2)
- estimator_theta -= M_PI;
-
- if (estimator_phi >= 0)
- estimator_phi *= ir_correction_right;
- else
- estimator_phi *= ir_correction_left;
-
- if (estimator_theta >= 0)
- estimator_theta *= ir_correction_up;
- else
- estimator_theta *= ir_correction_down;
-
-}
diff --git a/sw/airborne/subsystems/sensors/infrared.h b/sw/airborne/subsystems/sensors/infrared.h
new file mode 100644
index 0000000000..60a1baf3c8
--- /dev/null
+++ b/sw/airborne/subsystems/sensors/infrared.h
@@ -0,0 +1,67 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2003-2010 The Paparazzi Team
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef SUBSYSTEMS_SENSORS_INFRARED_H
+#define SUBSYSTEMS_SENSORS_INFRARED_H
+
+#include "std.h"
+#include "generated/airframe.h"
+
+struct Infrared {
+ /* the 3 channels of the sensor
+ */
+ int16_t ir1;
+ int16_t ir2;
+ int16_t ir3;
+ /* neutrals in radians
+ */
+ float roll_neutral;
+ float pitch_neutral;
+ float pitch_vneutral;
+ /* roll, pitch, yaw unscaled reading
+ */
+ int16_t roll;
+ int16_t pitch;
+ int16_t top;
+ /* coefficients used to compensate
+ for sensors sensitivity
+ */
+ float lateral_correction;
+ float longitudinal_correction;
+ float vertical_correction;
+ /* coefficients used to compensate
+ for masking
+ */
+ float correction_left;
+ float correction_right;
+ float correction_up;
+ float correction_down;
+};
+
+extern struct Infrared infrared;
+
+void infrared_init(void);
+void infrared_update(void);
+
+#endif /* SUBSYSTEMS_SENSORS_INFRARED_H */
diff --git a/sw/airborne/test/peripherals/test_ami601.c b/sw/airborne/test/peripherals/test_ami601.c
index ad7798b42d..557e3c529d 100644
--- a/sw/airborne/test/peripherals/test_ami601.c
+++ b/sw/airborne/test/peripherals/test_ami601.c
@@ -24,18 +24,17 @@
#include
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "messages.h"
#include "downlink.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "peripherals/ami601.h"
#include "math/pprz_algebra_int.h"
-#include "interrupt_hw.h"
#include "std.h"
static inline void main_init( void );
@@ -55,13 +54,13 @@ int main( void ) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
LED_ON(4);
ami601_init();
- int_enable();
+ mcu_int_enable();
}
static inline void main_periodic_task( void ) {
diff --git a/sw/airborne/test/test_actuators.c b/sw/airborne/test/test_actuators.c
index f3579af913..ce99e5c72f 100644
--- a/sw/airborne/test/test_actuators.c
+++ b/sw/airborne/test/test_actuators.c
@@ -22,11 +22,11 @@
*/
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
#include "booz/booz2_commands.h"
#include "firmwares/rotorcraft/actuators.h"
@@ -47,7 +47,7 @@ int main(void) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
actuators_init();
}
diff --git a/sw/airborne/test/test_adcs.c b/sw/airborne/test/test_adcs.c
index e302b89bc0..0bfd29a3b3 100644
--- a/sw/airborne/test/test_adcs.c
+++ b/sw/airborne/test/test_adcs.c
@@ -3,14 +3,13 @@
*/
-#include "interrupt_hw.h"
#include "std.h"
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
-#include "adc.h"
+#include "mcu_periph/adc.h"
#include "messages.h"
#include "led.h"
-#include "uart.h"
+#include "mcu_periph/uart.h"
#include "downlink.h"
@@ -20,7 +19,7 @@
static struct adc_buf buf_adc[NB_ADC];
int main (int argc, char** argv) {
- hw_init();
+ mcu_init();
sys_time_init();
led_init();
adc_init();
@@ -49,7 +48,7 @@ int main (int argc, char** argv) {
Uart1Init();
#endif
- int_enable();
+ mcu_int_enable();
while(1) {
if (sys_time_periodic()) {
diff --git a/sw/airborne/test/test_esc_asctecv1_simple.c b/sw/airborne/test/test_esc_asctecv1_simple.c
index 8acc668a5e..33e9957a1c 100644
--- a/sw/airborne/test/test_esc_asctecv1_simple.c
+++ b/sw/airborne/test/test_esc_asctecv1_simple.c
@@ -22,11 +22,11 @@
*/
-#include "init_hw.h"
+#include "mcu.h"
#include "sys_time.h"
#include "led.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
static inline void main_init( void );
static inline void main_periodic_task( void );
@@ -47,7 +47,7 @@ int main(void) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
}
diff --git a/sw/airborne/test/test_esc_mkk_simple.c b/sw/airborne/test/test_esc_mkk_simple.c
index 7ab0424bd1..bc0f778bca 100644
--- a/sw/airborne/test/test_esc_mkk_simple.c
+++ b/sw/airborne/test/test_esc_mkk_simple.c
@@ -22,11 +22,11 @@
*/
-#include "init_hw.h"
+#include "mcuw.h"
#include "sys_time.h"
#include "led.h"
-#include "i2c.h"
+#include "mcu_periph/i2c.h"
static inline void main_init( void );
static inline void main_periodic_task( void );
@@ -47,7 +47,7 @@ int main(void) {
}
static inline void main_init( void ) {
- hw_init();
+ mcu_init();
sys_time_init();
}
diff --git a/sw/airborne/test/test_nav.c b/sw/airborne/test/test_nav.c
index d50ace20a1..d3026c2b60 100644
--- a/sw/airborne/test/test_nav.c
+++ b/sw/airborne/test/test_nav.c
@@ -1,5 +1,5 @@
#include
-#include "nav.h"
+#include "subsystems/nav.h"
#define FloatEqual_3(f1, f2) (fabs(f1 - f2) < 1e-3)
diff --git a/sw/ground_segment/cockpit/gcs.ml b/sw/ground_segment/cockpit/gcs.ml
index 2a506587bf..c2d765dd60 100644
--- a/sw/ground_segment/cockpit/gcs.ml
+++ b/sw/ground_segment/cockpit/gcs.ml
@@ -2,7 +2,7 @@
* $Id$
*
* Multi aircrafts map display and flight plan editor
-*
+*
* Copyright (C) 2004-2009 ENAC, Pascal Brisset, Antoine Drouin
*
* This file is part of paparazzi.
@@ -20,7 +20,7 @@
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
-* Boston, MA 02111-1307, USA.
+* Boston, MA 02111-1307, USA.
*
*)
@@ -36,7 +36,7 @@ let default_path_srtm = home // "data" // "srtm"
let default_path_maps = home // "data" // "maps"
let layout_path = home // "conf" // "gcs"
let var_maps_path = home // "var" // "maps"
-let _ =
+let _ =
ignore (Sys.command (sprintf "mkdir -p %s" var_maps_path))
let ign = ref false
@@ -61,32 +61,32 @@ let display_map = fun (geomap:G.widget) xml_map ->
truncate (ExtXml.float_attrib p "x"), truncate (ExtXml.float_attrib p "y") in
let geo_ref = fun p ->
try Latlong.of_string (Xml.attrib p "geo") with
- _ -> (* Compatibility with the old UTM format *)
- let utm_x = ExtXml.float_attrib p "utm_x"
- and utm_y = ExtXml.float_attrib p "utm_y" in
- let utm_zone = ExtXml.int_attrib xml_map "utm_zone" in
- let utm = {utm_x = utm_x; utm_y = utm_y; utm_zone = utm_zone } in
- Latlong.of_utm WGS84 utm in
-
+ _ -> (* Compatibility with the old UTM format *)
+ let utm_x = ExtXml.float_attrib p "utm_x"
+ and utm_y = ExtXml.float_attrib p "utm_y" in
+ let utm_zone = ExtXml.int_attrib xml_map "utm_zone" in
+ let utm = {utm_x = utm_x; utm_y = utm_y; utm_zone = utm_zone } in
+ Latlong.of_utm WGS84 utm in
+
match Xml.children xml_map with
p1::p2::_ ->
- let x1y1 = pix_ref p1
- and x2y2 = pix_ref p2
- and geo1 = geo_ref p1
- and geo2 = geo_ref p2 in
-
- (* Take this point as a reference for the display if none currently *)
- Map2d.set_georef_if_none geomap geo1;
-
- ignore (geomap#display_pixbuf ?opacity ((x1y1),geo1) ((x2y2),geo2) (GdkPixbuf.from_file image));
- geomap#center geo1
+ let x1y1 = pix_ref p1
+ and x2y2 = pix_ref p2
+ and geo1 = geo_ref p1
+ and geo2 = geo_ref p2 in
+
+ (* Take this point as a reference for the display if none currently *)
+ Map2d.set_georef_if_none geomap geo1;
+
+ ignore (geomap#display_pixbuf ?opacity ((x1y1),geo1) ((x2y2),geo2) (GdkPixbuf.from_file image));
+ geomap#center geo1
| _ -> failwith (sprintf "display_map: two ref points required")
with
Xml.File_not_found f ->
GToolbox.message_box "Error" (sprintf "File does not exist: %s" f)
| ExtXml.Error s ->
GToolbox.message_box "Error" (sprintf "Error in XML file: %s" s)
-
+
let load_map = fun (geomap:G.widget) () ->
@@ -104,14 +104,14 @@ let save_map = fun geomap ?(projection=geomap#projection) pixbuf nw se ->
let jpg = Filename.chop_extension xml_file ^ ".png" in
GdkPixbuf.save jpg "png" pixbuf;
let point = fun (x,y) wgs84 ->
- Xml.Element ("point", ["x",soi x;"y",soi y;"geo", Latlong.string_of wgs84], []) in
+ Xml.Element ("point", ["x",soi x;"y",soi y;"geo", Latlong.string_of wgs84], []) in
let width = GdkPixbuf.get_width pixbuf
and height = GdkPixbuf.get_height pixbuf in
let points = [point (0, 0) nw; point (width, height) se] in
- let xml = Xml.Element ("map",
- ["file", Filename.basename jpg;
- "projection", projection],
- points) in
+ let xml = Xml.Element ("map",
+ ["file", Filename.basename jpg;
+ "projection", projection],
+ points) in
let f = open_out xml_file in
Printf.fprintf f "%s\n" (Xml.to_string_fmt xml);
close_out f
@@ -132,7 +132,7 @@ let map_from_region = fun (geomap:G.widget) () ->
let (x0, y0) = geomap#canvas#get_scroll_offsets in
let src_x = xc1 - x0 and src_y = yc1 - y0 in
GdkPixbuf.get_from_drawable ~dest ~width ~height ~src_x ~src_y
- geomap#canvas#misc#window;
+ geomap#canvas#misc#window;
let nw = geomap#of_world (xw1,yw1)
and se = geomap#of_world (xw2,yw2) in
save_map geomap dest nw se
@@ -161,7 +161,7 @@ module TodoList = struct
Mutex.unlock mutex;
f ();
exec_todo_list todo_list
-
+
let add = fun f ->
Mutex.lock mutex;
(** Add the function to the queue *)
@@ -171,36 +171,36 @@ module TodoList = struct
doer := Some (Thread.create exec_todo_list queue);
Mutex.unlock mutex
end
-
+
(************ Google, OSM Maps handling *****************************************)
module GM = struct
(** Fill the visible background with Google, OSM tiles *)
- let fill_tiles = fun geomap ->
+ let fill_tiles = fun geomap ->
TodoList.add (fun () -> MapGoogle.fill_window geomap)
let auto = ref false
let update = fun geomap ->
if !auto then fill_tiles geomap
- let active_auto = fun geomap x ->
+ let active_auto = fun geomap x ->
auto := x;
- update geomap
+ update geomap
(** Creates a calibrated map from the Google, OSM tiles (selected region) *)
let map_from_tiles = fun (geomap:G.widget) () ->
match geomap#region with
None -> GToolbox.message_box "Error" "Select a region (shift-left drag)"
| Some ((xw1,yw1), (xw2,yw2)) ->
- let geo1 = geomap#of_world (xw1,yw1)
- and geo2 = geomap#of_world (xw2,yw2) in
- let sw = { posn_lat = min geo1.posn_lat geo2.posn_lat;
- posn_long = min geo1.posn_long geo2.posn_long }
- and ne = { posn_lat = max geo1.posn_lat geo2.posn_lat;
- posn_long = max geo1.posn_long geo2.posn_long } in
- let pix = MapGoogle.pixbuf sw ne in
- let nw = { posn_lat = ne.posn_lat; posn_long = sw.posn_long }
- and se = { posn_lat = sw.posn_lat; posn_long = ne.posn_long } in
- save_map geomap ~projection:"Mercator" pix nw se
+ let geo1 = geomap#of_world (xw1,yw1)
+ and geo2 = geomap#of_world (xw2,yw2) in
+ let sw = { posn_lat = min geo1.posn_lat geo2.posn_lat;
+ posn_long = min geo1.posn_long geo2.posn_long }
+ and ne = { posn_lat = max geo1.posn_lat geo2.posn_lat;
+ posn_long = max geo1.posn_long geo2.posn_long } in
+ let pix = MapGoogle.pixbuf sw ne in
+ let nw = { posn_lat = ne.posn_lat; posn_long = sw.posn_long }
+ and se = { posn_lat = sw.posn_lat; posn_long = ne.posn_long } in
+ save_map geomap ~projection:"Mercator" pix nw se
end (* GM module *)
let bdortho_size = 400
@@ -219,16 +219,16 @@ let display_bdortho = fun (geomap:G.widget) wgs84 () ->
let nw = of_lambertIIe {lbt_x = lx - r; lbt_y = ly + r}
and se = of_lambertIIe {lbt_x = lx + r; lbt_y = ly - r} in
ignore (geomap#display_pixbuf ((0,0), nw) ((bdortho_size, bdortho_size), se) (GdkPixbuf.from_file f));
-
+
in
if Sys.file_exists f then
display f
else
TodoList.add
- (fun () ->
- let c = sprintf "%s %d %d %d %s" !get_bdortho lx ly r f in
- ignore (Sys.command c);
- display f)
+ (fun () ->
+ let c = sprintf "%s %d %d %d %s" !get_bdortho lx ly r f in
+ ignore (Sys.command c);
+ display f)
end
@@ -252,9 +252,9 @@ let fill_ortho = fun (geomap:G.widget) ->
display_bdortho geomap geo ()
done
done
-
-
+
+
(******* Mouse motion handling **********************************************)
let motion_notify = fun (_geomap:G.widget) _ev -> false
@@ -267,25 +267,25 @@ let button_press = fun (geomap:G.widget) ev ->
let state = GdkEvent.Button.state ev in
if GdkEvent.Button.button ev = 3 then begin
(** Display a tile from Google Maps or IGN *)
- let xc = GdkEvent.Button.x ev
+ let xc = GdkEvent.Button.x ev
and yc = GdkEvent.Button.y ev in
let (xw,yw) = geomap#window_to_world xc yc in
-
+
let wgs84 = geomap#of_world (xw,yw) in
- let display_ign = fun () ->
+ let display_ign = fun () ->
TodoList.add (fun () -> MapIGN.display_tile geomap wgs84)
and display_gm = fun () ->
TodoList.add
- (fun () ->
- try ignore (MapGoogle.display_tile geomap wgs84) with
- Gm.Not_available -> ()) in
-
+ (fun () ->
+ try ignore (MapGoogle.display_tile geomap wgs84) with
+ Gm.Not_available -> ()) in
+
let m = if !ign then [`I ("Load IGN tile", display_ign)] else [] in
let m =
if !get_bdortho <> "" then
- (`I ("Load BDORTHO", display_bdortho geomap wgs84))::m
- else
- m in
+ (`I ("Load BDORTHO", display_bdortho geomap wgs84))::m
+ else
+ m in
GToolbox.popup_menu ~entries:([`I ("Load Google tile", display_gm)]@m)
~button:3 ~time:(Int32.of_int 0);
true
@@ -296,7 +296,7 @@ let button_press = fun (geomap:G.widget) ev ->
let geo = geomap#of_world xyw in
ignore (EditFP.create_wp geomap geo);
true
- else
+ else
false
@@ -372,7 +372,7 @@ let options =
let quit = fun () ->
match GToolbox.question_box ~title:"Leaving GCS" ~buttons:["Quit"; "Cancel"] "Do you want to quit ?" with
1 ->
- GMain.Main.quit ();
+ GMain.Main.quit ();
exit 0
| _ -> ()
@@ -407,16 +407,20 @@ let create_geomap = fun switch_fullscreen editor_frame ->
let callback = fun b -> if b then Gm.set_maps_source maps_source in
let menu_item = maps_source_fact#add_radio_item ~group: !group ~callback (Gm.string_of_maps_source maps_source) in
group := menu_item#group)
- Gm.maps_sources;
+ Gm.maps_sources;
(* Choose the map policy *)
let maps_policy_menu = map_menu_fact#add_submenu "Maps Policy" in
let maps_policy_fact = new GMenu.factory maps_policy_menu in
let group = ref None in
+ (* Determine a decent default selected item *)
+ let active_policy = if Gm.get_policy () = Gm.NoHttp then Gm.NoHttp
+ else Gm.CacheOrHttp in
List.iter
(fun policy ->
let callback = fun b -> if b then Gm.set_policy policy in
- let menu_item = maps_policy_fact#add_radio_item ~group: !group ~callback (Gm.string_of_policy policy) in
+ let active = (policy = active_policy) in
+ let menu_item = maps_policy_fact#add_radio_item ~group: !group ~active ~callback (Gm.string_of_policy policy) in
group := menu_item#group)
Gm.policies;
@@ -434,12 +438,12 @@ let create_geomap = fun switch_fullscreen editor_frame ->
ignore (map_menu_fact#add_item "Map of Region" ~key:GdkKeysyms._R ~callback:(map_from_region geomap));
ignore (map_menu_fact#add_item "Dump map of Tiles" ~key:GdkKeysyms._T ~callback:(GM.map_from_tiles geomap));
ignore (map_menu_fact#add_item "Load sector" ~callback:(Sectors.load geomap));
-
+
(** Connect Google Maps display to view change *)
geomap#connect_view (fun () -> GM.update geomap);
if !auto_ortho then
geomap#connect_view (fun () -> fill_ortho geomap);
-
+
(** Flight plan editing *)
if !edit then begin
let fp_menu = geomap#factory#add_submenu "Edit" in
@@ -469,9 +473,9 @@ let resize = fun (widget:GObj.widget) orientation size ->
match size with
Some size ->
if orientation = `HORIZONTAL then
- widget#misc#set_size_request ~width:size ()
+ widget#misc#set_size_request ~width:size ()
else
- widget#misc#set_size_request ~height:size ()
+ widget#misc#set_size_request ~height:size ()
| None -> ()
@@ -481,15 +485,15 @@ let rec pack_widgets = fun orientation xml widgets packing ->
"widget" ->
let name = ExtXml.attrib xml "name" in
let widget =
- try List.assoc name widgets with
- Not_found -> failwith (sprintf "Unknown widget: '%s'" name)
+ try List.assoc name widgets with
+ Not_found -> failwith (sprintf "Unknown widget: '%s'" name)
in
resize widget orientation size;
packing widget
| "rows" ->
let resize = match size with None -> fun _ -> () | Some width -> fun (x:GObj.widget) -> x#misc#set_size_request ~width () in
pack_list resize `VERTICAL (Xml.children xml) widgets packing
- | "columns" ->
+ | "columns" ->
let resize = match size with None -> fun _ -> () | Some height -> fun (x:GObj.widget) -> x#misc#set_size_request ~height () in
pack_list resize `HORIZONTAL (Xml.children xml) widgets packing
| x -> failwith (sprintf "pack_widgets: %s" x)
@@ -508,10 +512,10 @@ let rec find_widget_children = fun name xml ->
"widget" when ExtXml.attrib xml "name" = name -> xmls
| "rows" | "columns" ->
let rec loop = function
- [] -> raise Not_found
- | x::xs ->
- try find_widget_children name x with
- Not_found -> loop xs in
+ [] -> raise Not_found
+ | x::xs ->
+ try find_widget_children name x with
+ Not_found -> loop xs in
loop xmls
| _ -> raise Not_found
@@ -522,16 +526,16 @@ let rec replace_widget_children = fun name children xml ->
match tag with
"widget" ->
Xml.Element("widget",
- Xml.attribs xml,
- if ExtXml.attrib xml "name" = name then children else xmls)
+ Xml.attribs xml,
+ if ExtXml.attrib xml "name" = name then children else xmls)
| "rows" | "columns" ->
let rec loop = function
- [] -> []
- | x::xs ->
- replace_widget_children name children x :: loop xs in
+ [] -> []
+ | x::xs ->
+ replace_widget_children name children x :: loop xs in
Xml.Element(tag,
- Xml.attribs xml,
- loop xmls)
+ Xml.attribs xml,
+ loop xmls)
| _ -> xml
@@ -587,37 +591,37 @@ let () =
let kill_plugin = fun () ->
match !pid_plugin with
None -> ()
- | Some pid ->
- try
- Unix.kill pid (-9);
- ignore (Unix.waitpid [] pid)
- with _ -> () in
+ | Some pid ->
+ try
+ Unix.kill pid (-9);
+ ignore (Unix.waitpid [] pid)
+ with _ -> () in
let destroy = fun _ ->
kill_plugin ();
exit 0 in
-
+
(** The whole window map2d **)
let window, switch_fullscreen =
match !wid with
None ->
- let icon = GdkPixbuf.from_file Env.icon_file in
- let window = GWindow.window ~icon ~title:"GCS" ~border_width:1 ~width ~height ~allow_shrink:true () in
- if !maximize then
- window#maximize ();
- if !fullscreen then
- window#fullscreen ();
- ignore (window#connect#destroy ~callback:destroy);
- let switch_fullscreen = fun () ->
- fullscreen := not !fullscreen;
- if !fullscreen then
- window#fullscreen ()
- else
- window#unfullscreen () in
- (window:>GWindow.window_skel),switch_fullscreen
+ let icon = GdkPixbuf.from_file Env.icon_file in
+ let window = GWindow.window ~icon ~title:"GCS" ~border_width:1 ~width ~height ~allow_shrink:true () in
+ if !maximize then
+ window#maximize ();
+ if !fullscreen then
+ window#fullscreen ();
+ ignore (window#connect#destroy ~callback:destroy);
+ let switch_fullscreen = fun () ->
+ fullscreen := not !fullscreen;
+ if !fullscreen then
+ window#fullscreen ()
+ else
+ window#unfullscreen () in
+ (window:>GWindow.window_skel),switch_fullscreen
| Some window ->
- (GWindow.plug ~window ~width ~height ():>GWindow.window_skel), fun _ -> () in
-
+ (GWindow.plug ~window ~width ~height ():>GWindow.window_skel), fun _ -> () in
+
(* Editor frame *)
let editor_frame = GBin.frame () in
@@ -641,13 +645,13 @@ let () =
let plugin_width = 400 and plugin_height = 300 in
let plugin_frame = GPack.vbox ~width:plugin_width () in
- let widgets = ["map2d", map_frame#coerce;
- "strips", Strip.scrolled#coerce;
- "aircraft", ac_notebook#coerce;
- "editor", editor_frame#coerce;
- "alarms", alert_page#coerce;
- "altgraph", alt_graph#drawing_area#coerce;
- "plugin", plugin_frame#coerce] in
+ let widgets = ["map2d", map_frame#coerce;
+ "strips", Strip.scrolled#coerce;
+ "aircraft", ac_notebook#coerce;
+ "editor", editor_frame#coerce;
+ "alarms", alert_page#coerce;
+ "altgraph", alt_graph#drawing_area#coerce;
+ "plugin", plugin_frame#coerce] in
let the_layout = ExtXml.child layout "0" in
pack_widgets `HORIZONTAL the_layout widgets window#add;
@@ -668,7 +672,7 @@ let () =
if !mplayer <> "" then
plugin_window := sprintf "mplayer -really-quiet -nomouseinput %s -wid " !mplayer;
- if !plugin_window <> "" then begin
+ if !plugin_window <> "" then begin
if plugin_frame#misc#parent = None then
failwith "Error: \"plugin\" widget required in layout description";
let frame = GBin.event_box ~packing:plugin_frame#add ~width:plugin_width ~height:plugin_height () in
@@ -677,8 +681,8 @@ let () =
let restart = fun () ->
begin match !pid_plugin with
- None -> ()
- | Some p -> try Unix.kill p Sys.sigkill with _ -> ()
+ None -> ()
+ | Some p -> try Unix.kill p Sys.sigkill with _ -> ()
end;
let com = sprintf "exec %s" com in
let dev_null = Unix.descr_of_out_channel (open_out "/dev/null") in
@@ -687,9 +691,9 @@ let () =
restart ();
ignore (menu_fact#add_item "Restart plugin" ~key:GdkKeysyms._P ~callback:restart);
-
+
Plugin.frame := Some frame;
-
+
let swap = fun _ ->
(** Keep the center of the geo canvas *)
let c = geomap#get_center () in
@@ -700,16 +704,16 @@ let () =
child1#misc#reparent plugin_frame#coerce;
(* Strange: the centering does not work if done inside this callback.
- It is postponed to be called by the mainloop(). *)
+ It is postponed to be called by the mainloop(). *)
ignore (GMain.Idle.add (fun () -> geomap#center c; false));
in
let callback = fun ev ->
match GdkEvent.Button.button ev with
- 1 -> swap (); true
+ 1 -> swap (); true
| 3 -> restart (); true
| _ -> false in
-
+
ignore (frame#event#connect#button_press ~callback);
ignore (menu_fact#add_item "Swap plugin/map" ~callback:(fun _ -> swap ()));
end;
diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml
index bf6600882f..6b357416d1 100644
--- a/sw/ground_segment/cockpit/live.ml
+++ b/sw/ground_segment/cockpit/live.ml
@@ -1249,6 +1249,25 @@ let get_ts = fun _sender vs ->
let listen_telemetry_status = fun () ->
safe_bind "TELEMETRY_STATUS" get_ts
+
+let mark_dcshot = fun (geomap:G.widget) _sender vs ->
+ let ac = find_ac !active_ac in
+(* let ac = get_ac vs in *)
+ match ac.track#last with
+ Some geo ->
+ begin
+ let group = geomap#background in
+ let point = geomap#circle ~group ~fill_color:"yellow" geo 3. in
+ point#raise_to_top ()
+ end
+ | None -> ()
+
+(* mark geomap ac.ac_name track !Plugin.frame *)
+
+
+let listen_dcshot = fun _geom ->
+ tele_bind "DC_SHOT" (mark_dcshot _geom)
+
let listen_error = fun a ->
let get_error = fun _sender vs ->
let msg = Pprz.string_assoc "message" vs in
@@ -1292,6 +1311,7 @@ let listen_acs_and_msgs = fun geomap ac_notebook my_alert auto_center_new_ac alt
listen_alert my_alert;
listen_error my_alert;
listen_tcas my_alert;
+ listen_dcshot geomap;
(** Select the active aircraft on notebook page selection *)
let callback = fun i ->
diff --git a/sw/in_progress/pow/InstallCert.java b/sw/in_progress/pow/InstallCert.java
new file mode 100644
index 0000000000..f979cc7868
--- /dev/null
+++ b/sw/in_progress/pow/InstallCert.java
@@ -0,0 +1,188 @@
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Sun Microsystems nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @see http://blogs.sun.com/gc/entry/unable_to_find_valid_certification
+ */
+import java.io.*;
+
+import java.security.*;
+import java.security.cert.*;
+
+import javax.net.ssl.*;
+
+public class InstallCert {
+
+ public static void main(String[] args) throws Exception {
+ String host;
+ int port;
+ char[] passphrase;
+ if ((args.length == 1) || (args.length == 2)) {
+ String[] c = args[0].split(":");
+ host = c[0];
+ port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
+ String p = (args.length == 1) ? "changeit" : args[1];
+ passphrase = p.toCharArray();
+ } else {
+ System.out.println("Usage: java InstallCert [:port] [passphrase]");
+ return;
+ }
+
+ File file = new File("jssecacerts");
+ if (file.isFile() == false) {
+ char SEP = File.separatorChar;
+ File dir = new File(System.getProperty("java.home") + SEP
+ + "lib" + SEP + "security");
+ file = new File(dir, "jssecacerts");
+ if (file.isFile() == false) {
+ file = new File(dir, "cacerts");
+ }
+ }
+ System.out.println("Loading KeyStore " + file + "...");
+ InputStream in = new FileInputStream(file);
+ KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
+ ks.load(in, passphrase);
+ in.close();
+
+ SSLContext context = SSLContext.getInstance("TLS");
+ TrustManagerFactory tmf =
+ TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ tmf.init(ks);
+ X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
+ SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
+ context.init(null, new TrustManager[] {tm}, null);
+ SSLSocketFactory factory = context.getSocketFactory();
+
+ System.out.println("Opening connection to " + host + ":" + port + "...");
+ SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
+ socket.setSoTimeout(10000);
+ try {
+ System.out.println("Starting SSL handshake...");
+ socket.startHandshake();
+ socket.close();
+ System.out.println();
+ System.out.println("No errors, certificate is already trusted");
+ } catch (SSLException e) {
+ System.out.println();
+ e.printStackTrace(System.out);
+ }
+
+ X509Certificate[] chain = tm.chain;
+ if (chain == null) {
+ System.out.println("Could not obtain server certificate chain");
+ return;
+ }
+
+ BufferedReader reader =
+ new BufferedReader(new InputStreamReader(System.in));
+
+ System.out.println();
+ System.out.println("Server sent " + chain.length + " certificate(s):");
+ System.out.println();
+ MessageDigest sha1 = MessageDigest.getInstance("SHA1");
+ MessageDigest md5 = MessageDigest.getInstance("MD5");
+ for (int i = 0; i < chain.length; i++) {
+ X509Certificate cert = chain[i];
+ System.out.println
+ (" " + (i + 1) + " Subject " + cert.getSubjectDN());
+ System.out.println(" Issuer " + cert.getIssuerDN());
+ sha1.update(cert.getEncoded());
+ System.out.println(" sha1 " + toHexString(sha1.digest()));
+ md5.update(cert.getEncoded());
+ System.out.println(" md5 " + toHexString(md5.digest()));
+ System.out.println();
+ }
+
+ System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
+ String line = reader.readLine().trim();
+ int k;
+ try {
+ k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
+ } catch (NumberFormatException e) {
+ System.out.println("KeyStore not changed");
+ return;
+ }
+
+ X509Certificate cert = chain[k];
+ String alias = host + "-" + (k + 1);
+ ks.setCertificateEntry(alias, cert);
+
+ OutputStream out = new FileOutputStream("jssecacerts");
+ ks.store(out, passphrase);
+ out.close();
+
+ System.out.println();
+ System.out.println(cert);
+ System.out.println();
+ System.out.println
+ ("Added certificate to keystore 'jssecacerts' using alias '"
+ + alias + "'");
+ }
+
+ private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();
+
+ private static String toHexString(byte[] bytes) {
+ StringBuilder sb = new StringBuilder(bytes.length * 3);
+ for (int b : bytes) {
+ b &= 0xff;
+ sb.append(HEXDIGITS[b >> 4]);
+ sb.append(HEXDIGITS[b & 15]);
+ sb.append(' ');
+ }
+ return sb.toString();
+ }
+
+ private static class SavingTrustManager implements X509TrustManager {
+
+ private final X509TrustManager tm;
+ private X509Certificate[] chain;
+
+ SavingTrustManager(X509TrustManager tm) {
+ this.tm = tm;
+ }
+
+ public X509Certificate[] getAcceptedIssuers() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void checkClientTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void checkServerTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ this.chain = chain;
+ tm.checkServerTrusted(chain, authType);
+ }
+ }
+
+}
diff --git a/sw/in_progress/pow/ServletPow/InstallCert.java b/sw/in_progress/pow/ServletPow/InstallCert.java
new file mode 100644
index 0000000000..f979cc7868
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/InstallCert.java
@@ -0,0 +1,188 @@
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Sun Microsystems nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @see http://blogs.sun.com/gc/entry/unable_to_find_valid_certification
+ */
+import java.io.*;
+
+import java.security.*;
+import java.security.cert.*;
+
+import javax.net.ssl.*;
+
+public class InstallCert {
+
+ public static void main(String[] args) throws Exception {
+ String host;
+ int port;
+ char[] passphrase;
+ if ((args.length == 1) || (args.length == 2)) {
+ String[] c = args[0].split(":");
+ host = c[0];
+ port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
+ String p = (args.length == 1) ? "changeit" : args[1];
+ passphrase = p.toCharArray();
+ } else {
+ System.out.println("Usage: java InstallCert [:port] [passphrase]");
+ return;
+ }
+
+ File file = new File("jssecacerts");
+ if (file.isFile() == false) {
+ char SEP = File.separatorChar;
+ File dir = new File(System.getProperty("java.home") + SEP
+ + "lib" + SEP + "security");
+ file = new File(dir, "jssecacerts");
+ if (file.isFile() == false) {
+ file = new File(dir, "cacerts");
+ }
+ }
+ System.out.println("Loading KeyStore " + file + "...");
+ InputStream in = new FileInputStream(file);
+ KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
+ ks.load(in, passphrase);
+ in.close();
+
+ SSLContext context = SSLContext.getInstance("TLS");
+ TrustManagerFactory tmf =
+ TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ tmf.init(ks);
+ X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
+ SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
+ context.init(null, new TrustManager[] {tm}, null);
+ SSLSocketFactory factory = context.getSocketFactory();
+
+ System.out.println("Opening connection to " + host + ":" + port + "...");
+ SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
+ socket.setSoTimeout(10000);
+ try {
+ System.out.println("Starting SSL handshake...");
+ socket.startHandshake();
+ socket.close();
+ System.out.println();
+ System.out.println("No errors, certificate is already trusted");
+ } catch (SSLException e) {
+ System.out.println();
+ e.printStackTrace(System.out);
+ }
+
+ X509Certificate[] chain = tm.chain;
+ if (chain == null) {
+ System.out.println("Could not obtain server certificate chain");
+ return;
+ }
+
+ BufferedReader reader =
+ new BufferedReader(new InputStreamReader(System.in));
+
+ System.out.println();
+ System.out.println("Server sent " + chain.length + " certificate(s):");
+ System.out.println();
+ MessageDigest sha1 = MessageDigest.getInstance("SHA1");
+ MessageDigest md5 = MessageDigest.getInstance("MD5");
+ for (int i = 0; i < chain.length; i++) {
+ X509Certificate cert = chain[i];
+ System.out.println
+ (" " + (i + 1) + " Subject " + cert.getSubjectDN());
+ System.out.println(" Issuer " + cert.getIssuerDN());
+ sha1.update(cert.getEncoded());
+ System.out.println(" sha1 " + toHexString(sha1.digest()));
+ md5.update(cert.getEncoded());
+ System.out.println(" md5 " + toHexString(md5.digest()));
+ System.out.println();
+ }
+
+ System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
+ String line = reader.readLine().trim();
+ int k;
+ try {
+ k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
+ } catch (NumberFormatException e) {
+ System.out.println("KeyStore not changed");
+ return;
+ }
+
+ X509Certificate cert = chain[k];
+ String alias = host + "-" + (k + 1);
+ ks.setCertificateEntry(alias, cert);
+
+ OutputStream out = new FileOutputStream("jssecacerts");
+ ks.store(out, passphrase);
+ out.close();
+
+ System.out.println();
+ System.out.println(cert);
+ System.out.println();
+ System.out.println
+ ("Added certificate to keystore 'jssecacerts' using alias '"
+ + alias + "'");
+ }
+
+ private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();
+
+ private static String toHexString(byte[] bytes) {
+ StringBuilder sb = new StringBuilder(bytes.length * 3);
+ for (int b : bytes) {
+ b &= 0xff;
+ sb.append(HEXDIGITS[b >> 4]);
+ sb.append(HEXDIGITS[b & 15]);
+ sb.append(' ');
+ }
+ return sb.toString();
+ }
+
+ private static class SavingTrustManager implements X509TrustManager {
+
+ private final X509TrustManager tm;
+ private X509Certificate[] chain;
+
+ SavingTrustManager(X509TrustManager tm) {
+ this.tm = tm;
+ }
+
+ public X509Certificate[] getAcceptedIssuers() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void checkClientTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void checkServerTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ this.chain = chain;
+ tm.checkServerTrusted(chain, authType);
+ }
+ }
+
+}
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-codec-1.4.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-codec-1.4.jar
new file mode 100755
index 0000000000..458d432da8
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/commons-codec-1.4.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-fileupload-1.2.1.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-fileupload-1.2.1.jar
new file mode 100755
index 0000000000..aa209b3887
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/commons-fileupload-1.2.1.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-httpclient-3.1.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-httpclient-3.1.jar
new file mode 100755
index 0000000000..7c59774aed
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/commons-httpclient-3.1.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-io-1.4.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-io-1.4.jar
new file mode 100755
index 0000000000..133dc6cb35
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/commons-io-1.4.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-logging-1.1.1.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-logging-1.1.1.jar
new file mode 100755
index 0000000000..8758a96b70
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/commons-logging-1.1.1.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/ivy-1.2.13.jar b/sw/in_progress/pow/ServletPow/JARLIB/ivy-1.2.13.jar
new file mode 100755
index 0000000000..be51c0e1f0
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/ivy-1.2.13.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/jakarta-regexp-1.5.jar b/sw/in_progress/pow/ServletPow/JARLIB/jakarta-regexp-1.5.jar
new file mode 100755
index 0000000000..652bc822c9
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/jakarta-regexp-1.5.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/jdom.jar b/sw/in_progress/pow/ServletPow/JARLIB/jdom.jar
new file mode 100755
index 0000000000..65a1b3f737
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/jdom.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/log4j-1.2.16.jar b/sw/in_progress/pow/ServletPow/JARLIB/log4j-1.2.16.jar
new file mode 100755
index 0000000000..3f9d847618
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/log4j-1.2.16.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/mysql-connector-java-5.1.12-bin.jar b/sw/in_progress/pow/ServletPow/JARLIB/mysql-connector-java-5.1.12-bin.jar
new file mode 100755
index 0000000000..af5847eed4
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/mysql-connector-java-5.1.12-bin.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/pushlet.jar b/sw/in_progress/pow/ServletPow/JARLIB/pushlet.jar
new file mode 100755
index 0000000000..6dc1c22e21
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/pushlet.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/pushletclient.jar b/sw/in_progress/pow/ServletPow/JARLIB/pushletclient.jar
new file mode 100755
index 0000000000..c699b8b25f
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/pushletclient.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/rome-1.0.jar b/sw/in_progress/pow/ServletPow/JARLIB/rome-1.0.jar
new file mode 100755
index 0000000000..7138baaca1
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/rome-1.0.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/serializer.jar b/sw/in_progress/pow/ServletPow/JARLIB/serializer.jar
new file mode 100755
index 0000000000..de9b007b4c
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/serializer.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/servlet-api.jar b/sw/in_progress/pow/ServletPow/JARLIB/servlet-api.jar
new file mode 100755
index 0000000000..a71c371333
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/servlet-api.jar differ
diff --git a/sw/in_progress/pow/ServletPow/JARLIB/xerces.jar b/sw/in_progress/pow/ServletPow/JARLIB/xerces.jar
new file mode 100755
index 0000000000..e9fe08ad45
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/JARLIB/xerces.jar differ
diff --git a/sw/in_progress/pow/ServletPow/ServletPow.war b/sw/in_progress/pow/ServletPow/ServletPow.war
new file mode 100755
index 0000000000..0888047d40
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/ServletPow.war differ
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/jk.load b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/jk.load
new file mode 100755
index 0000000000..841cf3d0c2
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/jk.load
@@ -0,0 +1,6 @@
+LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
+
+JkWorkersFile /etc/apache2/workers.properties
+JkLogFile /var/log/apache2/mod_jk.log
+JkLogLevel debug
+JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.conf b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.conf
new file mode 100755
index 0000000000..9152fe14f6
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.conf
@@ -0,0 +1,20 @@
+
+AddType application/x-httpd-php .php .phtml .php3
+AddType application/x-httpd-php-source .phps
+
+
+
+ SetHandler application/x-httpd-php
+
+
+ SetHandler application/x-httpd-php-source
+
+ # To re-enable php in user directories comment the following lines
+ # (from to .) Do NOT set it to On as it
+ # prevents .htaccess files from disabling it.
+
+
+ php_admin_value engine Off
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.load b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.load
new file mode 100755
index 0000000000..0d6a55eb43
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.load
@@ -0,0 +1 @@
+LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.conf b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.conf
new file mode 100755
index 0000000000..1e4ce40c44
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.conf
@@ -0,0 +1,64 @@
+
+#
+# Pseudo Random Number Generator (PRNG):
+# Configure one or more sources to seed the PRNG of the SSL library.
+# The seed data should be of good random quality.
+# WARNING! On some platforms /dev/random blocks if not enough entropy
+# is available. This means you then cannot use the /dev/random device
+# because it would lead to very long connection times (as long as
+# it requires to make more entropy available). But usually those
+# platforms additionally provide a /dev/urandom device which doesn't
+# block. So, if available, use this one instead. Read the mod_ssl User
+# Manual for more details.
+#
+SSLRandomSeed startup builtin
+SSLRandomSeed startup file:/dev/urandom 512
+SSLRandomSeed connect builtin
+SSLRandomSeed connect file:/dev/urandom 512
+
+##
+## SSL Global Context
+##
+## All SSL configuration in this context applies both to
+## the main server and all SSL-enabled virtual hosts.
+##
+
+#
+# Some MIME-types for downloading Certificates and CRLs
+#
+AddType application/x-x509-ca-cert .crt
+AddType application/x-pkcs7-crl .crl
+
+# Pass Phrase Dialog:
+# Configure the pass phrase gathering process.
+# The filtering dialog program (`builtin' is a internal
+# terminal dialog) has to provide the pass phrase on stdout.
+SSLPassPhraseDialog builtin
+
+# Inter-Process Session Cache:
+# Configure the SSL Session Cache: First the mechanism
+# to use and second the expiring timeout (in seconds).
+#SSLSessionCache dbm:/var/run/apache2/ssl_scache
+SSLSessionCache shmcb:/var/run/apache2/ssl_scache(512000)
+SSLSessionCacheTimeout 300
+
+# Semaphore:
+# Configure the path to the mutual exclusion semaphore the
+# SSL engine uses internally for inter-process synchronization.
+SSLMutex file:/var/run/apache2/ssl_mutex
+
+# SSL Cipher Suite:
+# List the ciphers that the client is permitted to negotiate.
+# See the mod_ssl documentation for a complete list.
+# enable only secure ciphers:
+SSLCipherSuite HIGH:MEDIUM:!ADH
+# Use this instead if you want to allow cipher upgrades via SGC facility.
+# In this case you also have to use something like
+# SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
+# see http://httpd.apache.org/docs/2.2/ssl/ssl_howto.html.en#upgradeenc
+#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+
+# enable only secure protocols: SSLv3 and TLSv1, but not SSLv2
+SSLProtocol all -SSLv2
+
+
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.load b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.load
new file mode 100755
index 0000000000..ff861daab5
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.load
@@ -0,0 +1 @@
+LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/ports.conf b/sw/in_progress/pow/ServletPow/conf apache2/ports.conf
new file mode 100755
index 0000000000..7830895dc0
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/ports.conf
@@ -0,0 +1,23 @@
+# If you just change the port or add more ports here, you will likely also
+# have to change the VirtualHost statement in
+# /etc/apache2/sites-enabled/000-default
+# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
+# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
+# README.Debian.gz
+
+#NameVirtualHost *:80
+Listen 80
+
+
+ # If you add NameVirtualHost *:443 here, you will also have to change
+ # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
+ # to
+ # Server Name Indication for SSL named virtual hosts is currently not
+ # supported by MSIE on Windows XP.
+ Listen 443
+
+
+
+ Listen 443
+
+
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/sites-available/default b/sw/in_progress/pow/ServletPow/conf apache2/sites-available/default
new file mode 100755
index 0000000000..0559ce148e
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/sites-available/default
@@ -0,0 +1,42 @@
+NameVirtualHost *:80
+
+ ServerAdmin webmaster@localhost
+
+ DocumentRoot /var/www
+
+ Options FollowSymLinks
+ AllowOverride None
+
+
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride None
+ Order allow,deny
+ allow from all
+
+
+ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Order allow,deny
+ Allow from all
+
+
+ ErrorLog /var/log/apache2/error.log
+
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ LogLevel warn
+
+ CustomLog /var/log/apache2/access.log combined
+
+ Alias /doc/ "/usr/share/doc/"
+
+ Options Indexes MultiViews FollowSymLinks
+ AllowOverride None
+ Order deny,allow
+ Deny from all
+ Allow from 127.0.0.0/255.0.0.0 ::1/128
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/sites-available/powV2_ssl b/sw/in_progress/pow/ServletPow/conf apache2/sites-available/powV2_ssl
new file mode 100755
index 0000000000..7a4efcaca3
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/sites-available/powV2_ssl
@@ -0,0 +1,42 @@
+
+NameVirtualHost *:443
+
+
+ ServerAdmin admin@pow.fr
+ ServerName blanc
+
+ LogLevel warn
+
+ CustomLog /var/log/apache2/access.log combined
+ ServerSignature On
+
+ SSLEngine on
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
+ #SSLCertificateFile /etc/ssl/private/serveur.cert
+ #SSLCertificateKeyFile /etc/ssl/private/serveur.key
+ #SSLCACertificateFile /etc/ssl/private/ca-root.cert
+ SSLCertificateFile /etc/ssl/server.crt
+ SSLCertificateKeyFile /etc/ssl/server.key
+ SSLCACertificatePath /etc/ssl
+
+#SSLVerifyClient optional_no_ca
+#SSLOptions +ExportCertData +StdEnvVars
+ SetEnvIf User-Agent ".*MSIE.*" \
+ nokeepalive ssl-unclean-shutdown \
+ downgrade-1.0 force-response-1.0
+
+ JkExtractSSL On
+ JkOptions +FlushPackets
+ JkOptions +FlushHeader
+ JkMount /ServletPow worker1
+ JkMount /ServletPow/* worker1
+ JkMount /examples/* worker1
+ JkMount /examples worker1
+
+#Redirect https://www.recherche.enac.fr/TestServletPow https://www.recherche.enac.fr/evaluation/TestServletPow
+
+
+
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/conf apache2/workers.properties b/sw/in_progress/pow/ServletPow/conf apache2/workers.properties
new file mode 100755
index 0000000000..996a10559b
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/conf apache2/workers.properties
@@ -0,0 +1,9 @@
+workers.tomcat_home=/users/genin/apache-tomcat-6.0.26
+
+workers.java_home=/usr/lib/jvm/java-6-sun
+ps=/
+worker.list=worker1
+worker.worker1.port=8009
+worker.worker1.host=localhost
+worker.worker1.type=ajp13
+worker.worker1.lbfactor=1
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.classpath b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.classpath
new file mode 100755
index 0000000000..fd0f78ce42
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.classpath
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.project b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.project
new file mode 100755
index 0000000000..3470d17f2e
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.project
@@ -0,0 +1,36 @@
+
+
+ ServletPow
+
+
+
+
+
+ org.eclipse.wst.jsdt.core.javascriptValidator
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.wst.common.project.facet.core.builder
+
+
+
+
+ org.eclipse.wst.validation.validationbuilder
+
+
+
+
+
+ org.eclipse.jem.workbench.JavaEMFNature
+ org.eclipse.wst.common.modulecore.ModuleCoreNature
+ org.eclipse.wst.common.project.facet.core.nature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.wst.jsdt.core.jsNature
+
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/.jsdtscope b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/.jsdtscope
new file mode 100755
index 0000000000..bbb8e68be8
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/.jsdtscope
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.jdt.core.prefs b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000000..420b6fb9b2
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Tue Apr 20 15:09:25 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.component b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.component
new file mode 100755
index 0000000000..72dafadb28
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.project.facet.core.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100755
index 0000000000..53d628c892
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.container b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.container
new file mode 100755
index 0000000000..3bd5d0a480
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.name b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.name
new file mode 100755
index 0000000000..05bd71b6ec
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -0,0 +1 @@
+Window
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design.css
new file mode 100755
index 0000000000..c982ac6974
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design.css
@@ -0,0 +1,220 @@
+body
+{
+ background-color: #CCFFCC;
+ margin: 0%;
+ padding: 0%;
+ outline: 0%;
+ height: 100%;
+ overflow:hidden;
+ max-width:2048px;
+ font-size : 11;
+}
+
+select{
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ vertical-align: middle;
+ background-color: #F5F5DC;
+}
+input {
+ background-color:#F5F5DC;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+}
+
+label {
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+#welcome
+{
+ position:absolute;
+ top:0;
+ left:0;
+ height:3%;
+ width: 100%;
+ background-color: #EEEEEE;
+ text-align: center;
+ font-weight:bold;
+ font-size : 12;
+}
+#usr
+{
+ position:absolute;
+ top:0;
+ right:6%;
+ height:3%;
+ width:25%;
+ background-color: #EEEEEE;
+ text-align: right;
+ white-space:nowrap;
+}
+#page
+{
+position:absolute;
+top:3%;
+left:0;
+height:97%;
+width: 100%;
+}
+
+
+#choicePanel{
+ position:absolute;
+ top:0%;
+ left:0%;
+ height: 13%;
+ width : 15%;
+ background-color: #EEEEEE;
+ border: 1px solid black;
+}
+
+#aircraftSelector
+{
+ text-align: center;
+ background-color: #EEEEEE;
+}
+
+#trackdiv
+{
+ text-align: center;
+ background-color: #EEEEEE;
+ -moz-border-radius: 7px 7px 7px 7px;
+ -webkit-border-radius: 7px 7px 7px 7px;
+ border-radius: 7px 7px 7px 7px;
+ -webkit-border-top-left-radius: 7px; /* pour Chrome */
+ -webkit-border-top-right-radius: 7px; /* pour Chrome */
+ -webkit-border-bottom-left-radius: 7px; /* pour Chrome */
+ -webkit-border-bottom-right-radius: 7px; /* pour Chrome */
+ width: 140px;
+ color: white;
+ vertical-align:middle;
+}
+
+#active_block
+{
+ font-size:11;
+ text-align: center;
+}
+
+#FlightPlan
+{
+ overflow:auto;
+ position:absolute;
+ top:0%;
+ left:15%;
+ height: 40%;
+ width : 14.9%;
+ background-color: #EEEEEE;
+ border: 1px solid black;
+}
+
+#FlightParams
+{
+ position:absolute;
+ top:13%;
+ left :0%
+ text-align: center;
+ height: 27%;
+ width : 14.9%;
+ border: 1px solid black;
+ background-color: #EEEEEE;
+}
+
+#map_canvas
+{
+ position:absolute;
+ top:0;
+ left:30%;
+ width:70%;
+ height: 95%;
+ border:1px solid black;
+}
+
+
+#Settings
+{
+ overflow:auto;
+ position:absolute;
+ left:0%;
+ top:40%;
+ text-align: left;
+ height: 55%;
+ width: 29.9%;
+ background-color: #EEEEEE;
+ border: 1px solid black;
+}
+
+#page_setting {
+
+}
+
+#setting {
+ width: 400px;
+ height: 250px;
+ padding: 0.5em;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 8;
+}
+#param
+{
+ overflow:auto;
+}
+
+#NewsDiv
+{
+ position:absolute;
+ overflow:auto;
+ left:0%;
+ top:95%;
+ height: 5%;
+ width: 100%;
+ text-align: left;
+ vertical-align:top;
+ background-color: #EEEEEE;
+ border: 1px solid black;
+}
+
+#info
+{
+ text-align: left;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+#Debug
+{
+ overflow:auto;
+ position:absolute;
+ left:65%;
+ top:50%;
+ text-align: center;
+ height: 50%;
+ width: 35%;
+ background-color: #EEEEEE;
+ border: 1px solid black;
+ padding-top:20px;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+#title{
+ font-weight:bold;
+ font-size:18;
+ text-align:center;
+}
+
+table.param {
+border:3px solid #6495ed;
+border-collapse:collapse;
+width:90%;
+margin:auto;
+}
+td.param {
+font-family:sans-serif;
+font-size:11px;
+border:1px solid #6495ed;
+padding:5px;
+text-align:left;
+}
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designHelp.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designHelp.css
new file mode 100755
index 0000000000..e8fcfd7a3d
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designHelp.css
@@ -0,0 +1,21 @@
+body
+{
+ width: 90%;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ margin-left:5%;
+ margin-reight:5%;
+ background-color: #CCFFCC;
+ text-align:justify;
+}
+
+h3,h2
+{
+ color : navy;
+ text-align:center;
+ text-decoration:underline;
+}
+#problem
+{
+ color:red;
+}
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designLogOut.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designLogOut.css
new file mode 100755
index 0000000000..c6ce91f1e9
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designLogOut.css
@@ -0,0 +1,12 @@
+body
+{
+ background-color: #CCFFCC;
+ margin-top: 2%;
+ padding: 0%;
+ outline: 0%;
+ height: 100%;
+ overflow:hidden;
+ max-width:2048px;
+ text-align:center;
+ font-size:24px;
+}
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designWelcome.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designWelcome.css
new file mode 100755
index 0000000000..fe096f7074
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designWelcome.css
@@ -0,0 +1,30 @@
+body
+{
+ width: 960px;
+ margin-top: 100px;
+ margin-bottom: 5px;
+ background-image: url("Icons/logo.png");
+ background-repeat:no-repeat;
+ background-color: #CCFFCC;
+
+}
+
+#signIn
+{
+ margin: auto;
+ width: 300px;
+ height: 140px;
+ border: 1px solid black;
+}
+
+#log
+{
+ margin-left: 30px;
+}
+
+a
+{
+ position:absolute;
+ right:1%;
+ top:80%;
+}
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design_admin.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design_admin.css
new file mode 100755
index 0000000000..867056a7a6
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design_admin.css
@@ -0,0 +1,99 @@
+body {
+ background-color: #EEEEEE;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+select{
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ vertical-align: middle;
+ background-color: #F5F5DC;
+}
+input {
+ border:1px solid black;
+ background-color:#F5F5DC;
+ font-size: 11px;
+}
+
+label {
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+span {
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+td {
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+#title {
+ position : absolute;
+ top : 0%;
+ left : 0%;
+ height : 5%;
+ width : 100%;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ text-align : right;
+ font-size : 11px;
+ background-color: #BC8F8F;
+ border: 1px solid black;
+}
+
+#page {
+ position : absolute;
+ top : 15%;
+ left : 15%;
+ width : 70%;
+ height : 65%;
+ border: 1px solid black;
+ background-color: #EEEEEE;
+}
+
+
+#modifImmat {
+ position : absolute;
+ top : 15%;
+}
+
+
+#modifPwd {
+ position : absolute;
+ top : 15%;
+}
+
+
+#modifRight {
+ position : absolute;
+ top : 15%;
+}
+
+#modifyUser {
+ position : absolute;
+ top : 15%;
+}
+
+#createUser {
+ position : absolute;
+ top : 15%;
+}
+
+#mainForm {
+ position : absolute;
+ top : 15%;
+}
+
+
+#createIvyUser {
+ position : absolute;
+ top : 15%;
+}
+
+#listIvyUser {
+ position : absolute;
+ top : 15%;
+}
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designbackup.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designbackup.css
new file mode 100755
index 0000000000..b00585c71d
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designbackup.css
@@ -0,0 +1,87 @@
+body
+{
+ background-color: #CCFFCC;
+ margin: 0%;
+ padding: 0%;
+ outline: 0%;
+ height: 95%;
+}
+#page
+{
+ width: 100%;
+ height: 95%;
+}
+
+#logo
+{
+ width: 960px;
+ height: 100px;
+ background-image: url("banniere.jpg");
+ background-repeat: repeat-x;
+ margin-bottom: 10px;
+}
+
+#leftmenu
+{
+ /* float: left; /* Le menu flottera à gauche */
+ /* width: 120px; *//* Très important : donner une taille au menu */
+}
+#welcome
+{
+ text-align: center;
+ background-color: #EEEEEE;
+ border: 2px solid black;
+ margin-bottom: 10px; /* Pour éviter que les éléments du menu ne soient trop collés */
+}
+#choice
+{
+float: left;
+ text-align: center;
+ background-color: #EEEEEE;
+ border: 2px solid black;
+ height: 190px;
+ width: 20px;
+}
+#map_canvas
+{
+ width: 690px;
+ height: 350px;
+ margin-left: 125px;
+}
+
+#FlightPlan
+{
+ float: right;
+ width: 135px; /* Très important : donner une taille au menu */
+ height: 345px;
+ border: 2px solid black;
+ background-color: #EEEEEE;
+}
+
+
+
+#ControlPanel
+{
+ float: left;
+ text-align: center;
+ height: 150px;
+ width: 600px;
+ border: 2px solid black;
+ background-color: #EEEEEE;
+}
+#FlightParams
+{
+ text-align: center;
+ float: right;
+ height: 150px;
+ width: 350px;
+ border: 2px solid black;
+ background-color: #EEEEEE;
+}
+table
+{
+ margin-left: 20px;
+ margin-bottom: 20px;
+}
+
+
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/dtree.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/dtree.css
new file mode 100755
index 0000000000..b201c2fd60
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/dtree.css
@@ -0,0 +1,34 @@
+/*--------------------------------------------------|
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
+|---------------------------------------------------|
+| Copyright (c) 2002-2003 Geir Landrö |
+|--------------------------------------------------*/
+
+.dtree {
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ color: #666;
+ white-space: nowrap;
+}
+.dtree img {
+ border: 0px;
+ vertical-align: middle;
+}
+.dtree a {
+ color: #333;
+ text-decoration: none;
+}
+.dtree a.node, .dtree a.nodeSel {
+ white-space: nowrap;
+ padding: 1px 2px 1px 2px;
+}
+.dtree a.node:hover, .dtree a.nodeSel:hover {
+ color: #333;
+ text-decoration: underline;
+}
+.dtree a.nodeSel {
+ background-color: #c0d2ec;
+}
+.dtree .clip {
+ overflow: hidden;
+}
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/tab.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/tab.css
new file mode 100755
index 0000000000..2e9043ed76
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/tab.css
@@ -0,0 +1,110 @@
+/* $Id: example.css,v 1.5 2006/03/27 02:44:36 pat Exp $ */
+
+/*--------------------------------------------------
+ REQUIRED to hide the non-active tab content.
+ But do not hide them in the print stylesheet!
+ --------------------------------------------------*/
+.tabberlive .tabbertabhide {
+ display:none;
+}
+
+/*--------------------------------------------------
+ .tabber = before the tabber interface is set up
+ .tabberlive = after the tabber interface is set up
+ --------------------------------------------------*/
+.tabber {
+}
+.tabberlive {
+ margin-top:1em;
+}
+
+/*--------------------------------------------------
+ ul.tabbernav = the tab navigation list
+ li.tabberactive = the active tab
+ --------------------------------------------------*/
+ul.tabbernav
+{
+ margin:0;
+ padding: 3px 0;
+ border-bottom: 1px solid #778;
+ font: bold 12px Verdana, sans-serif;
+}
+
+ul.tabbernav li
+{
+ list-style: none;
+ margin: 0;
+ display: inline;
+}
+
+ul.tabbernav li a
+{
+ padding: 3px 0.5em;
+ margin-left: 3px;
+ border: 1px solid #778;
+ border-bottom: none;
+ background: #DDE;
+ text-decoration: none;
+}
+
+ul.tabbernav li a:link { color: #448; }
+ul.tabbernav li a:visited { color: #667; }
+
+ul.tabbernav li a:hover
+{
+ color: #000;
+ background: #AAE;
+ border-color: #227;
+}
+
+ul.tabbernav li.tabberactive a
+{
+ background-color: #fff;
+ border-bottom: 1px solid #fff;
+}
+
+ul.tabbernav li.tabberactive a:hover
+{
+ color: #000;
+ background: white;
+ border-bottom: 1px solid white;
+}
+
+/*--------------------------------------------------
+ .tabbertab = the tab content
+ Add style only after the tabber interface is set up (.tabberlive)
+ --------------------------------------------------*/
+.tabberlive .tabbertab {
+ padding:5px;
+ border:1px solid #aaa;
+ border-top:0;
+
+ /* If you don't want the tab size changing whenever a tab is changed
+ you can set a fixed height */
+
+ /* height:200px; */
+
+ /* If you set a fix height set overflow to auto and you will get a
+ scrollbar when necessary */
+
+ /* overflow:auto; */
+}
+
+/* If desired, hide the heading since a heading is provided by the tab */
+.tabberlive .tabbertab h2 {
+ display:none;
+}
+.tabberlive .tabbertab h3 {
+ display:none;
+}
+
+/* Example of using an ID to set different styles for the tabs on the page */
+.tabberlive#tab1 {
+}
+.tabberlive#tab2 {
+}
+.tabberlive#tab2 .tabbertab {
+ height:200px;
+ overflow:auto;
+}
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif
new file mode 100755
index 0000000000..085ccaecaf
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
new file mode 100755
index 0000000000..954e22dbd9
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
new file mode 100755
index 0000000000..64ece5707d
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
new file mode 100755
index 0000000000..abdc01082b
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
new file mode 100755
index 0000000000..9b383f4d2e
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
new file mode 100755
index 0000000000..a23baad25b
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100755
index 0000000000..42ccba269b
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
new file mode 100755
index 0000000000..39d5824d6a
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
new file mode 100755
index 0000000000..f1273672d2
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
new file mode 100755
index 0000000000..359397acff
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png
new file mode 100755
index 0000000000..b273ff111d
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png
new file mode 100755
index 0000000000..c357355aa7
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png
new file mode 100755
index 0000000000..85e63e9f60
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png
new file mode 100755
index 0000000000..e117effa3d
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png
new file mode 100755
index 0000000000..42f8f992c7
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css
new file mode 100755
index 0000000000..312dd8043e
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css
@@ -0,0 +1,489 @@
+/*
+* jQuery UI CSS Framework
+* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
+* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
+*/
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.ui-helper-clearfix { display: inline-block; }
+/* required comment for clearfix to work in Opera \*/
+* html .ui-helper-clearfix { height:1%; }
+.ui-helper-clearfix { display:block; }
+/* end clearfix */
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+
+/*
+* jQuery UI CSS Framework
+* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
+* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
+*/
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
+.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
+.ui-widget-content a { color: #333333; }
+.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
+.ui-widget-header a { color: #ffffff; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; }
+.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
+.ui-widget :active { outline: none; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
+.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
+.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
+.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
+.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
+.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
+
+/* Overlays */
+.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
+.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* Resizable
+----------------------------------*/
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Selectable
+----------------------------------*/
+.ui-selectable-helper { border:1px dotted black }
+/* Accordion
+----------------------------------*/
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
+/* IE7-/Win - Fix extra vertical space in lists */
+.ui-accordion a { zoom: 1; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete
+----------------------------------*/
+.ui-autocomplete { position: absolute; cursor: default; }
+.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/* Menu
+----------------------------------*/
+.ui-menu {
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+}
+.ui-menu .ui-menu {
+ margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.ui-menu .ui-menu-item a {
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+ font-weight: normal;
+ margin: -1px;
+}
+/* Button
+----------------------------------*/
+
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; }
+button.ui-button-icons-only { width: 3.7em; }
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4; }
+.ui-button-text-only .ui-button-text { padding: .4em 1em; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 1em; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+.ui-buttonset { margin-right: 7px; }
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+
+
+
+
+
+/* Dialog
+----------------------------------*/
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+/* Slider
+----------------------------------*/
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 0.8em; height: 0.8em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
+----------------------------------*/
+.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
+/* Datepicker
+----------------------------------*/
+.ui-datepicker { width: 17em; padding: .2em .2em 0; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+ display: none; /*sorry for IE5*/
+ display/**/: block; /*sorry for IE5*/
+ position: absolute; /*must have*/
+ z-index: -1; /*must have*/
+ filter: mask(); /*must have*/
+ top: -4px; /*must have*/
+ left: -4px; /*must have*/
+ width: 200px; /*must have*/
+ height: 200px; /*must have*/
+}/* Progressbar
+----------------------------------*/
+.ui-progressbar { height:2em; text-align: left; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/E.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/E.png
new file mode 100755
index 0000000000..c54150820a
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/E.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/N.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/N.png
new file mode 100755
index 0000000000..b7a747cd39
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/N.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NE.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NE.png
new file mode 100755
index 0000000000..14d39ae0f0
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NE.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NW.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NW.png
new file mode 100755
index 0000000000..e57382d0d4
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NW.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/S.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/S.png
new file mode 100755
index 0000000000..edeabb494d
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/S.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SE.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SE.png
new file mode 100755
index 0000000000..e2e35ba552
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SE.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SW.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SW.png
new file mode 100755
index 0000000000..71f3be47ae
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SW.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/W.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/W.png
new file mode 100755
index 0000000000..baa74b59ad
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/W.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow.png
new file mode 100755
index 0000000000..3a004f60b5
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow2.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow2.png
new file mode 100755
index 0000000000..d2cae73712
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow2.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/blue-dot.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/blue-dot.png
new file mode 100755
index 0000000000..98b280d301
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/blue-dot.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/favicon.ico b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/favicon.ico
new file mode 100755
index 0000000000..7cd42a2755
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/favicon.ico differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/logo.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/logo.png
new file mode 100755
index 0000000000..032f6d16e7
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/logo.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.gif
new file mode 100755
index 0000000000..dfadf2d823
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.png
new file mode 100755
index 0000000000..0786209c39
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/red-dot.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/red-dot.png
new file mode 100755
index 0000000000..b0f3f0e928
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/red-dot.png differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Interface.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Interface.jsp
new file mode 100755
index 0000000000..3ef63cc678
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Interface.jsp
@@ -0,0 +1,1943 @@
+<%@page import="pow.webserver.Conf,java.util.StringTokenizer,java.util.NoSuchElementException" %>
+
+<%
+ if (session.getAttribute("login")==null) {
+ out.println("");
+ }
+%>
+
+
+
+
+
+
+
+ POW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ");
+ }
+ else {
+ String login = ((String) (session.getAttribute("login"))).toString();
+ String right = ((String) (session.getAttribute("rights"))).toString();
+ if (right.equals("visitor"))
+ { out.println("var usr_right=\"visitor\";");
+ out.println("var usr_login=\"nologged\";");
+ }
+ else if (right.equals("admin"))
+ {
+ out.println("var usr_right=\"admin\";");
+ out.println("var usr_login=\""+login+"\";");
+ }
+ else if (right.equals("user")){ // gestion de la liste des drones controlables
+ out.println("var usr_right=\"user\";");
+ out.println("var usr_login=\""+login+"\";");
+ out.println("var drone_ctl=new Array();");
+ String droneCtl = ((String) (session.getAttribute("dronectl"))).toString();
+ StringTokenizer st = new StringTokenizer(droneCtl,";");
+ String d;
+ for(int i = 0 ; i< st.countTokens() ;i++){
+ d=st.nextToken();
+ out.println("drone_ctl[\""+ d +"\"]=1;");
+ }
+ try{
+ while (st.hasMoreTokens()) {
+ d=st.nextToken();
+ }
+ }
+ catch (NoSuchElementException ex){}
+
+ }
+ }
+ String default_folder = this.getServletConfig().getServletContext().getRealPath("");
+ Conf myconf =new Conf(default_folder,"pow_conf.xml");
+ out.println("//10sec after plane_die event remove drone");
+ out.println("var dieEventTimeoutTime = "+myconf.getDieEventTimeoutTime()+";");
+ out.println("//5sec without any position data about a drone remove drone");
+ out.println("var dataEventTimeoutTime = "+myconf.getDataEventTimeoutTime()+";");
+ out.println("// time to wait before order was cancelled");
+ out.println("var order_response_timeout = "+myconf.getOrderResponseTimeout()+";");
+ %>
+ var noPlaneBefore=true; // pour initialiser au premier push flight param
+ var ajax_url = "ajaxRqst.srv";
+/* ********** drone state timeout ******** */
+ var droneStateDieEvent = new Array(); // timeout en cas d'event die
+ var droneStateDataEvent = new Array(); // timeout en cas de non evenement data
+ var waypoint_modif = new Array(); //
+ var block_jump_timeout=-1;
+ var setting_change_timeout=-1;
+ var setting_to_change_id=-1;
+/* *************************************************************************** Global variables *************************************************************************************** */
+ var map;
+
+ var planes = new Array();
+ var nb_planes =0;
+ var markers = new Array();
+ var markers_color = new Array(); // stock les balises de couleurs de chaque drone
+ var diametre_drone_balise = 50; //50m de base
+ var selected_plane = "";
+ var selected_plane_id = 0;
+ var selected_index=0;
+ var tracking = false;
+
+/* *******************Flight Plan variables :******************** */
+ var waypoints = new Array();
+ var waypoint_tmp = null;
+ var index_wpt = 0;
+ var blocks= new Array();
+ var index_block = 0;
+ var active_block_id=0;
+ var active_block_name="";
+ var fpl_name="";
+ var lat0=0;
+ var lon0=0;
+ var fpl_alt=0;
+ var security_height=0;
+ var fpl_ground_alt=0;
+ var max_dist=0;
+
+
+/* ********************Planes and waypoints icons******************** */
+ var plane_icons = new Array();
+ for (var i=0;i<8;i++){
+ plane_icons[i] = new GIcon();
+ plane_icons[i].shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
+ plane_icons[i].iconSize = new GSize(60,60);
+ plane_icons[i].shadowSize = new GSize(22, 20);
+ plane_icons[i].infoWindowAnchor = new GPoint(50, 1);
+ plane_icons[i].iconAnchor = new GPoint(30, 30);
+ }
+ plane_icons[0].image="Icons/N.png";
+ plane_icons[1].image="Icons/NE.png";
+ plane_icons[2].image="Icons/E.png";
+ plane_icons[3].image="Icons/SE.png";
+ plane_icons[4].image="Icons/S.png";
+ plane_icons[5].image="Icons/SW.png";
+ plane_icons[6].image="Icons/W.png";
+ plane_icons[7].image="Icons/NW.png";
+
+ var wpt_icon=new GIcon();
+ wpt_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
+ wpt_icon.iconSize = new GSize(20,20);
+ wpt_icon.shadowSize = new GSize(22, 20);
+ wpt_icon.infoWindowAnchor = new GPoint(8, 1);
+ wpt_icon.iconAnchor = new GPoint(6, 20);
+ //wpt_icon.image="Icons/losange.png";
+ wpt_icon.image="Icons/blue-dot.png";
+
+ var iconMarkerTemp=new GIcon();
+ iconMarkerTemp.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
+ iconMarkerTemp.iconSize = new GSize(20,20);
+ iconMarkerTemp.shadowSize = new GSize(22, 20);
+ iconMarkerTemp.infoWindowAnchor = new GPoint(8, 1);
+ iconMarkerTemp.iconAnchor = new GPoint(6, 20);
+ iconMarkerTemp.image="Icons/red-dot.png";
+/* *************************************************************************** Functions **************************************************************************************************** */
+
+/* ************ prevent user from going back to this page by browser's forward button****************************** */
+
+function backButtonOverride()
+{
+ // Work around a Safari bug
+ // that sometimes produces a blank page
+ setTimeout("backButtonOverrideBody()", 1);
+
+}
+
+function backButtonOverrideBody()
+{
+ // Works if we backed up to get here
+ try {
+ history.forward();
+ } catch (e) {
+ // OK to ignore
+ }
+ // Every quarter-second, try again. The only
+ // guaranteed method for Opera, Firefox,
+ // and Safari, which don't always call
+ // onLoad but *do* resume any timers when
+ // returning to a page
+ setTimeout("backButtonOverrideBody()", 500);
+}
+/* ******************* Useful functions ******************** */
+// Gets an element of the html document by its class name
+ function getElementsByClass(tag, className){
+ var elements = document.getElementsByTagName(tag);
+ var results = new Array();
+ for(var i=0; i< elements.length; i++){
+ if(elements[i].className == className){
+ results[results.length] = elements[i];
+ }
+ }
+ return results;
+ }
+
+
+ function pause(time){
+ d=new Date();
+ diff=0;
+ while(diff < time){
+ n=new Date();
+ diff=n-d;
+ }
+ }
+
+
+ //Creates a GoogleMaps marker
+
+
+
+
+ function createMarker(point, legend, icon){
+ var marker = new GMarker(point, icon);
+ GEvent.addListener(marker, 'click', function() {
+ marker.openInfoWindowHtml(legend);
+ });
+ return marker;
+ }
+
+ var old_lat;
+ var old_lon;
+ //Creates a draggable marker with an EventListener
+ function createDraggableMarker(point,namewpt,wpt_icon,index_wpt, bool){
+ var fpl_file_name="upload/"+planes[selected_index]["id"]+"/flight_plan.xml";
+ var marker = new GMarker(point,{legend: namewpt,icon: wpt_icon,draggable: bool,bouncy:true});
+ //var marker = new GMarker(point,{title: name,draggable: bool});
+ //var marker = new GMarker(point,{draggable: bool});
+ GEvent.addListener(marker, 'click', function() {
+ marker.openInfoWindowHtml(namewpt);
+ });
+ if (bool){
+ GEvent.addListener(marker, 'dragend', function(latlng) {
+ if (latlng){
+ //alert("id wpt="+index_wpt+" name=" +namewpt+" lat="+latlng.lat()+" lon="+latlng.lng());
+ var lat = latlng.lat();
+ var lon = latlng.lng();
+ moveWpt(selected_plane_id,namewpt,lat,lon,false,true,index_wpt);
+ }
+ });
+
+ GEvent.addListener(marker, 'dragstart', function(latlng) {
+ if (latlng){
+ old_lat=latlng.lat();
+ old_lon=latlng.lng();
+ }
+ });
+ }
+
+ return marker;
+ }
+
+
+
+
+
+//Converts ditances from (lat0,lon0) given in meters into latitudes or longitudes, and vice versa
+ function xMetersToDegrees(x,lat0){
+ return (x/1852/60+parseFloat(lat0));
+ }
+ function yMetersToDegrees(y,lat,lon0){
+ return (y/1852/60*Math.cos(lat)+parseFloat(lon0));
+ }
+
+ function xDegreesToMeters(lat,lat0){
+ return((lat-lat0)*1852*60);
+ }
+ function yDegreesToMeters(lat,lon,lon0){
+ return(lat!=0?(lon-lon0)/Math.cos(lat)*1852*60:0);
+ }
+
+
+ function name_from_id(id){
+ var match=false;
+ for (var i=0;i< planes.length;i++){
+ if(planes[i]["id"]==id){match=true;break;}
+ }
+ if (match){
+ return (planes[i]["name"]);
+ }else{
+ return (null);
+ }
+ }
+ /* *************** JQUERY stuffs ***************************** */
+ $(function(){
+ //init();
+ //$("#Settings").draggable();$("#Settings").resizable();
+ //$("#map_canvas").draggable();$("#map_canvas").resizable();
+ //$("#Debug").draggable();$("#Debug").resizable();
+ //$("#choicePanel").draggable();$("#choicePanel").resizable();
+ //$("#FlightPlan").draggable();$("#FlightPlan").resizable();
+ //$("#FlightParams").draggable();$("#FlightParams").resizable();
+ });
+/* ********************* Fonctions de Push ******************** */
+
+ function initialize_push() {
+ // alert('go');
+ p_join_listen(null, 'stream');
+ // TODO il faudra gerer le cas ou cela bloque !!!! et passer en pull
+ // p_join_listen(null, 'pull');
+ p_subscribe('/data/drone/iskill', 'msg from serveur');
+ p_subscribe('/data/drones_maj', 'msg from serveur');
+ p_subscribe('/data/order/waypoint_moved', 'msg from serveur');
+ p_subscribe('/data/order/change_setting', 'msg from serveur');
+ p_subscribe('/data/order/plane_die', 'msg from serveur');
+ p_subscribe('/data/order/plane_resurect', 'msg from serveur');
+ p_subscribe('/data/order/new_plane', 'msg from serveur');
+ p_subscribe('/data/order/block_changed', 'msg from serveur');
+ p_subscribe('/data/order/other', 'msg from serveur');
+ p_subscribe('/data/order/settings', 'msg from serveur');
+
+ p_subscribe('/chat','msg from web client');
+ p_subscribe('/client_action','action from web client');
+ }
+
+ function initialize_push_pullmode() {
+
+ p_join_listen(null, 'pull');
+ p_subscribe('/data/drone/iskill', 'msg from serveur');
+ p_subscribe('/data/drones_maj', 'msg from serveur');
+ p_subscribe('/data/order/waypoint_moved', 'msg from serveur');
+ p_subscribe('/data/order/change_setting', 'msg from serveur');
+ p_subscribe('/data/order/plane_die', 'msg from serveur');
+ p_subscribe('/data/order/plane_resurect', 'msg from serveur');
+ p_subscribe('/data/order/new_plane', 'msg from serveur');
+ p_subscribe('/data/order/block_changed', 'msg from serveur');
+ p_subscribe('/data/order/other', 'msg from serveur');
+ p_subscribe('/data/order/settings', 'msg from serveur');
+
+ p_subscribe('/chat','msg from web client');
+ p_subscribe('/client_action','action from web client');
+ }
+
+ function displayControl(aString) {
+ document.debugEventDisplay.event.value = aString;
+ }
+ // callback on data Events
+ // call apropirate function according to the received event
+
+ function onData(event) {
+ var subject = event.get('p_subject');
+
+ // displayControl(""+ event.toString());
+
+ if (subject=="/data/drones_maj") { handleDronePositionUpsate(event);}
+ else if (subject =="/data/order/waypoint_moved") {orderprocessing_waypoint(event);}
+ else if (subject =="/data/order/block_changed") {orderprocessing_jump2block(event);}
+ else if (subject =="/data/order/change_setting") {orderprocessing_setting(event);}
+ else if (subject =="/data/order/plane_die") {orderprocessing_planedie(event);}
+ else if (subject =="/data/order/plane_resurect"){orderprocessing_planeressurect(event);}
+ else if (subject =="/data/order/new_plane") {orderprocessing_newplane(event);}
+ else if (subject =="/data/drone/iskill") {orderprocessing_planekilled(event);}
+ else if (subject =="/data/order/settings") {orderprocessing_csv_settings(event);}
+ else if (subject =="/chat") {orderprocessing_chat(event);}
+ else if (subject =="/client_action") {orderprocessing_client_action(event);}
+ }
+
+ // callback on all other kind of Events
+
+ <%--function onEvent(event) {
+ var subject = event.get('p_subject');
+ displayControl("EVENT CALLBACK "+subject+"\n" + event.toString());
+
+
+ }
+ --%>
+/* ********************* initilization de l'interface ******************* */
+ function initialize_display(){
+ var aircraftList = document.getElementById("aircraftForm").aircraftList;
+ if (nb_planes ==0)//If there is no active aircraft, the list only has one option : No aircraft
+ {aircraftList.options[0]=new Option("No aircraft");}
+}
+
+/* *********************functions to check airplanes ******************* */
+
+/* *********************Processing events ******************* */
+ // recherche si l'id de l'avion est deja present dans le tableau des drones deja
+ function handleDronePositionUpsate(event){
+ if (planes.length==0) {noPlaneBefore=true;}
+ var id = parseInt(event.get('aircraftId'));
+ var match=false;
+ var insert=false;
+ var aircraftList = document.getElementById("aircraftForm").aircraftList;
+ nb_planes=planes.length;
+ for (var i=0;i< nb_planes;i++){
+ if(planes[i]["id"]> id){insert=true;break;} // on garde le tableau trié
+ if (planes[i]["id"]==id){match=true;break;} // on recupere en i le drone correspondant à id
+ }
+ if(!match){
+ var k=0;
+ if(insert){ // on insert au milieu
+ k=i;
+ planes.splice(i,0,new Array());
+ markers.splice(i,0,null);
+ markers_color.splice(i,0,null);
+ // on insere l'aircraft dan sla liste deroulante
+ //see http://www.mredkj.com/tutorials/tutorial005.html
+ var elOptNew = document.createElement('option');
+ elOptNew.text = event.get('dbName')
+ var elOptOld = aircraftList.options[i];
+ try {
+ aircraftList.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE
+ }
+ catch(ex) {
+ aircraftList.add(elOptNew, i); // IE only
+ }
+ }else{ // on met à la fin du tableau
+ k=planes.length;
+ planes[k] = new Array();
+ markers[k]= null; // inutile
+ markers_color[k]=null;
+ aircraftList.options[k]=new Option(event.get('dbName'));
+ }
+ droneStateDieEvent[k] = -1; // init un timeout vide
+ //
+ planes[k]["id"]=id;
+ planes[k]["name"] =event.get('dbName');
+ planes[k]["lat"] = event.get('dbLatitude');
+ planes[k]["lon"] = event.get('dbLongitude');
+ planes[k]["heading"]= event.get('dbCourse');
+ // maj des param pour selected acrf
+ planes[k]["speed"]= event.get('dbSpeed');
+ planes[k]["altitude"]= event.get('dbAmsl');
+ planes[k]["vspeed"]= event.get('dbVert_speed');
+ planes[k]["height"]= event.get('dbAgl');
+ planes[k]["battery"]= event.get('dbStat_battery');
+ planes[k]["GPS"]= event.get('dbStat_gps');
+ planes[k]["activeBlock"]= event.get('dbActive_block');
+ planes[k]["engine"]= event.get('dbEngine_status');
+ planes[k]["setting_id"]= event.get('dbId_Setting');
+ planes[k]["setting_value"]= event.get('dbSetting_Value');
+ planes[k]["drone_color"]= event.get('drone_color');
+ // gere si le drone peut etre controlé ou non
+ if ((usr_right=="admin")||((usr_right=="user")&&(drone_ctl[event.get('dbName')]!=null))){
+ planes[k]["rights"]= 1;
+ }
+ else
+ {planes[k]["rights"]=0;}
+
+ var icon;
+ if (planes[k]["heading"]>=338 || planes[i]["heading"]< 23){
+ icon = plane_icons[0];
+ }else if (planes[k]["heading"]>=23 && planes[i]["heading"]<68){
+ icon = plane_icons[1];
+ }else if (planes[k]["heading"]>=68 && planes[i]["heading"]<113){
+ icon = plane_icons[2];
+ }else if (planes[k]["heading"]>=113 && planes[i]["heading"]<158){
+ icon = plane_icons[3];
+ }else if (planes[k]["heading"]>=158 && planes[i]["heading"]<203){
+ icon = plane_icons[4];
+ }else if (planes[k]["heading"]>=203 && planes[i]["heading"]<248){
+ icon = plane_icons[5];
+ }else if (planes[k]["heading"]>=248 && planes[i]["heading"]<293){
+ icon = plane_icons[6];
+ }else if (planes[k]["heading"]>=293 && planes[i]["heading"]<337){
+ icon = plane_icons[7];
+ }
+ //A marker is created and added on the map
+ var pos = new GLatLng(planes[k]["lat"],planes[k]["lon"]);
+ markers[k]=createMarker(pos,planes[k]["name"],icon);
+ markers_color[k] = GPolygon.Circle(pos,diametre_drone_balise,"#000000",1,1,planes[i]["drone_color"],0.5)
+ map.addOverlay(markers[k]);
+ map.addOverlay(markers_color[k]);
+ droneStateDataEvent[k] = setTimeout("nodataEventCallBack("+id+")",dataEventTimeoutTime);
+ }
+ else // l event envoyé correspond à un drone deja dans le tableau
+ {
+ if (droneStateDataEvent[i]!=-1) {clearTimeout(droneStateDataEvent[i]);}
+ var heading_changed;
+ //Update of the planes array
+ planes[i]["lat"] = event.get('dbLatitude');
+ planes[i]["lon"] = event.get('dbLongitude');
+ // maj des param pour selected acrf
+ planes[i]["speed"]= event.get('dbSpeed');
+ planes[i]["altitude"]= event.get('dbAmsl');
+ planes[i]["vspeed"]= event.get('dbVert_speed');
+ planes[i]["height"]= event.get('dbAgl');
+ planes[i]["battery"]= event.get('dbStat_battery');
+ planes[i]["GPS"]= event.get('dbStat_gps');
+ planes[i]["activeBlock"]= event.get('dbActive_block');
+ planes[i]["engine"]= event.get('dbEngine_status');
+ planes[i]["setting_id"]= event.get('dbId_Setting');
+ planes[i]["setting_value"]= event.get('dbSetting_Value');
+ planes[i]["drone_color"]= event.get('drone_color');
+ //
+ var new_heading = event.get('dbCourse');
+ var old_heading = planes[i]["heading"];
+ //Update of the icons if the heading has changed
+ if (Math.abs(new_heading-old_heading)>2){
+ var image;
+ if (new_heading>=338 || new_heading< 23){
+ image = plane_icons[0].image;
+ }else if (new_heading>=23 && new_heading<68){
+ image = plane_icons[1].image;
+ }else if (new_heading>=68 && new_heading<113){
+ image = plane_icons[2].image;
+ }else if (new_heading>=113 && new_heading<158){
+ image = plane_icons[3].image;
+ }else if (new_heading>=158 && new_heading<203){
+ image = plane_icons[4].image;
+ }else if (new_heading>=203 && new_heading<248){
+ image = plane_icons[5].image;
+ }else if (new_heading>=248 && new_heading<293){
+ image = plane_icons[6].image;
+ }else if (new_heading>=293 && new_heading<337){
+ image = plane_icons[7].image;
+ }
+ markers[i].setImage(image);
+ }
+ planes[i]["heading"] = new_heading;
+ //Setting the marker to its new position
+ var new_pos = new GLatLng(planes[i]["lat"],planes[i]["lon"]);
+ markers[i].setLatLng(new_pos);
+ //see http://econym.org.uk/gmap/eshapes.htm
+ map.removeOverlay(markers_color[i]);
+ markers_color[i] = GPolygon.Circle(new_pos,diametre_drone_balise,"#000000",1,1,planes[i]["drone_color"],0.5);
+ map.addOverlay(markers_color[i]);
+ droneStateDataEvent[i] = setTimeout("nodataEventCallBack("+id+")",dataEventTimeoutTime);
+ }
+ nb_planes=planes.length;
+
+ document.getElementById("aircraftList").options.length=planes.length;
+ if (tracking&&nb_planes!=0){//If tracking is activated, the map is centered on the aircraft
+ var zoom = map.getZoom();
+ var plane_number = aircraftList.selectedIndex;
+ map.setCenter(new GLatLng(planes[plane_number]["lat"],planes[plane_number]["lon"]),zoom);
+ }
+
+ if (noPlaneBefore==true){
+ noPlaneBefore=false;// !!! interruption possible
+ active_block_id=planes[0]["activeBlock"];
+ aircraftList.options[0].selected=true;
+ selected_plane = planes[0]["name"];
+ selected_plane_id = planes[0]["id"];
+ DOMImplementation("upload/"+planes[0]["id"]+"/flight_plan.xml",fplDisplay);
+ DOMImplementation("upload/"+planes[0]["id"]+"/settings.xml",settingsDisplay);
+ }
+ selected_plane_update(selected_plane_id);
+ }
+
+
+/* ******************** affichage log ******************* */
+
+var coloryellow = true;
+function addMsgLog(msg)
+{
+ var element = document.getElementById("info");
+ var newinfodiv = document.createElement("div");
+ var newinfotxt = document.createTextNode(msg);
+ if (coloryellow) {newinfodiv.style.background = '#FFE4B5';coloryellow=false;}
+ else {newinfodiv.style.background = '#D2B48C';coloryellow=true;}
+ newinfodiv.appendChild(newinfotxt);
+ element.appendChild(newinfodiv);
+}
+/* ******************** Initialization of the page ******************* */
+
+/* Initialization of the page : map, markers, aircraft list... */
+
+
+ function initialize() {
+
+ if (GBrowserIsCompatible()) {
+ // initialize_planes_data();
+ initialize_display();
+ initialize_push();
+ map = new GMap2(document.getElementById("map_canvas"));//Map creation
+ map.setMapType(G_HYBRID_MAP);
+ var point= new GLatLng(43.46223, 1.27289);
+ map.setCenter(point,15);//Center the map on a temporary point
+ map.setUIToDefault();
+ //
+ GEvent.addListener(map, "zoomend", function(oldlevel,newlevel) {
+ var d = newlevel-oldlevel;
+ if (d<0) {
+ diametre_drone_balise=diametre_drone_balise*(-2*d);
+ }
+ else
+ {
+ diametre_drone_balise=diametre_drone_balise/(2*d);
+ }
+ });
+ }else{
+ alert("Your browser is not compatible with Google Maps !");
+ }
+ }
+
+
+
+/* Updating of the selected aircraft flight parameters */
+// recherche la place de l'avion dans le tableau
+ function seekIndex(plane_id)
+ {
+ var i = 0;
+ var trouve = false;
+ var res=-1;
+ while ((ilat y->lon !');
+ x = parseFloat(childXML.getAttribute("x"));
+ y = parseFloat(childXML.getAttribute("y"));
+ lat=xMetersToDegrees(x,lat0);
+ lon=yMetersToDegrees(y,lat,lon0);
+ }
+ else
+ {
+ lat=parseFloat(childXML.getAttribute("lat"));
+ lon=parseFloat(childXML.getAttribute("long"));
+ }
+ var right=planes[selected_index]["rights"];
+ waypoints[index_wpt]["marker"]=null;
+
+ if (right==1){
+ waypoints[index_wpt]["marker"]=createDraggableMarker(new GLatLng(lat,lon),nameWpt,wpt_icon,index_wpt, true);
+ }else {
+ waypoints[index_wpt]["marker"]=createDraggableMarker(new GLatLng(lat,lon),nameWpt,wpt_icon,index_wpt, false);
+ }
+ map.addOverlay(waypoints[index_wpt]["marker"]);
+
+ var alt=false;
+ if (childXML.getAttribute("alt")!=null){
+ alt=childXML.getAttribute("alt");
+ waypoints[index_wpt]["alt"]=parseFloat(childXML.getAttribute("alt"));
+ }
+ var node_url="";
+ if (right==1){
+ node_url = "javascript:moveWpt("+selected_index+",'"+nameWpt+"',"+lat+","+lon+","+alt+",false,"+(index_wpt)+")";
+ }
+ /////
+ index_wpt++;
+ var newindex = index++;
+ fpl_tree.add(newindex,index_pere,nameWpt,node_url);
+ for(var k =0;k< nbr_attrib;k++){
+ var newindex_attrib_name = index++;
+ var newindex_attrib_value = index++;
+ fpl_tree.add(newindex_attrib_name,newindex,childXML.attributes[k].nodeName);
+ fpl_tree.add(newindex_attrib_value,newindex_attrib_name,childXML.attributes[k].nodeValue);
+ //txt = txt + childXML.attributes[k].nodeName + "=" + childXML.attributes[k].nodeValue +" ";
+ }
+ }
+ }
+ else if (childXML.nodeName=="block")
+ { var node_url="";var txt_block_name="";
+ if(childXML.attributes!=null){
+ var block_name=childXML.getAttribute("name");//.replace(/ /g, '_');
+ blocks[index_block]=new Array();
+ blocks[index_block]["name"]=block_name;
+ if (active_block_id==index_block){
+ active_block_name=block_name;
+ txt_block_name = ""+block_name+" ";
+ }
+ else
+ {
+ txt_block_name = block_name;
+ }
+ var right=planes[selected_index]["rights"];
+
+ if (right==1){
+ node_url="javascript:activateBlock("+selected_index+",'"+block_name+"',"+index_block+")";
+ }
+ index_block++;
+ var txt = txt_block_name+ " : ";
+ var nbr_attrib = childXML.attributes.length;
+ for(var k =0;k< nbr_attrib;k++){
+ if (childXML.attributes[k].nodeName!="name"){
+ var newindex_attrib_name = index++;
+ var newindex_attrib_value = index++;
+ txt = txt + childXML.attributes[k].nodeName + "=" + childXML.attributes[k].nodeValue +" ";
+ }
+ }
+ }
+ var newindex = index++;
+ fpl_tree.add(newindex,index_pere,txt,node_url);
+ }
+ // recursion
+ if(childXML.hasChildNodes()) {
+ var nodes=childXML.childNodes.length;
+ for(var i=0; i90.0)||(l<-90.0)||isNaN(new_lat)) {
+ alert('wrong format for a latitude... should be within [-90:+90]');
+ return;
+ }
+ new_lon=prompt("longitude=",mylon);
+ if ((new_lon==null)){
+ return;
+ }
+ l = parseFloat(new_lon);
+ if ((l>180.0)||(l<-180.0)||isNaN(new_lon)) {
+ alert('wrong format for a longitude... should be within [-180:+180]');
+ return;
+ }
+ if (alt){
+ new_alt=prompt("altitude=",alt);
+ if ((new_alt==null)){
+ return;
+ }
+ l = parseFloat(new_alt);
+ if ((l<=0.0)||isNaN(new_alt)) {
+ alert('wrong format for an altitude... should be positive');
+ return;
+ }
+ }
+ //
+ old_lat = waypoints[idwpt]["lat"];
+ old_lon = waypoints[idwpt]["lon"];
+ }else{
+ new_lat=mylat;
+ new_lon=mylon;
+ }
+
+
+ //Ajax request to edit the flight plan xml file
+ var xhr = getXMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4 && xhr.status == 200) {
+ // maj de l'affichage fpl
+ var xmlResponse = xhr.responseXML.documentElement;
+ var rep = xmlResponse.getElementsByTagName("waypoint_to_move")[0];
+ var idwpt_requested = parseInt(rep.getAttribute("idwpt"))-1;// cf waypoint fictif ivy
+ var acid_requested = parseInt(rep.getAttribute("acid"));
+ var lat_requested = parseFloat(rep.getAttribute("newlat"));
+ var lon_requested = parseFloat(rep.getAttribute("newlon"));
+ var was_dragged = rep.getAttribute("dragged");
+ var name_drone = planes[seekIndex(acid_requested)]["name"];
+ // on ne met à jour visuellement que si le focus est sur le drone selecté
+ if (acid_requested==selected_plane_id){
+ // mettre le waypoint dans un etat intermediaire
+ // en attendant l'accuse de reception
+ var right=planes[selected_index]["rights"];
+ var marker_tmp;
+ if (right==1){
+ marker_tmp=createDraggableMarker(new GLatLng(old_lat,old_lon),waypoints[idwpt_requested]["name"],wpt_icon,idwpt_requested, true);
+ }else {
+ marker_tmp=createDraggableMarker(new GLatLng(old_lat,old_lon),waypoints[idwpt_requested]["name"],wpt_icon,idwpt_requested, false);
+ }
+ var name_wpt = waypoints[idwpt_requested]["name"];
+ var timer=setTimeout("callback_waypoint("+acid_requested+","+idwpt_requested+")",order_response_timeout);
+ waypoint_modif[idwpt_requested] = new createWaypoint(acid_requested,idwpt_requested,name_wpt,marker_tmp,timer);
+ // on efface le marker courant
+ // meme si elle a ete deplacé par drag & drop
+ // on cree un marker non draggable avec une icone temporaire
+ map.removeOverlay(waypoints[idwpt_requested]["marker"]);
+ waypoints[idwpt_requested]["marker"] = createMarker(new GLatLng(lat_requested,lon_requested),name_wpt,iconMarkerTemp);
+ if (waypoints[idwpt_requested]["marker"]!=null) map.addOverlay(waypoints[idwpt_requested]["marker"]);
+ else alert('echec creation wpt tmp');
+ addMsgLog("waypoint "+ name_wpt +" for drone " + name_drone +" will be moved");
+ }
+ else
+ {
+ addMsgLog("waypoint "+ idwpt_requested +" for drone " + name_drone +" will be moved");
+ }
+
+ }
+ };
+ xhr.open("POST",ajax_url,true);
+ xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ // on informe les autres clients de ne pas modifier le waypoint en cours (via pushlet)
+ p_publish('/client_action', 'login',usr_login,'action', 'lock', 'type_obj', 'waypoint', 'id_obj',idwpt,'webiddrone',selected_plane_id);
+ // on passe en parametre le index_wpt+1 car dans paparazzi il y a un wpt predefini a zero
+
+ if(alt!=false){
+ xhr.send("order=fpl_update&wpt_name="+name+"&aircraft_id=" +selected_plane_id+"&wpt_id="+(idwpt+1)+"&new_lat="+new_lat+"&new_lon="+new_lon+"&new_alt="+new_alt+"&dragged="+dragged+"&new_alt_for_fpl=1");
+ //alert("wptid="+i+" lat="+new_lat+"lon="+new_lon+"alt="+new_alt);
+ }else{
+ var alti=document.getElementById("altitude");var h=parseFloat(alti.innerHTML);
+ xhr.send("order=fpl_update&wpt_name="+name+"&aircraft_id=" +selected_plane_id+"&wpt_id="+(idwpt+1)+"&new_lat="+new_lat+"&new_lon="+new_lon+"&new_alt="+parseFloat(alti.innerHTML)+"&dragged="+dragged+"&new_alt_for_fpl=0");
+ //alert("wptid="+i+" lat="+new_lat+"lon="+new_lon+"alt="+h);
+ }
+}
+
+
+/* ******** Activate a flight plan block ******** */
+
+
+
+ function activateBlock(ac_webid,blockname,block_id){
+ // verifie qu'il n'y pas pas un verrou sur le block posé par un autre client
+ var k=0;
+ var trouve = false;
+ while ((!trouve)&&(k= parseFloat(min)) ){
+ correct=true;
+ var xhr = getXMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4 && xhr.status == 200) {
+ var xmlResponse = xhr.responseXML.documentElement;
+ var rep = xmlResponse.getElementsByTagName("setting_to_change")[0];
+ var idsetting_requested = parseInt(rep.getAttribute("setting_id"));
+ var acid_requested = parseInt(rep.getAttribute("acid"));
+ var name_drone = planes[seekIndex(acid_requested)]["name"];
+ addMsgLog("request change setting "+ idsetting_requested +" for drone " + name_drone +" has been sent");
+ // mise en place d'un timer d'accusé reception
+ if(acid_requested==planes[selected_index]["id"]){
+ setting_change_timeout=setTimeout("callback_setting("+acid_requested+","+idsetting_requested+")",order_response_timeout);
+ setting_to_change_id = idsetting_requested;
+ }
+ }
+ };
+ xhr.open("POST",ajax_url,true);
+ xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ //Send the parameters to the php page :
+ xhr.send("order=modif_setting&aircraft_id=" +selected_plane_id+"&setting_id="+idsetting+"&value="+new_value);
+
+ }else{
+ new_value=prompt("Wrong value, please enter a value between "+min+" and "+max+" with a step of "+step+" :");
+ if (new_value==null){return;}
+ }
+ }
+ }
+
+ function changeSetting2(idsetting,new_value){
+
+ var xhr = getXMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4 && xhr.status == 200) {
+ var xmlResponse = xhr.responseXML.documentElement;
+ var rep = xmlResponse.getElementsByTagName("setting_to_change")[0];
+ var idsetting_requested = parseInt(rep.getAttribute("setting_id"));
+ var acid_requested = parseInt(rep.getAttribute("acid"));
+ var name_drone = planes[seekIndex(acid_requested)]["name"];
+ addMsgLog("request change setting "+ idsetting_requested +" for drone " + name_drone +" has been sent");
+ // mise en place d'un timer d'accusé reception
+ if(acid_requested==planes[selected_index]["id"]){
+ setting_change_timeout=setTimeout("callback_setting("+acid_requested+","+idsetting_requested+")",order_response_timeout);
+ setting_to_change_id = idsetting_requested;
+ }
+ }
+ };
+ // on informe les autres clients de ne pas modifier le setting en cours (via pushlet)
+ p_publish('/client_action', 'login',usr_login,'action', 'lock', 'type_obj', 'setting', 'id_obj',idsetting,'webiddrone',selected_plane_id);
+ //
+ xhr.open("POST",ajax_url,true);
+ xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ //Send the parameters to the servlet :
+ xhr.send("order=modif_setting&aircraft_id=" +selected_plane_id+"&setting_id="+idsetting+"&value="+new_value);
+
+ }
+
+/* ************************* handle event orders from server ********************************************* */
+
+ function orderprocessing_waypoint(event){
+
+ var acft_id = parseInt(event.get('aircraftId'));
+ var wpt_id = parseInt(event.get('waypointId'))-1; // cf indentation des waypoint sous ivy
+ var lat = event.get('latitude');
+ var lon = event.get('longitude');
+ var alt = event.get('altitude');
+ var name=name_from_id(acft_id);
+ if ((wpt_id>=0)&&(acft_id==selected_plane_id)) {
+ if (waypoint_modif[wpt_id]!=null)
+ {
+ addMsgLog('waypoint ' + wpt_id+' for drone '+name+ ' has been moved to '+lat+"//"+lon+' !');
+ clearTimeout(waypoint_modif[wpt_id].timer)
+ waypoint_modif[wpt_id] = null;
+ DOMImplementation("upload/"+planes[selected_index]["id"]+"/flight_plan.xml",fplDisplay);
+ // inform other web client that waypoint can be changed
+ p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'waypoint', 'id_obj',wpt_id,'webiddrone',acft_id);
+ }
+ }
+ //document.getElementById("info").innerHTML='waypoint' + wpt_id+' for drone '+name+ ' has been moved !';
+ //addMsgLog('waypoint' + wpt_id+' for drone '+name+ ' has been moved !');
+ //alert(' waypoint' + wpt_id+' for drone '+name+ ' has been moved !');
+ }
+
+ function orderprocessing_jump2block(event) {
+ var acft_id = event.get('aircraftId');
+ var current_block_id = event.get('currentBlockId');
+ if (acft_id==selected_plane_id){
+ /// maj de l'affichage fpl
+ var name_block=blocks[current_block_id]["name"];
+ var name_drone=name_from_id(acft_id);
+ clearTimeout(block_jump_timeout);
+ active_block_id = current_block_id;
+ active_block_name =name_block;
+ // inform other web client that block can be changed
+ p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'block', 'id_obj',current_block_id,'webiddrone',acft_id);
+ addMsgLog('drone '+ name_drone + ' has jump to block '+ name_block +' !');
+ DOMImplementation("upload/"+planes[selected_index]["id"]+"/flight_plan.xml",fplDisplay);
+ }
+ }
+
+ function orderprocessing_setting(event) {
+ var acft_id = event.get('aircraftId');
+ var setting_id = parseInt(event.get('settingId'));
+ var value = event.get('settingValue');
+ if ((acft_id==selected_plane_id)&&(setting_to_change_id==setting_id)){
+ clearTimeout(setting_change_timeout);
+ setting_to_change_id = -1; // reset
+ var name=name_from_id(acft_id);
+ //DOMImplementation("upload/"+planes[selected_index]["id"]+"/settings.xml",settingsDisplay);
+ selected_plane_update(acft_id);
+ addMsgLog('setting ' + setting_id +' for drone '+ name + ' has been changed to value '+ value +' !');
+ // inform other web client that block can be changed
+ p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'setting', 'id_obj',setting_id,'webiddrone',acft_id);
+ }
+ }
+
+
+ function orderprocessing_planedie(event){
+ var acft_id = event.get('aircraftId');
+ var order_string = event.get('order');
+ var name=name_from_id(acft_id);
+ //document.getElementById('info').innerHTML='drone ' + name+' is not alive !';
+ addMsgLog('drone ' + name+' is not alive !');
+ var drone_index = seekIndex(acft_id);
+ if(drone_index!=-1)
+ {
+ addMsgLog('drone ' + name+' will be removed in 10 seconds !');
+ droneStateDieEvent[drone_index] = setTimeout("droneDieCallback("+acft_id+")", dieEventTimeoutTime);
+ // on grise l'aircraft sur l'interface
+ }
+ }
+
+ function orderprocessing_planeressurect(event){
+ var acft_id = event.get('aircraftId');
+ var order_string = event.get('order');
+ //document.getElementById('info').innerHTML='drone ' +name+' has been resurrected !';
+ addMsgLog('drone ' +acft_id+' has been resurrected !');
+ var drone_index = seekIndex(acft_id);
+ if(drone_index!=-1)
+ {
+ clearTimeout ( droneStateDieEvent[drone_index] );
+ // on remet l'aircraft en couleur
+ }
+ }
+
+ function orderprocessing_newplane(event){
+ var acft_id = event.get('aircraftId');
+ var order_string = event.get('order');
+ var name= event.get('aircraftName');
+ //document.getElementById('info').innerHTML='drone ' +name+' has been connected !';
+ addMsgLog('drone ' +name+' has been connected !');
+ }
+
+
+ function orderprocessing_planekilled(event){
+ var acft_id = event.get('aircraftId');
+ var name=name_from_id(acft_id);
+ addMsgLog("drone " + name + " deconnection caused by death of ivy bus...");
+ //document.getElementById('info').innerHTML="drone " + name + " deconnection caused by death of ivy bus...";
+ // remove drone...markers....
+ removeDroneDisplay(acft_id);
+ }
+
+ function orderprocessing_csv_settings(event){
+ var acft_id = event.get('aircraftId');
+ var csv = event.get('csv');
+ var index_drone = seekIndex(acft_id);
+ var name=name_from_id(acft_id);
+ if (index_drone!=-1) {
+ planes[index_drone]["csv"]= csv;
+ //addMsgLog("settings updated for drone " + name);
+ if(index_drone==selected_index)
+ {
+ DOMImplementation("upload/"+planes[selected_index]["id"]+"/settings.xml",settingsDisplay);
+ }
+ }
+ }
+
+ function orderprocessing_chat(event){
+ }
+
+ function createLock(id_drone,typ_obj,id_obj,login){
+ this.id_drone = id_drone;
+ this.type_object = typ_obj;
+ this.id_object = id_obj;
+ this.request_login = login;
+ this.lockmsg = function()
+ {return ("user "+this.request_login+ " has locked "+this.type_object +" " +this.id_object);}
+ this.unlockmsg = function()
+ {return ("user "+this.request_login+ " has unlocked "+this.type_object +" " +this.id_object);}
+ }
+
+ var external_waypoint_lock = new Array();
+ var external_block_lock = new Array();
+ var external_setting_lock = new Array();
+ // set or remove a lock to prevent user to change sthg taht is to be changed by another user
+ function orderprocessing_client_action(event){
+ var rqst_login = event.get('login');
+ var rqst_action = event.get('action');
+ var rqst_obj_type = event.get('type_obj');
+ var rqst_obj_id = event.get('id_obj');
+ var rqst_id_drone = event.get('webiddrone');
+ if (rqst_action=='lock'){
+ var lock_obj = new createLock(rqst_id_drone,rqst_obj_type,rqst_obj_id,rqst_login);
+ if (rqst_obj_type=='waypoint') {external_waypoint_lock.push(lock_obj);}
+ else if (rqst_obj_type=='block') {external_block_lock.push(lock_obj);}
+ else if (rqst_obj_type=='setting') {external_setting_lock.push(lock_obj);}
+ addMsgLog(lock_obj.lockmsg());
+ }
+ else if (rqst_action =='unlock'){
+ var trouve = false;
+ var cur_id_obj=-1;
+ var i=0;
+ if (rqst_obj_type=='waypoint')
+ {
+ while((!trouve)&&(i
+
+
+
+
+
+
+
+
+-------- Paparazzi On the Web ! --------
+
+Welcome,
+<%
+ String log = (String) session.getAttribute("login");
+ if(log != null) {
+ out.print(log + "!");
+ String rights = (String) session.getAttribute("rights");
+ if (rights.equals("admin")){
+ out.println(" |
admin page ");
+ }
+ out.println(" |
\"pull\" mode ");
+ out.println(" |
log out ");
+ }
+ else
+ {
+ out.println("");
+ }
+
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+loading...
+
+
+
+
+loading...
+
+
+
+
+
+
Flight Parameters
+
+
+
+
+
+ altitude (m)
+ 0
+
+
+ height
+ 0 m
+
+
+ battery level
+ 0V
+
+
+ speed
+ 0 km/h
+
+
+ GPS status
+ OFF
+
+
+ vertical speed
+ 0 m/s
+
+
+ engine power
+ 0%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<%
+ out.println("");
+%>
+
+
+<%-- --%>
+
+
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/META-INF/MANIFEST.MF b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/META-INF/MANIFEST.MF
new file mode 100755
index 0000000000..254272e1c0
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/pushlet.properties b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/pushlet.properties
new file mode 100755
index 0000000000..ba656e138f
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/pushlet.properties
@@ -0,0 +1,128 @@
+#
+# Pushlet configuration.
+# Place this file in the CLASSPATH (e.g. WEB-INF/classes) or directly under WEB-INF.
+#
+# $Id: pushlet.properties,v 1.13 2007/12/07 12:57:40 justb Exp $
+#
+
+#
+#
+#
+config.version=1.0.2
+
+#
+# CLASS FACTORY SPECIFICATION
+#
+# Change these if you want to override any of the core classes
+# within the Pushlet framework with your own custom classes.
+#
+# Examples:
+# - custom SessionManager for authorisation
+# - maintain lists of active subjects (topics)
+# - send events on subscription
+# - plug in custom logging like log4j
+# Note that you must maintain the semantics of each class !
+# Below are the default properties for the core classes.
+controller.class=nl.justobjects.pushlet.core.Controller
+dispatcher.class=nl.justobjects.pushlet.core.Dispatcher
+logger.class=nl.justobjects.pushlet.util.Log4jLogger
+# logger.class=nl.justobjects.pushlet.util.DefaultLogger
+sessionmanager.class=nl.justobjects.pushlet.core.SessionManager
+session.class=nl.justobjects.pushlet.core.Session
+subscriber.class=nl.justobjects.pushlet.core.Subscriber
+subscription.class=nl.justobjects.pushlet.core.Subscription
+
+# sessionmanager.maxsessions=200
+
+#
+# DISPATCHER
+#
+
+
+# TODO: allow properties to be maintained in
+# a user dir
+# config.redirect=/etc/pushlet.properties
+
+#
+# LOGGING
+#
+
+# log level (trace(6) debug(5) info (4), warn(3), error(2), fatal(1))
+# default is info(4)
+log.level=4
+
+#
+# LOCAL EVENT SOURCES
+#
+
+# should local sources be loaded ?
+sources.activate=true
+
+#
+# SESSION
+#
+
+
+# algoritm to generate session key:
+# values: "randomstring" (default) or "uuid".
+# session.id.generation=uuid
+session.id.generation=randomstring
+
+# length of generated session key when using "randomstring" generation
+session.id.size=10
+
+# Overall session lease time in minutes
+# Mainly used for clients that do not perform
+# listening, e.g. when publishing only.
+session.timeout.mins=5
+
+#
+# EVENT QUEUE
+#
+# Properties for per-client data event queue
+
+# Size for
+queue.size=24
+queue.read.timeout.millis=20000
+queue.write.timeout.millis=20
+
+#
+# LISTENING MODE
+#
+
+# You may force all clients to use pull mode
+# for scalability
+listen.force.pull.all=false
+
+#
+# Comma-separated list of User Agent substrings.
+# Force these browsers to use pull mode, since they
+# don't support JS streaming, matching is done using
+# String.indexOf() with lowercased agent strings
+# use multiple criteria with &.
+#
+listen.force.pull.agents=safari
+
+#
+# PULL MODE
+#
+
+# time server should wait on refresing pull client
+pull.refresh.timeout.millis=45000
+
+# minimum/maximum wait time client should wait before refreshing
+# server provides a random time between these values
+pull.refresh.wait.min.millis=2000
+pull.refresh.wait.max.millis=6000
+
+#
+# POLL MODE
+#
+
+# time server should wait on refresing poll client
+poll.refresh.timeout.millis=60000
+
+# minimum/maximum wait time client should wait before refreshing
+# server provides a random time between these values
+poll.refresh.wait.min.millis=6000
+poll.refresh.wait.max.millis=10000
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/sources.properties b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/sources.properties
new file mode 100755
index 0000000000..e8aeb36a43
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/sources.properties
@@ -0,0 +1,28 @@
+#
+# Properties file for EventSource objects to be instantiated.
+#
+# Place this file in the CLASSPATH (e.g. WEB-INF/classes) or directly under WEB-INF.
+#
+# $Id: sources.properties,v 1.2 2007/11/10 14:12:16 justb Exp $
+#
+# Each EventSource is defined as =
+# 1. should be unique within this file but may be any name
+# 2. is the full class name
+#
+#
+# Define Pull Sources here. These classes must be derived from
+# nl.justobjects.pushlet.core.EventPullSource
+# Inner classes are separated with a $ sign from the outer class.
+#source1=nl.justobjects.pushlet.test.TestEventPullSources$TemperatureEventPullSource
+#source2=nl.justobjects.pushlet.test.TestEventPullSources$SystemStatusEventPullSource
+#source3=nl.justobjects.pushlet.test.TestEventPullSources$PushletStatusEventPullSource
+#source4=nl.justobjects.pushlet.test.TestEventPullSources$AEXStocksEventPullSource
+#source5=nl.justobjects.pushlet.test.TestEventPullSources$WebPresentationEventPullSource
+#source6=nl.justobjects.pushlet.test.TestEventPullSources$PingEventPullSource
+
+source1=pow.webserver.Serveur$IvyEventSource
+
+# TO BE DONE IN NEXT VERSION
+# define Push Sources here. These must implement the interface
+# nl.justobjects.pushlet.core.EventSource
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-codec-1.4.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-codec-1.4.jar
new file mode 100755
index 0000000000..458d432da8
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-codec-1.4.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar
new file mode 100755
index 0000000000..aa209b3887
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar
new file mode 100755
index 0000000000..7c59774aed
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-io-1.4.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-io-1.4.jar
new file mode 100755
index 0000000000..133dc6cb35
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-io-1.4.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar
new file mode 100755
index 0000000000..8758a96b70
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/jdom.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/jdom.jar
new file mode 100755
index 0000000000..65a1b3f737
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/jdom.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/log4j-1.2.16.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/log4j-1.2.16.jar
new file mode 100755
index 0000000000..3f9d847618
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/log4j-1.2.16.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar
new file mode 100755
index 0000000000..af5847eed4
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/pushlet.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/pushlet.jar
new file mode 100755
index 0000000000..6dc1c22e21
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/pushlet.jar differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/web.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/web.xml
new file mode 100755
index 0000000000..16b18bbc06
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/web.xml
@@ -0,0 +1,54 @@
+
+
+ ServletPow
+
+ index.html
+ index.htm
+ index.jsp
+ default.html
+ default.htm
+ default.jsp
+
+
+
+ Greeting
+ Greeting
+ pow.webserver.Greeting
+
+
+ Greeting
+ /Greeting.srv
+
+
+
+ Pushlet
+ Pushlet
+ nl.justobjects.pushlet.servlet.Pushlet
+ 1
+
+
+ Pushlet
+ /pushlet.srv
+
+
+
+ Ivy2TomcatHttpServer
+ Ivy2TomcatHttpServer
+ pow.webserver.Ivy2TomcatHttpServer
+ 1
+
+
+ Ivy2TomcatHttpServer
+ /Ivy2TomcatHttpServer.srv
+
+
+
+ ajaxRqst
+ ajaxRqst
+ pow.webserver.AjaxRqst
+
+
+ ajaxRqst
+ /ajaxRqst.srv
+
+
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/admin.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/admin.jsp
new file mode 100755
index 0000000000..77c8c2fa9c
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/admin.jsp
@@ -0,0 +1,790 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<%@page import="java.util.*,pow.webserver.UserTab,pow.webserver.User,javax.xml.parsers.*, org.w3c.dom.*,org.xml.sax.*,java.io.*" %>
+<%
+// recuperation des données sur le serveur
+ String default_folder = this.getServletContext().getRealPath("");
+ UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl");
+ Iterator itr=logTab.getLoginIterator();
+ //
+ UserTab logIvyTab = UserTab.unserialize(default_folder + "/conf/"+"userIvyTable.tbl");
+ Iterator itrIvy=logIvyTab.getLoginIterator();
+ // lecture liste des noms de drones ds immat.xml
+ DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance();
+ // création d'un constructeur de documents
+ DocumentBuilder constructeur = fabrique.newDocumentBuilder();
+ // lecture du contenu d'un fichier XML avec DOM
+ File xml = new File(default_folder + "/conf/"+"immat.xml");
+ Document document = constructeur.parse(xml);
+
+
+%>
+
+
+
+
+
+
+
+Administration page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/immat.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/immat.xml
new file mode 100755
index 0000000000..42965d30c1
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/immat.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/pow_conf.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/pow_conf.xml
new file mode 100755
index 0000000000..947a6b35b7
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/pow_conf.xml
@@ -0,0 +1,24 @@
+
+
+ 8535
+ 8536
+ 1024
+ 10000
+ pow_sql
+ true silent pow_user
+ pwdpow_user
+ admin
+ admin@pow.fr
+
+ 1200000
+
+ 60000
+
+
+10000
+
+5000
+
+30000
+ 30000
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/help.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/help.jsp
new file mode 100755
index 0000000000..cc8eedffa0
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/help.jsp
@@ -0,0 +1,58 @@
+<%@page import="pow.webserver.Conf" %>
+
+
+
+
+
+ Welcome to Paparazzi On the Web
+
+
+
+
+
+
+
+
+
+Welcome on Paparazzi On the Web help page.
+ This page is here to help you to use the Paparazzi On the Web (POW) application. POW is a part of Paparazzi which is a open-project of civil UAV control. With Paparazzi On the Web, you are able to observe and eventually control the UAVs of the system Paparazzi thanks to a browser with your internet connexion. To learn more about Paparazzi project, click here .
+Paparazzi On the Web is optimised for Firefox browser. If you want to have a better performance, you can dowload Firefox here .
+Start page
+If you have a login and a password on Paparazzi On the Web, you can use them to enter the application. Else, click on enter as a guest.
+
+Main page
+You are now on Paparazzi On the Web main page. You can see several boxes. We will describe all those boxes and show you the interactions you can have with them.
+
+Choose an aircraft
+Here you can select the aircraft you want to observe or control. Click on the arrow to see the list of the aircrafts that are available. Click on the aircraft you want to interacte with.
+You can also choose to activate or desactivate tracking. When tracking is activated, the map is always centered on the selected aircraft.
+
+
+
+The map
+On the map, you can see all the aircrafts that are available. If tracking is activated, the map will be centered on the selected aircraft. There are also red lozenges which are the waypoints of the selected UAV. If you are autentified on Paparazzi On the Web and if your profile gives you the authorization, you can move those waypoints with drag and drop.
+
+The flight plan
+Through this box, you can obtain some informations on the flight plan that is followed by the selected plane. If you move your cursor on the informations tab, you obtain informations on the flightplan. If you put your cursor on the "active block" tab, you can see the list of the flight plan blocks that the plane can follow. The active block is in red. If you are authentified and if you have the authorization, you can change the active block by clicking on its name. The waypoints tab gives you informations on the different waypoints. If you are authentified and if you have the authorization, you can move those waypoints by clicking on "move waypoint". In this case, a new windows is openned where you indicate where you want to move the waypoint.
+You can also move a waypoint by dragging the icon on the map to its new position.
+
+The flight parameters
+This box displays the flight parameters of the selected aircraft. When a value is out of its normal range, it becomes red.
+
+The settings
+In this box you can, if you are allowed to control the selected aircraft, you change some settings of this aircraft by clicking on the name of the setting.
+
+Any problem ?
+If you have any display problem, such as a ghost aircraft icon, or an aircraft that is not displayed in the aircrafts list, you might resolve it by reloading the page by pressing F5 key.
+For any other problem, please inform
+<%
+out.print("the administrator "); %>.
+Click here to return to the homepage.
+
+
+
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/idError.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/idError.html
new file mode 100755
index 0000000000..a15edb3f6d
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/idError.html
@@ -0,0 +1,14 @@
+
+
+
+
+ Welcome to Paparazzi On the Web
+
+
+
+
+
+Sorry, an error occured during your identification. Click here to return on the homepage.
+
+
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/base.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/base.gif
new file mode 100755
index 0000000000..9ac0b117b0
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/base.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/cd.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/cd.gif
new file mode 100755
index 0000000000..7503819404
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/cd.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/empty.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/empty.gif
new file mode 100755
index 0000000000..b5cf52378f
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/empty.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folder.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folder.gif
new file mode 100755
index 0000000000..eb129763dc
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folder.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folderopen.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folderopen.gif
new file mode 100755
index 0000000000..c5c31102d5
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folderopen.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/globe.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/globe.gif
new file mode 100755
index 0000000000..57123d0e69
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/globe.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/imgfolder.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/imgfolder.gif
new file mode 100755
index 0000000000..e6d880347f
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/imgfolder.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/join.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/join.gif
new file mode 100755
index 0000000000..34dd47610a
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/join.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/joinbottom.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/joinbottom.gif
new file mode 100755
index 0000000000..48b81c80a9
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/joinbottom.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/line.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/line.gif
new file mode 100755
index 0000000000..1a259eea00
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/line.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minus.gif
new file mode 100755
index 0000000000..3d212a97ae
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minus.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minusbottom.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minusbottom.gif
new file mode 100755
index 0000000000..dc3198be27
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minusbottom.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/musicfolder.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/musicfolder.gif
new file mode 100755
index 0000000000..f620789feb
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/musicfolder.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_minus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_minus.gif
new file mode 100755
index 0000000000..2592ac20f3
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_minus.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_plus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_plus.gif
new file mode 100755
index 0000000000..f258ce211a
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_plus.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/page.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/page.gif
new file mode 100755
index 0000000000..42d7318c5d
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/page.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plus.gif
new file mode 100755
index 0000000000..b2c997233b
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plus.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plusbottom.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plusbottom.gif
new file mode 100755
index 0000000000..b5671d891a
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plusbottom.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/question.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/question.gif
new file mode 100755
index 0000000000..dd4e685078
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/question.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/trash.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/trash.gif
new file mode 100755
index 0000000000..cfa0f000e1
Binary files /dev/null and b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/trash.gif differ
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/index.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/index.jsp
new file mode 100755
index 0000000000..aad5c605b5
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/index.jsp
@@ -0,0 +1,69 @@
+
+
+
+
+ Welcome to Paparazzi On the Web
+
+
+
+
+
+
+
+
+
+
+
+Welcome to Paparazzi On The Web !
+
+
+
+
+
+
+
+or
+
+
+
+
+help ?
+
+
\ No newline at end of file
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/DOMImplementation.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/DOMImplementation.js
new file mode 100755
index 0000000000..75c17e11d6
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/DOMImplementation.js
@@ -0,0 +1,24 @@
+function DOMImplementation(sUrl, fCallback) {
+ var dom;
+ if(window.ActiveXObject) {
+ dom = new ActiveXObject("Microsoft.XMLDOM");
+ dom.onreadystatechange = function() {
+ if(dom.readyState == 4) {
+ //alert("win "+sUrl+" loaded");
+ fCallback(dom);
+ }
+ };
+ }
+ else if(document.implementation && document.implementation.createDocument) {
+ dom = document.implementation.createDocument("", "", null);
+ dom.onload = function() {
+ //alert("other "+sUrl+" loaded");
+ fCallback(dom);
+ }
+ }
+ else {
+ alert("Votre navigateur ne gère pas l'importation de fichiers XML");
+ return;
+ }
+ dom.load(sUrl);
+}
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/XHR_object.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/XHR_object.js
new file mode 100755
index 0000000000..8f3f022733
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/XHR_object.js
@@ -0,0 +1,20 @@
+function getXMLHttpRequest() {
+ var xhr = null;
+
+ if (window.XMLHttpRequest || window.ActiveXObject) {
+ if (window.ActiveXObject) {
+ try {
+ xhr = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch(e) {
+ xhr = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ } else {
+ xhr = new XMLHttpRequest();
+ }
+ } else {
+ alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
+ return null;
+ }
+
+ return xhr;
+}
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/browserdetect.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/browserdetect.js
new file mode 100755
index 0000000000..a8674db57f
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/browserdetect.js
@@ -0,0 +1,97 @@
+// Browser Detect Lite v2.1.4
+// http://www.dithered.com/javascript/browser_detect/index.html
+// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
+
+
+function BrowserDetectLite() {
+ var ua = navigator.userAgent.toLowerCase();
+
+ // browser name
+ this.isGecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
+ this.isMozilla = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
+ this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
+ this.isIE = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) );
+ this.isSafari = (ua.indexOf('safari') != - 1);
+ this.isOpera = (ua.indexOf('opera') != -1);
+ this.isKonqueror = (ua.indexOf('konqueror') != -1 && !this.isSafari);
+ this.isIcab = (ua.indexOf('icab') != -1);
+ this.isAol = (ua.indexOf('aol') != -1);
+
+ // spoofing and compatible browsers
+ this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
+ this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
+
+ // browser version
+ this.versionMinor = parseFloat(navigator.appVersion);
+
+ // correct version number
+ if (this.isNS && this.isGecko) {
+ this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
+ }
+ else if (this.isIE && this.versionMinor >= 4) {
+ this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
+ }
+ else if (this.isMozilla) {
+ this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
+ }
+ else if (this.isSafari) {
+ this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
+ }
+ else if (this.isOpera) {
+ if (ua.indexOf('opera/') != -1) {
+ this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );
+ }
+ else {
+ this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );
+ }
+ }
+ else if (this.isKonqueror) {
+ this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
+ }
+ else if (this.isIcab) {
+ if (ua.indexOf('icab/') != -1) {
+ this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );
+ }
+ else {
+ this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );
+ }
+ }
+
+ this.versionMajor = parseInt(this.versionMinor);
+ this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
+
+ // dom support
+ this.isDOM1 = (document.getElementById);
+ this.isDOM2Event = (document.addEventListener && document.removeEventListener);
+
+ // css compatibility mode
+ this.mode = document.compatMode ? document.compatMode : 'BackCompat';
+
+ // platform
+ this.isWin = (ua.indexOf('win') != -1);
+ this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
+ this.isMac = (ua.indexOf('mac') != -1);
+ this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
+ this.isLinux = (ua.indexOf('linux') != -1);
+
+ // specific browser shortcuts
+ this.isNS4x = (this.isNS && this.versionMajor == 4);
+ this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
+ this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
+ this.isNS4up = (this.isNS && this.versionMinor >= 4);
+ this.isNS6x = (this.isNS && this.versionMajor == 6);
+ this.isNS6up = (this.isNS && this.versionMajor >= 6);
+ this.isNS7x = (this.isNS && this.versionMajor == 7);
+ this.isNS7up = (this.isNS && this.versionMajor >= 7);
+
+ this.isIE4x = (this.isIE && this.versionMajor == 4);
+ this.isIE4up = (this.isIE && this.versionMajor >= 4);
+ this.isIE5x = (this.isIE && this.versionMajor == 5);
+ this.isIE55 = (this.isIE && this.versionMinor == 5.5);
+ this.isIE5up = (this.isIE && this.versionMajor >= 5);
+ this.isIE6x = (this.isIE && this.versionMajor == 6);
+ this.isIE6up = (this.isIE && this.versionMajor >= 6);
+
+ this.isIE4xMac = (this.isIE4x && this.isMac);
+}
+var browser = new BrowserDetectLite();
diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/curvycorners.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/curvycorners.js
new file mode 100755
index 0000000000..511c78dd9d
--- /dev/null
+++ b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/curvycorners.js
@@ -0,0 +1 @@
+function browserdetect(){var A=navigator.userAgent.toLowerCase();this.isIE=A.indexOf("msie")>-1;this.ieVer=this.isIE?/msie\s(\d\.\d)/.exec(A)[1]:0;this.isMoz=A.indexOf("firefox")!=-1;this.isSafari=A.indexOf("safari")!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf("BackCompat")>-1);this.isOp="opera" in window;this.isWebKit=A.indexOf("webkit")!=-1;if(this.isIE){this.get_style=function(D,F){if(!(F in D.currentStyle)){return""}var C=/^([\d.]+)(\w*)/.exec(D.currentStyle[F]);if(!C){return D.currentStyle[F]}if(C[1]==0){return"0"}if(C[2]&&C[2]!=="px"){var B=D.style.left;var E=D.runtimeStyle.left;D.runtimeStyle.left=D.currentStyle.left;D.style.left=C[1]+C[2];C[0]=D.style.pixelLeft;D.style.left=B;D.runtimeStyle.left=E}return C[0]}}else{this.get_style=function(B,C){C=C.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(B,"").getPropertyValue(C)}}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}function curvyCnrSpec(A){this.selectorText=A;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=true}curvyCnrSpec.prototype.setcorner=function(B,C,A,D){if(!B){this.tlR=this.trR=this.blR=this.brR=parseInt(A);this.tlu=this.tru=this.blu=this.bru=D}else{propname=B.charAt(0)+C.charAt(0);this[propname+"R"]=parseInt(A);this[propname+"u"]=D}};curvyCnrSpec.prototype.get=function(D){if(/^(t|b)(l|r)(R|u)$/.test(D)){return this[D]}if(/^(t|b)(l|r)Ru$/.test(D)){var C=D.charAt(0)+D.charAt(1);return this[C+"R"]+this[C+"u"]}if(/^(t|b)Ru?$/.test(D)){var B=D.charAt(0);B+=this[B+"lR"]>this[B+"rR"]?"l":"r";var A=this[B+"R"];if(D.length===3&&D.charAt(2)==="u"){A+=this[B="u"]}return A}throw new Error("Don't recognize property "+D)};curvyCnrSpec.prototype.radiusdiff=function(A){if(A!=="t"&&A!=="b"){throw new Error("Param must be 't' or 'b'")}return Math.abs(this[A+"lR"]-this[A+"rR"])};curvyCnrSpec.prototype.setfrom=function(A){this.tlu=this.tru=this.blu=this.bru="px";if("tl" in A){this.tlR=A.tl.radius}if("tr" in A){this.trR=A.tr.radius}if("bl" in A){this.blR=A.bl.radius}if("br" in A){this.brR=A.br.radius}if("antiAlias" in A){this.antiAlias=A.antiAlias}};curvyCnrSpec.prototype.cloneOn=function(G){var E=["tl","tr","bl","br"];var H=0;var C,A;for(C in E){if(!isNaN(C)){A=this[E[C]+"u"];if(A!==""&&A!=="px"){H=new curvyCnrSpec;break}}}if(!H){H=this}else{var B,D,F=curvyBrowser.get_style(G,"left");for(C in E){if(!isNaN(C)){B=E[C];A=this[B+"u"];D=this[B+"R"];if(A!=="px"){var F=G.style.left;G.style.left=D+A;D=G.style.pixelLeft;G.style.left=F}H[B+"R"]=D;H[B+"u"]="px"}}G.style.left=F}return H};curvyCnrSpec.prototype.radiusSum=function(A){if(A!=="t"&&A!=="b"){throw new Error("Param must be 't' or 'b'")}return this[A+"lR"]+this[A+"rR"]};curvyCnrSpec.prototype.radiusCount=function(A){var B=0;if(this[A+"lR"]){++B}if(this[A+"rR"]){++B}return B};curvyCnrSpec.prototype.cornerNames=function(){var A=[];if(this.tlR){A.push("tl")}if(this.trR){A.push("tr")}if(this.blR){A.push("bl")}if(this.brR){A.push("br")}return A};function operasheet(C){var A=document.styleSheets.item(C).ownerNode.text;A=A.replace(/\/\*(\n|\r|.)*?\*\//g,"");var D=new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var G;this.rules=[];while((G=D.exec(A))!==null){var F=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var E,B=new curvyCnrSpec(G[1]);while((E=F.exec(G[2]))!==null){if(E[1]!=="z-"){B.setcorner(E[3],E[4],E[5],E[6])}}this.rules.push(B)}}operasheet.contains_border_radius=function(A){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(A).ownerNode.text)};function curvyCorners(){var G,D,E,B,J;if(typeof arguments[0]!=="object"){throw curvyCorners.newError("First parameter of curvyCorners() must be an object.")}if(arguments[0] instanceof curvyCnrSpec){B=arguments[0];if(!B.selectorText&&typeof arguments[1]==="string"){B.selectorText=arguments[1]}}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string"){throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.")}D=arguments[1];if(typeof D!=="string"){D=""}if(D!==""&&D.charAt(0)!=="."&&"autoPad" in arguments[0]){D="."+D}B=new curvyCnrSpec(D);B.setfrom(arguments[0])}if(B.selectorText){J=0;var I=B.selectorText.replace(/\s+$/,"").split(/,\s*/);E=new Array;function A(M){var L=M.split("#");return(L.length===2?"#":"")+L.pop()}for(G=0;G7?curvyBrowser.get_style(this.box,"filter"):null;var H=this.spec.get("tR");var M=this.spec.get("bR");var W=function(f){if(typeof f==="number"){return f}if(typeof f!=="string"){throw new Error("unexpected styleToNPx type "+typeof f)}var d=/^[-\d.]([a-z]+)$/.exec(f);if(d&&d[1]!="px"){throw new Error("Unexpected unit "+d[1])}if(isNaN(f=parseInt(f))){f=0}return f};var T=function(d){return d<=0?"0":d+"px"};try{this.borderWidth=W(b);this.borderWidthB=W(J);this.borderWidthL=W(D);this.borderWidthR=W(B);this.boxColour=curvyObject.format_colour(E);this.topPadding=W(Z);this.bottomPadding=W(c);this.leftPadding=W(Q);this.rightPadding=W(a);this.boxWidth=K;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(I);this.borderColourB=curvyObject.format_colour(G);this.borderColourL=curvyObject.format_colour(A);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.borderStringB=this.borderWidthB+"px solid "+this.borderColourB;this.backgroundImage=((C!="none")?C:"");this.backgroundRepeat=Y}catch(X){throw this.newError("getMessage" in X?X.getMessage():X.message)}var F=this.boxHeight;var V=K;if(curvyBrowser.isOp){R=W(R);P=W(P);if(R){var N=V+this.borderWidthL+this.borderWidthR;if(R>N){R=N}R=(N/R*100)+"%"}if(P){var N=F+this.borderWidth+this.borderWidthB;if(P>N){P=N}P=(N/P*100)+"%"}}if(curvyBrowser.quirksMode){}else{this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding}this.contentContainer=document.createElement("div");if(filter){this.contentContainer.style.filter=filter}while(this.box.firstChild){this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild))}if(O!="absolute"){this.box.style.position="relative"}this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=(V+this.borderWidthL+this.borderWidthR)+"px";this.box.style.height=(F+this.borderWidth+this.borderWidthB)+"px";var L=document.createElement("div");L.style.position="absolute";if(filter){L.style.filter=filter}if(curvyBrowser.quirksMode){L.style.width=(V+this.borderWidthL+this.borderWidthR)+"px"}else{L.style.width=V+"px"}L.style.height=T(F+this.borderWidth+this.borderWidthB-H-M);L.style.padding="0";L.style.top=H+"px";L.style.left="0";if(this.borderWidthL){L.style.borderLeft=this.borderWidthL+"px solid "+this.borderColourL}if(this.borderWidth&&!H){L.style.borderTop=this.borderWidth+"px solid "+this.borderColour}if(this.borderWidthR){L.style.borderRight=this.borderWidthR+"px solid "+this.borderColourL}if(this.borderWidthB&&!M){L.style.borderBottom=this.borderWidthB+"px solid "+this.borderColourB}L.style.backgroundColor=E;L.style.backgroundImage=this.backgroundImage;L.style.backgroundRepeat=this.backgroundRepeat;this.shell=this.box.appendChild(L);K=curvyBrowser.get_style(this.shell,"width");if(K===""||K==="auto"||K.indexOf("%")!==-1){throw this.newError("Shell width is "+K)}this.boxWidth=(K!=""&&K!="auto"&&K.indexOf("%")==-1)?parseInt(K):this.shell.clientWidth;this.applyCorners=function(){if(this.backgroundObject){var w=function(AO,i,t){if(AO===0){return 0}var k;if(AO==="right"||AO==="bottom"){return t-i}if(AO==="center"){return(t-i)/2}if(AO.indexOf("%")>0){return(t-i)*100/parseInt(AO)}return W(AO)};this.backgroundPosX=w(R,this.backgroundObject.width,V);this.backgroundPosY=w(P,this.backgroundObject.height,F)}else{if(this.backgroundImage){this.backgroundPosX=W(R);this.backgroundPosY=W(P)}}if(H){v=document.createElement("div");v.style.width=this.boxWidth+"px";v.style.fontSize="1px";v.style.overflow="hidden";v.style.position="absolute";v.style.paddingLeft=this.borderWidth+"px";v.style.paddingRight=this.borderWidth+"px";v.style.height=H+"px";v.style.top=-H+"px";v.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(v)}if(M){var v=document.createElement("div");v.style.width=this.boxWidth+"px";v.style.fontSize="1px";v.style.overflow="hidden";v.style.position="absolute";v.style.paddingLeft=this.borderWidthB+"px";v.style.paddingRight=this.borderWidthB+"px";v.style.height=M+"px";v.style.bottom=-M+"px";v.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(v)}var AG=this.spec.cornerNames();for(var AK in AG){if(!isNaN(AK)){var AC=AG[AK];var AD=this.spec[AC+"R"];var AE,AH,j,AF;if(AC=="tr"||AC=="tl"){AE=this.borderWidth;AH=this.borderColour;AF=this.borderWidth}else{AE=this.borderWidthB;AH=this.borderColourB;AF=this.borderWidthB}j=AD-AF;var u=document.createElement("div");u.style.height=this.spec.get(AC+"Ru");u.style.width=this.spec.get(AC+"Ru");u.style.position="absolute";u.style.fontSize="1px";u.style.overflow="hidden";var r,q,p;var n=filter?parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]):100;for(r=0;r=j)?-1:Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow(r+1,2)))-1;if(j!=AD){var h=(r>=j)?-1:Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(r,2)));var f=(r+1>=AD)?-1:Math.floor(Math.sqrt(Math.pow(AD,2)-Math.pow((r+1),2)))-1}var d=(r>=AD)?-1:Math.ceil(Math.sqrt(Math.pow(AD,2)-Math.pow(r,2)));if(m>-1){this.drawPixel(r,0,this.boxColour,n,(m+1),u,true,AD)}if(j!=AD){if(this.spec.antiAlias){for(q=m+1;q=30,AD)}else{if(this.boxColour!=="transparent"){var AB=curvyObject.BlendColour(this.boxColour,AH,curvyObject.pixelFraction(r,q,j));this.drawPixel(r,q,AB,n,1,u,false,AD)}else{this.drawPixel(r,q,AH,n>>1,1,u,false,AD)}}}if(f>=h){if(h==-1){h=0}this.drawPixel(r,h,AH,n,(f-h+1),u,false,0)}p=AH;q=f}else{if(f>m){this.drawPixel(r,(m+1),AH,n,(f-m),u,false,0)}}}else{p=this.boxColour;q=m}if(this.spec.antiAlias){while(++q>>4]+""+A[B&15]};curvyObject.BlendColour=function(L,J,G){if(L==="transparent"||J==="transparent"){throw this.newError("Cannot blend with transparent")}if(L.charAt(0)!=="#"){L=curvyObject.format_colour(L)}if(J.charAt(0)!=="#"){J=curvyObject.format_colour(J)}var D=parseInt(L.substr(1,2),16);var K=parseInt(L.substr(3,2),16);var F=parseInt(L.substr(5,2),16);var C=parseInt(J.substr(1,2),16);var I=parseInt(J.substr(3,2),16);var E=parseInt(J.substr(5,2),16);if(G>1||G<0){G=1}var H=Math.round((D*G)+(C*(1-G)));if(H>255){H=255}if(H<0){H=0}var B=Math.round((K*G)+(I*(1-G)));if(B>255){B=255}if(B<0){B=0}var A=Math.round((F*G)+(E*(1-G)));if(A>255){A=255}if(A<0){A=0}return"#"+curvyObject.IntToHex(H)+curvyObject.IntToHex(B)+curvyObject.IntToHex(A)};curvyObject.pixelFraction=function(H,G,A){var J;var E=A*A;var B=new Array(2);var F=new Array(2);var I=0;var C="";var D=Math.sqrt(E-Math.pow(H,2));if(D>=G&&D<(G+1)){C="Left";B[I]=0;F[I]=D-G;++I}D=Math.sqrt(E-Math.pow(G+1,2));if(D>=H&&D<(H+1)){C+="Top";B[I]=D-H;F[I]=1;++I}D=Math.sqrt(E-Math.pow(H+1,2));if(D>=G&&D<(G+1)){C+="Right";B[I]=1;F[I]=D-G;++I}D=Math.sqrt(E-Math.pow(G,2));if(D>=H&&D<(H+1)){C+="Bottom";B[I]=D-H;F[I]=0}switch(C){case"LeftRight":J=Math.min(F[0],F[1])+((Math.max(F[0],F[1])-Math.min(F[0],F[1]))/2);break;case"TopRight":J=1-(((1-B[0])*(1-F[1]))/2);break;case"TopBottom":J=Math.min(B[0],B[1])+((Math.max(B[0],B[1])-Math.min(B[0],B[1]))/2);break;case"LeftBottom":J=F[0]*B[1]/2;break;default:J=1}return J};curvyObject.rgb2Array=function(A){var B=A.substring(4,A.indexOf(")"));return B.split(", ")};curvyObject.rgb2Hex=function(B){try{var C=curvyObject.rgb2Array(B);var G=parseInt(C[0]);var E=parseInt(C[1]);var A=parseInt(C[2]);var D="#"+curvyObject.IntToHex(G)+curvyObject.IntToHex(E)+curvyObject.IntToHex(A)}catch(F){var H="getMessage" in F?F.getMessage():F.message;throw new Error("Error ("+H+") converting RGB value to Hex in rgb2Hex")}return D};curvyObject.setOpacity=function(F,C){C=(C==100)?99.999:C;if(curvyBrowser.isSafari&&F.tagName!="IFRAME"){var B=curvyObject.rgb2Array(F.style.backgroundColor);var E=parseInt(B[0]);var D=parseInt(B[1]);var A=parseInt(B[2]);F.style.backgroundColor="rgba("+E+", "+D+", "+A+", "+C/100+")"}else{if(typeof F.style.opacity!=="undefined"){F.style.opacity=C/100}else{if(typeof F.style.MozOpacity!=="undefined"){F.style.MozOpacity=C/100}else{if(typeof F.style.filter!="undefined"){F.style.filter="alpha(opacity="+C+")"}else{if(typeof F.style.KHTMLOpacity!="undefined"){F.style.KHTMLOpacity=C/100}}}}}};function addEvent(D,C,B,A){if(D.addEventListener){D.addEventListener(C,B,A);return true}if(D.attachEvent){return D.attachEvent("on"+C,B)}D["on"+C]=B;return false}curvyObject.getComputedColour=function(E){var F=document.createElement("DIV");F.style.backgroundColor=E;document.body.appendChild(F);if(window.getComputedStyle){var D=document.defaultView.getComputedStyle(F,null).getPropertyValue("background-color");F.parentNode.removeChild(F);if(D.substr(0,3)==="rgb"){D=curvyObject.rgb2Hex(D)}return D}else{var A=document.body.createTextRange();A.moveToElementText(F);A.execCommand("ForeColor",false,E);var B=A.queryCommandValue("ForeColor");var C="rgb("+(B&255)+", "+((B&65280)>>8)+", "+((B&16711680)>>16)+")";F.parentNode.removeChild(F);A=null;return curvyObject.rgb2Hex(C)}};curvyObject.format_colour=function(A){if(A!=""&&A!="transparent"){if(A.substr(0,3)==="rgb"){A=curvyObject.rgb2Hex(A)}else{if(A.charAt(0)!=="#"){A=curvyObject.getComputedColour(A)}else{if(A.length===4){A="#"+A.charAt(1)+A.charAt(1)+A.charAt(2)+A.charAt(2)+A.charAt(3)+A.charAt(3)}}}}return A};curvyCorners.getElementsByClass=function(H,F){var E=new Array;if(F===undefined){F=document}H=H.split(".");var A="*";if(H.length===1){A=H[0];H=false}else{if(H[0]){A=H[0]}H=H[1]}var D,C,B;if(A.charAt(0)==="#"){C=document.getElementById(A.substr(1));if(C){E.push(C)}}else{C=F.getElementsByTagName(A);B=C.length;if(H){var G=new RegExp("(^|\\s)"+H+"(\\s|$)");for(D=0;D6){var H=J["-webkit-border-radius"]||0;var K=J["-webkit-border-top-right-radius"]||0;var F=J["-webkit-border-top-left-radius"]||0;var G=J["-webkit-border-bottom-right-radius"]||0;var M=J["-webkit-border-bottom-left-radius"]||0}else{var H=J["webkit-border-radius"]||0;var K=J["webkit-border-top-right-radius"]||0;var F=J["webkit-border-top-left-radius"]||0;var G=J["webkit-border-bottom-right-radius"]||0;var M=J["webkit-border-bottom-left-radius"]||0}if(H||F||K||G||M){var I=new curvyCnrSpec(L.selectorText);if(H){I.setcorner(null,null,parseInt(H),B(H))}else{if(K){I.setcorner("t","r",parseInt(K),B(K))}if(F){I.setcorner("t","l",parseInt(F),B(F))}if(M){I.setcorner("b","l",parseInt(M),B(M))}if(G){I.setcorner("b","r",parseInt(G),B(G))}}curvyCorners(I)}}for(E=0;E';
+ if (!this.selectedFound) this.selectedNode = null;
+ this.completed = true;
+ return str;
+};
+
+// Creates the tree structure
+dTree.prototype.addNode = function(pNode) {
+ var str = '';
+ var n=0;
+ if (this.config.inOrder) n = pNode._ai;
+ for (n; n ';
+ }
+ if (node.url) {
+ str += '';
+ }
+ else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
+ str += ' ';
+ str += node.name;
+ if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ' ';
+ str += '';
+ if (node._hc) {
+ str += '';
+ str += this.addNode(node);
+ str += '
';
+ }
+ this.aIndent.pop();
+ return str;
+};
+
+// Adds the empty and line icons
+dTree.prototype.indent = function(node, nodeId) {
+ var str = '';
+ if (this.root.id != node.pid) {
+ for (var n=0; n ';
+ (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
+ if (node._hc) {
+ str += ' ';
+ } else str += ' ';
+ }
+ return str;
+};
+
+// Checks if a node has any children and if it is the last sibling
+dTree.prototype.setCS = function(node) {
+ var lastId;
+ for (var n=0; n)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
+function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;ba ";
+var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
+parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML=" ";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
+s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
+applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
+else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
+a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
+w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
+cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
+c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
+a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
+function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
+k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
+C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type=
+e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
+f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
+if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
+e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
+"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
+d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
+t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
+g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
+h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l ";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
+q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=" ";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="
";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
+function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
+{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"+d+">"},F={option:[1,""," "],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
+prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
+this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
+""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
+return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
+""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
+c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
+c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
+function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
+Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
+"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
+a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
+a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/
+
+
+
+
+
+
+
+
+