diff --git a/Makefile b/Makefile index b1b2478ed7..4e0a23cea0 100644 --- a/Makefile +++ b/Makefile @@ -186,6 +186,9 @@ clean: dist_clean : clean +ab_clean: + find sw/airborne -name '*~' -exec rm -f {} \; + test_all_example_airframes: $(MAKE) AIRCRAFT=BOOZ2_A2 clean_ac ap $(MAKE) AIRCRAFT=MJ5 clean_ac ap sim diff --git a/conf/airframes/antenna.xml b/conf/airframes/antenna.xml index 8b1522db1f..70383c9f25 100644 --- a/conf/airframes/antenna.xml +++ b/conf/airframes/antenna.xml @@ -22,7 +22,7 @@ ant.EXT_FUSE = ff ant.LOCK_FUSE = ff -ant.CFLAGS += -DCONFIG=\"antenna.h\" +ant.CFLAGS += -DBOARD_CONFIG=\"antenna.h\" ant.srcs = main_antenna.c sys_time.c $(SRC_ARCH)/sys_time_hw.c ant.CFLAGS += -DLED diff --git a/conf/airframes/bl_mc.xml b/conf/airframes/bl_mc.xml index 594e30085a..28fcccf198 100644 --- a/conf/airframes/bl_mc.xml +++ b/conf/airframes/bl_mc.xml @@ -22,7 +22,7 @@ LOCK_FUSE = ff #EXT_FUSE = ff #LOCK_FUSE = ff -main.CFLAGS += -DCONFIG=\"conf_bl_mc.h\" +main.CFLAGS += -DBOARD_CONFIG=\"conf_bl_mc.h\" main.srcs = main_bl_mc.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-2)' diff --git a/conf/airframes/black_one.xml b/conf/airframes/black_one.xml index f10f4ae10e..fc394c39a7 100644 --- a/conf/airframes/black_one.xml +++ b/conf/airframes/black_one.xml @@ -216,7 +216,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -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 @@ -270,7 +270,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DIR_360 +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DIR_360 sim.srcs += bomb.c #Csim.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM diff --git a/conf/airframes/booz2_a1.xml b/conf/airframes/booz2_a1.xml index 8c3cc33382..b77c4b8e3b 100644 --- a/conf/airframes/booz2_a1.xml +++ b/conf/airframes/booz2_a1.xml @@ -113,10 +113,10 @@
- - - - + + + + @@ -135,8 +135,7 @@
- - +
@@ -164,9 +163,13 @@ +ARCH=lpc21 +BOARD_CFG = \"booz2_board_v1_0.h\" + # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile @@ -178,8 +181,7 @@ ap.CFLAGS += -DMODEM_BAUD=B57600 include $(PAPARAZZI_SRC)/conf/autopilot/booz2_radio_control_ppm.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_buss.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1.makefile - - +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_gps.makefile diff --git a/conf/airframes/booz2_a2.xml b/conf/airframes/booz2_a2.xml index 1324be6260..a623d07ff7 100644 --- a/conf/airframes/booz2_a2.xml +++ b/conf/airframes/booz2_a2.xml @@ -102,15 +102,15 @@
- - - - + + + + - + - +
@@ -139,10 +139,13 @@
+ARCH=lpc21 +BOARD_CFG = \"booz2_board_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile @@ -153,6 +156,7 @@ ap.CFLAGS += -DMODEM_BAUD=B57600 include $(PAPARAZZI_SRC)/conf/autopilot/booz2_radio_control_ppm.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_asctec.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_crista.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_gps.makefile diff --git a/conf/airframes/booz2_a3.xml b/conf/airframes/booz2_a3.xml index b92a3baa44..b63d54b2a2 100644 --- a/conf/airframes/booz2_a3.xml +++ b/conf/airframes/booz2_a3.xml @@ -102,15 +102,15 @@
- - - - + + + + - + - +
@@ -139,10 +139,13 @@
+ARCH=lpc21 +BOARD_CFG = \"booz2_board_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile @@ -151,7 +154,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/booz2_simulator.makefile ap.CFLAGS += -DMODEM_BAUD=B57600 include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_asctec.makefile -#include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_radio_control_spektrum.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1_1.makefile diff --git a/conf/airframes/booz2_a4.xml b/conf/airframes/booz2_a4.xml index 6e373a9788..c67e701139 100644 --- a/conf/airframes/booz2_a4.xml +++ b/conf/airframes/booz2_a4.xml @@ -105,15 +105,15 @@
- - - - + + + + - + - +
@@ -142,12 +142,13 @@ - - +ARCH=lpc21 +BOARD_CFG = \"booz2_board_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile @@ -155,12 +156,9 @@ sim.CFLAGS += -DBSM_PARAMS=\"booz_sensors_model_params_booz2_a2.h\" include $(PAPARAZZI_SRC)/conf/autopilot/booz2_simulator.makefile ap.CFLAGS += -DMODEM_BAUD=B57600 -#include $(PAPARAZZI_SRC)/conf/autopilot/radio_control_ppm.makefile -#ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_DX7 include $(PAPARAZZI_SRC)/conf/autopilot/radio_control_spektrum.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_asctec.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1_1.makefile -include $(PAPARAZZI_SRC)/conf/autopilot/booz2_gps.makefile ap.CFLAGS += -DUSE_BOOZ2_CONTROL_SURFACES -DUSE_BOOZ2_SERVOS_DIRECT ap.CFLAGS += -DUSE_BOOZ2_SERVOS_DIRECT_0 -DUSE_BOOZ2_SERVOS_DIRECT_1 diff --git a/conf/airframes/booz2_flixr.xml b/conf/airframes/booz2_flixr.xml index 08e462fa5c..c6e88e30cf 100644 --- a/conf/airframes/booz2_flixr.xml +++ b/conf/airframes/booz2_flixr.xml @@ -112,26 +112,20 @@ -
- - - -
-
- - - - + + + + - + - +
@@ -154,18 +148,23 @@ +ARCH=lpc21 +BOARD_CFG = \"booz2_board_v1_0.h\" + # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS ap.CFLAGS += -DKILL_SWITCH=RADIO_SWITCH1 ap.CFLAGS += -DMODEM_BAUD=B57600 +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_simulator.makefile + include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_buss.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_radio_control_ppm.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1.makefile -include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile -include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile -include $(PAPARAZZI_SRC)/conf/autopilot/booz2_simulator.makefile diff --git a/conf/airframes/booz2_g1.xml b/conf/airframes/booz2_g1.xml index ebdf373cfd..ac39cfc6c6 100644 --- a/conf/airframes/booz2_g1.xml +++ b/conf/airframes/booz2_g1.xml @@ -100,15 +100,15 @@
- - - - + + + + - + - +
@@ -161,6 +161,7 @@ ap.CFLAGS += -DMODEM_BAUD=B57600 include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_asctec.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_radio_control_ppm.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1_1.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_gps.makefile ap.CFLAGS += -DUSE_CAM ap.srcs += $(SRC_BOOZ_ARCH)/booz2_pwm_hw.c $(SRC_BOOZ)/booz2_cam.c diff --git a/conf/airframes/booz2_j1.xml b/conf/airframes/booz2_j1.xml index 100eadf81a..cb2299fe16 100644 --- a/conf/airframes/booz2_j1.xml +++ b/conf/airframes/booz2_j1.xml @@ -109,15 +109,15 @@
- - - - + + + + - + - +
diff --git a/conf/airframes/booz2_s1.xml b/conf/airframes/booz2_s1.xml index fc6d41d541..14ee6cab1c 100644 --- a/conf/airframes/booz2_s1.xml +++ b/conf/airframes/booz2_s1.xml @@ -111,15 +111,15 @@
- - - - + + + + - + - +
@@ -161,9 +161,13 @@ +ARCH=lpc21 +BOARD_CFG = \"booz2_board_v1_0.h\" + # prevents motors from ever starting # ap.CFLAGS += -DKILL_MOTORS +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile @@ -171,8 +175,7 @@ ap.CFLAGS += -DMODEM_BAUD=B57600 include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_buss.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_radio_control_ppm.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1_1.makefile - - +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_gps.makefile diff --git a/conf/airframes/booz2_x1.xml b/conf/airframes/booz2_x1.xml index 116a0681f8..9fb4a27be2 100644 --- a/conf/airframes/booz2_x1.xml +++ b/conf/airframes/booz2_x1.xml @@ -114,15 +114,15 @@
- - - - + + + + - + - +
@@ -159,17 +159,21 @@ +ARCH=lpc21 +BOARD_CFG = \"booz2_board_v1_0.h\" + # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS ap.CFLAGS += -DMODEM_BAUD=B57600 + +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_autopilot.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_actuators_buss.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_radio_control_ppm.makefile include $(PAPARAZZI_SRC)/conf/autopilot/booz2_imu_b2v1_1.makefile - -include $(PAPARAZZI_SRC)/conf/autopilot/booz2_test_progs.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_gps.makefile diff --git a/conf/airframes/dc_mc.xml b/conf/airframes/dc_mc.xml index 3a3524e3a7..d7f707b6cc 100644 --- a/conf/airframes/dc_mc.xml +++ b/conf/airframes/dc_mc.xml @@ -16,7 +16,7 @@ main.HIGH_FUSE = cb main.EXT_FUSE = ff main.LOCK_FUSE = ff -main.CFLAGS += -DCONFIG=\"conf_dc_mc.h\" +main.CFLAGS += -DBOARD_CONFIG=\"conf_dc_mc.h\" main.srcs = main_dc_mc.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' diff --git a/conf/airframes/demo.xml b/conf/airframes/demo.xml index 43bcfd2e59..f073369d29 100644 --- a/conf/airframes/demo.xml +++ b/conf/airframes/demo.xml @@ -15,7 +15,7 @@ demo1.ARCH = arm7tdmi demo1.TARGET = demo1 demo1.TARGETDIR = demo1 -demo1.CFLAGS += -DCONFIG=\"conf_demo.h\" +demo1.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" demo1.srcs = main_demo1.c # @@ -26,7 +26,7 @@ demo2.ARCH = arm7tdmi demo2.TARGET = demo2 demo2.TARGETDIR = demo2 -demo2.CFLAGS += -DCONFIG=\"conf_demo.h\" +demo2.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" demo2.srcs = main_demo2.c demo2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' @@ -42,7 +42,7 @@ demo3.ARCH = arm7tdmi demo3.TARGET = demo3 demo3.TARGETDIR = demo3 -demo3.CFLAGS += -DCONFIG=\"conf_demo.h\" +demo3.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" demo3.srcs = main_demo3.c demo3.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-1)' @@ -64,7 +64,7 @@ demo4.ARCH = arm7tdmi demo4.TARGET = demo4 demo4.TARGETDIR = demo4 -demo4.CFLAGS += -DCONFIG=\"conf_demo.h\" +demo4.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" demo4.srcs = main_demo4.c demo4.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' @@ -90,7 +90,7 @@ demo5.ARCH = arm7tdmi demo5.TARGET = demo5 demo5.TARGETDIR = demo5 -demo5.CFLAGS += -DCONFIG=\"conf_demo.h\" +demo5.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" demo5.srcs = main_demo5.c demo5.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' @@ -117,7 +117,7 @@ demo6.ARCH = arm7tdmi demo6.TARGET = demo6 demo6.TARGETDIR = demo6 -demo6.CFLAGS += -DCONFIG=\"conf_demo.h\" +demo6.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" demo6.srcs = main_demo6.c demo6.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' @@ -147,7 +147,7 @@ test_spk.ARCH = arm7tdmi test_spk.TARGET = test_spk test_spk.TARGETDIR = test_spk -test_spk.CFLAGS += -DCONFIG=\"booz2_board_usb.h\" +test_spk.CFLAGS += -DBOARD_CONFIG=\"booz2_board_usb.h\" test_spk.srcs = main_test_spk.c test_spk.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' diff --git a/conf/airframes/demo_module.xml b/conf/airframes/demo_module.xml index 103814f0b3..5d17d27283 100644 --- a/conf/airframes/demo_module.xml +++ b/conf/airframes/demo_module.xml @@ -165,7 +165,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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.CFLAGS += -DINTER_MCU @@ -207,7 +207,7 @@ ap.CFLAGS += -DUSE_MODULES # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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/easy_glider1.xml b/conf/airframes/easy_glider1.xml index e75f971dbd..f1438e5b75 100644 --- a/conf/airframes/easy_glider1.xml +++ b/conf/airframes/easy_glider1.xml @@ -162,7 +162,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -206,7 +206,7 @@ ap.srcs += adc_generic.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c
diff --git a/conf/airframes/example.xml b/conf/airframes/example.xml index 4ea1239ea8..c0d82d24bf 100644 --- a/conf/airframes/example.xml +++ b/conf/airframes/example.xml @@ -17,7 +17,7 @@ example_gps.ARCH = arm7tdmi example_gps.TARGET = example_gps example_gps.TARGETDIR = example_gps -example_gps.CFLAGS += -DCONFIG=\"conf_demo.h\" +example_gps.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" example_gps.srcs = example/example_gps.c example_gps.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' diff --git a/conf/airframes/funjet1.xml b/conf/airframes/funjet1.xml index f0a0caf2c5..bbd77b0e11 100644 --- a/conf/airframes/funjet1.xml +++ b/conf/airframes/funjet1.xml @@ -216,7 +216,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -274,7 +274,7 @@ ap.srcs += dc.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_line.c nav_survey_rectangle.c # -DENOSE @@ -292,7 +292,7 @@ setup_actuators.ARCH = arm7tdmi setup_actuators.TARGET = setup_actuators setup_actuators.TARGETDIR = setup_actuators -setup_actuators.CFLAGS += -DFBW -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART1 -DUART1_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart1 +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART1 -DUART1_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart1 setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c
diff --git a/conf/airframes/funjeteth1.xml b/conf/airframes/funjeteth1.xml index 1a44c48602..c05cfd20c6 100644 --- a/conf/airframes/funjeteth1.xml +++ b/conf/airframes/funjeteth1.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -236,7 +236,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/funjetgfi1.xml b/conf/airframes/funjetgfi1.xml index 1712089dab..3ed57aae7b 100755 --- a/conf/airframes/funjetgfi1.xml +++ b/conf/airframes/funjetgfi1.xml @@ -196,7 +196,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -260,7 +260,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c sim.srcs += joystick.c diff --git a/conf/airframes/funjetgfi3.xml b/conf/airframes/funjetgfi3.xml index 84c235965f..b6b02f57a8 100755 --- a/conf/airframes/funjetgfi3.xml +++ b/conf/airframes/funjetgfi3.xml @@ -196,7 +196,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -264,7 +264,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c diff --git a/conf/airframes/funjetgfi4.xml b/conf/airframes/funjetgfi4.xml index 212a4399b7..e7cf0842f4 100644 --- a/conf/airframes/funjetgfi4.xml +++ b/conf/airframes/funjetgfi4.xml @@ -186,7 +186,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -235,7 +235,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/funjetgfi5.xml b/conf/airframes/funjetgfi5.xml index f1ec95db64..5918414400 100644 --- a/conf/airframes/funjetgfi5.xml +++ b/conf/airframes/funjetgfi5.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -236,7 +236,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/funjetgfi6.xml b/conf/airframes/funjetgfi6.xml index 2d873eac88..5a47a113f0 100644 --- a/conf/airframes/funjetgfi6.xml +++ b/conf/airframes/funjetgfi6.xml @@ -191,7 +191,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -240,7 +240,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/funjetgfi7.xml b/conf/airframes/funjetgfi7.xml index 3308834590..745e98b52a 100644 --- a/conf/airframes/funjetgfi7.xml +++ b/conf/airframes/funjetgfi7.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -236,7 +236,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/funjetgfi8.xml b/conf/airframes/funjetgfi8.xml index 5f9e42056a..4e026db017 100644 --- a/conf/airframes/funjetgfi8.xml +++ b/conf/airframes/funjetgfi8.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -236,7 +236,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/funjetmm.xml b/conf/airframes/funjetmm.xml index e5e3a85432..dd21d6b038 100755 --- a/conf/airframes/funjetmm.xml +++ b/conf/airframes/funjetmm.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -236,7 +236,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/glass_one1.xml b/conf/airframes/glass_one1.xml index 8864269a5e..f836dcfc08 100755 --- a/conf/airframes/glass_one1.xml +++ b/conf/airframes/glass_one1.xml @@ -206,7 +206,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -260,7 +260,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM +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 += traffic_info.c nav_line.c diff --git a/conf/airframes/glass_one2.xml b/conf/airframes/glass_one2.xml index 80bda70602..63aa4b1841 100755 --- a/conf/airframes/glass_one2.xml +++ b/conf/airframes/glass_one2.xml @@ -180,7 +180,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -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 @@ -231,7 +231,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM +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 += traffic_info.c nav_line.c diff --git a/conf/airframes/glass_one3.xml b/conf/airframes/glass_one3.xml index 0273590037..449e605a65 100755 --- a/conf/airframes/glass_one3.xml +++ b/conf/airframes/glass_one3.xml @@ -207,7 +207,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -258,7 +258,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM +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 += traffic_info.c nav_line.c diff --git a/conf/airframes/hitl_usb.xml b/conf/airframes/hitl_usb.xml index 769dce5a2d..dfaaa9942b 100644 --- a/conf/airframes/hitl_usb.xml +++ b/conf/airframes/hitl_usb.xml @@ -115,7 +115,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -153,7 +153,7 @@ sim.TARGET = autopilot sim.TARGETDIR = autopilot sim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -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.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c diff --git a/conf/airframes/holiday50.xml b/conf/airframes/holiday50.xml index cf28ceff20..24e6862826 100644 --- a/conf/airframes/holiday50.xml +++ b/conf/airframes/holiday50.xml @@ -238,7 +238,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP # main files (including the 60Hz timing) -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 # Command allocation and Radio Mixers @@ -295,7 +295,7 @@ ap.srcs += bomb.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO -DSTRONG_WIND +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 # traffic_info.c #sim.CFLAGS += -DUSE_AIRSPEED diff --git a/conf/airframes/jsbsim.xml b/conf/airframes/jsbsim.xml index 91d0e086c5..336809b75d 100644 --- a/conf/airframes/jsbsim.xml +++ b/conf/airframes/jsbsim.xml @@ -232,7 +232,7 @@ sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lmeschach -lpcre -lglibivy -L$( sim.CFLAGS += -DJSBSIM_ROOT_DIR=\"/home/violato/enac/programs/JSBSim/\" -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 -DINFRARED -DNAV diff --git a/conf/airframes/logger_sd.xml b/conf/airframes/logger_sd.xml index baac50c910..7069bf41fd 100644 --- a/conf/airframes/logger_sd.xml +++ b/conf/airframes/logger_sd.xml @@ -43,7 +43,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_logger.c ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 diff --git a/conf/airframes/mac06a.xml b/conf/airframes/mac06a.xml index b9b7dba5f2..959ec37e6b 100755 --- a/conf/airframes/mac06a.xml +++ b/conf/airframes/mac06a.xml @@ -200,7 +200,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -249,7 +249,7 @@ ap.srcs += bomb.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360 +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360 sim.srcs += bomb.c diff --git a/conf/airframes/malolo_sim.xml b/conf/airframes/malolo_sim.xml index a02dab3e82..16695de0ec 100644 --- a/conf/airframes/malolo_sim.xml +++ b/conf/airframes/malolo_sim.xml @@ -232,7 +232,7 @@ sim.CFLAGS += -I$(SIMDIR) -I/home/cocoleon/usr/include/JSBSim -I/usr/include sim.CFLAGS += `pkg-config glib-2.0 --cflags` sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -L/home/cocoleon/usr/lib/ -lJSBSim -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 -DINFRARED -DNAV diff --git a/conf/airframes/microjet5.xml b/conf/airframes/microjet5.xml index 06f1d9083d..5fc78c41d6 100644 --- a/conf/airframes/microjet5.xml +++ b/conf/airframes/microjet5.xml @@ -209,7 +209,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -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.CFLAGS += -DLED_3_BANK=0 -DLED_3_PIN=17 -DLED_4_BANK=0 -DLED_4_PIN=18 -DLED_5_BANK=0 -DLED_5_PIN=19 -DLED_6_BANK=0 -DLED_6_PIN=20 @@ -254,7 +254,7 @@ ap.srcs += gyro.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DTRAFFIC_INFO +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/microjet5_tp_auto.xml b/conf/airframes/microjet5_tp_auto.xml index 895cd77ab7..2eccb1fe63 100644 --- a/conf/airframes/microjet5_tp_auto.xml +++ b/conf/airframes/microjet5_tp_auto.xml @@ -177,7 +177,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -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.CFLAGS += -DLED_3_BANK=0 -DLED_3_PIN=17 -DLED_4_BANK=0 -DLED_4_PIN=18 -DLED_5_BANK=0 -DLED_5_PIN=19 -DLED_6_BANK=0 -DLED_6_PIN=20 @@ -226,7 +226,7 @@ ap.srcs += gyro.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c sim.CFLAGS += -DGYRO -DADXRS150 sim.srcs += gyro.c diff --git a/conf/airframes/microjet6.xml b/conf/airframes/microjet6.xml index 8b661e47c7..ddffdc3040 100755 --- a/conf/airframes/microjet6.xml +++ b/conf/airframes/microjet6.xml @@ -200,7 +200,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -253,7 +253,7 @@ ap.srcs += nav_line.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DUSE_BARO_MS5534A +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 diff --git a/conf/airframes/microjetI.xml b/conf/airframes/microjetI.xml index 3490e9b24c..0887e93e89 100644 --- a/conf/airframes/microjetI.xml +++ b/conf/airframes/microjetI.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -238,7 +238,7 @@ ap.srcs += adc_generic.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c sim.srcs += light.c diff --git a/conf/airframes/microjetII.xml b/conf/airframes/microjetII.xml index 3dcc8112f8..23b2dcc2d2 100644 --- a/conf/airframes/microjetII.xml +++ b/conf/airframes/microjetII.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -234,7 +234,7 @@ ap.CFLAGS += -DUSE_LIGHT # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/microjetIII.xml b/conf/airframes/microjetIII.xml index 9019374d0d..2db89203f0 100644 --- a/conf/airframes/microjetIII.xml +++ b/conf/airframes/microjetIII.xml @@ -176,7 +176,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -226,7 +226,7 @@ ap.srcs += adc_generic.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/minimag1.xml b/conf/airframes/minimag1.xml index 131f81b963..583ae1bcc4 100644 --- a/conf/airframes/minimag1.xml +++ b/conf/airframes/minimag1.xml @@ -175,7 +175,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -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 @@ -211,7 +211,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 += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c diff --git a/conf/airframes/minimag_fs.xml b/conf/airframes/minimag_fs.xml index 9f51ef2223..01a6937743 100644 --- a/conf/airframes/minimag_fs.xml +++ b/conf/airframes/minimag_fs.xml @@ -182,7 +182,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -219,7 +219,7 @@ ap.srcs += dc.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c sim.srcs += dc.c diff --git a/conf/airframes/mmlaas_N1.xml b/conf/airframes/mmlaas_N1.xml index b33488f092..cc5eba9b39 100644 --- a/conf/airframes/mmlaas_N1.xml +++ b/conf/airframes/mmlaas_N1.xml @@ -197,7 +197,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -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 @@ -249,7 +249,7 @@ ap.srcs += tcas.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DFORMATION -DTRAFFIC_INFO -DTCAS +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DFORMATION -DTRAFFIC_INFO -DTCAS sim.srcs += nav_survey_rectangle.c nav_line.c external.c traffic_info.c formation.c snav.c tcas.c diff --git a/conf/airframes/mmlaas_N2.xml b/conf/airframes/mmlaas_N2.xml index aaae673350..efe0b8cd6e 100644 --- a/conf/airframes/mmlaas_N2.xml +++ b/conf/airframes/mmlaas_N2.xml @@ -198,7 +198,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -247,7 +247,7 @@ ap.srcs += tcas.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DFORMATION -DTRAFFIC_INFO -DTCAS +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DFORMATION -DTRAFFIC_INFO -DTCAS sim.srcs += nav_survey_rectangle.c nav_line.c external.c traffic_info.c formation.c snav.c tcas.c diff --git a/conf/airframes/mmlaas_N3.xml b/conf/airframes/mmlaas_N3.xml index aaa660b227..9a25c1f258 100644 --- a/conf/airframes/mmlaas_N3.xml +++ b/conf/airframes/mmlaas_N3.xml @@ -198,7 +198,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -247,7 +247,7 @@ ap.srcs += tcas.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DFORMATION -DTRAFFIC_INFO -DTCAS +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DFORMATION -DTRAFFIC_INFO -DTCAS sim.srcs += nav_survey_rectangle.c nav_line.c external.c traffic_info.c formation.c snav.c tcas.c diff --git a/conf/airframes/motor_bench.xml b/conf/airframes/motor_bench.xml index 06a0e4a848..055d621cf4 100644 --- a/conf/airframes/motor_bench.xml +++ b/conf/airframes/motor_bench.xml @@ -13,7 +13,7 @@ main.ARCH = arm7tdmi main.TARGET = mb main.TARGETDIR = mb -main.CFLAGS += -DCONFIG=\"conf_motor_bench.h\" -I$(MB) +main.CFLAGS += -DBOARD_CONFIG=\"conf_motor_bench.h\" -I$(MB) main.srcs = $(MB)/main_motor_bench.c main.CFLAGS += -DPERIODIC_TASK_FREQ='250.' @@ -60,7 +60,7 @@ foo.ARCH = arm7tdmi foo.TARGET = mb foo.TARGETDIR = mb -foo.CFLAGS += -DCONFIG=\"conf_motor_bench.h\" -I$(MB) +foo.CFLAGS += -DBOARD_CONFIG=\"conf_motor_bench.h\" -I$(MB) foo.srcs = $(MB)/main_foo.c foo.CFLAGS += -DPERIODIC_TASK_FREQ='250.' @@ -82,7 +82,7 @@ bar.ARCH = arm7tdmi bar.TARGET = mb bar.TARGETDIR = mb -bar.CFLAGS += -DCONFIG=\"conf_motor_bench.h\" -I$(MB) +bar.CFLAGS += -DBOARD_CONFIG=\"conf_motor_bench.h\" -I$(MB) bar.srcs = $(MB)/main_bar.c bar.CFLAGS += -DPERIODIC_TASK_FREQ='250.' diff --git a/conf/airframes/nova.xml b/conf/airframes/nova.xml index 923162e461..11ae945eba 100644 --- a/conf/airframes/nova.xml +++ b/conf/airframes/nova.xml @@ -11,7 +11,7 @@ timu.ARCH = arm7tdmi timu.TARGET = timu timu.TARGETDIR = timu -timu.CFLAGS += -DCONFIG=\"tiny_2_0.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-1)' +timu.CFLAGS += -DBOARD_CONFIG=\"tiny_2_0.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-1)' timu.srcs = nova_test_imu.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c timu.CFLAGS += -DLED -DLED -DTIME_LED=1 diff --git a/conf/airframes/osam_xsens_twog.xml b/conf/airframes/osam_xsens_twog.xml index 544636a4b5..06fc9867d4 100644 --- a/conf/airframes/osam_xsens_twog.xml +++ b/conf/airframes/osam_xsens_twog.xml @@ -165,7 +165,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -207,7 +207,7 @@ ap.srcs += nav_line.c nav_survey_rectangle.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c diff --git a/conf/airframes/pt_ant.xml b/conf/airframes/pt_ant.xml index 7ab64913ea..d6a105298d 100644 --- a/conf/airframes/pt_ant.xml +++ b/conf/airframes/pt_ant.xml @@ -13,7 +13,7 @@ tunnel.ARCH = arm7tdmi tunnel.TARGET = tunnel tunnel.TARGETDIR = tunnel -tunnel.CFLAGS += -DFBW -DCONFIG=\"conf_demo.h\" -DLED -DTIME_LED=1 +tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"conf_demo.h\" -DLED -DTIME_LED=1 tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c ARCHI=arm7 @@ -26,7 +26,7 @@ main.ARCH = arm7tdmi main.TARGET = main main.TARGETDIR = main -main.CFLAGS += -DCONFIG=\"conf_demo.h\" -I$(PT_ANT) +main.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" -I$(PT_ANT) main.srcs = $(PT_ANT)/pt_ant_main.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1.66666667e-2)' diff --git a/conf/airframes/red_one.xml b/conf/airframes/red_one.xml index 2637577b65..c7e914df2a 100755 --- a/conf/airframes/red_one.xml +++ b/conf/airframes/red_one.xml @@ -227,7 +227,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -287,7 +287,7 @@ ap.CFLAGS += -DUSE_CURRENT # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM +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.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH diff --git a/conf/airframes/slayer1.xml b/conf/airframes/slayer1.xml index bc476cecf1..d554d3d1a5 100644 --- a/conf/airframes/slayer1.xml +++ b/conf/airframes/slayer1.xml @@ -192,7 +192,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -243,7 +243,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/slayer2.xml b/conf/airframes/slayer2.xml index bba4b1d4b2..856f5a3d7c 100644 --- a/conf/airframes/slayer2.xml +++ b/conf/airframes/slayer2.xml @@ -197,7 +197,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -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 @@ -262,7 +262,7 @@ ap.CFLAGS += -D BARO_MS5534A_W1=0xAC20 -D BARO_MS5534A_W2=0x87D9 -D BARO_MS5534A # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DUSE_BARO_MS5534A +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DUSE_BARO_MS5534A sim.srcs += nav_survey_rectangle.c bomb.c $(SRC_ARCH)/sim_baro.c nav_line.c diff --git a/conf/airframes/slayer3.xml b/conf/airframes/slayer3.xml index bfdb1e8afc..8bb17e67b0 100755 --- a/conf/airframes/slayer3.xml +++ b/conf/airframes/slayer3.xml @@ -194,7 +194,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -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 @@ -244,7 +244,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360 +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360 sim.srcs += nav_survey_rectangle.c diff --git a/conf/airframes/slayerJH.xml b/conf/airframes/slayerJH.xml index a84cbc2478..6fbbc1ea59 100644 --- a/conf/airframes/slayerJH.xml +++ b/conf/airframes/slayerJH.xml @@ -175,7 +175,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -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 @@ -227,7 +227,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c snav.c diff --git a/conf/airframes/slicer1.xml b/conf/airframes/slicer1.xml index a712c45ad9..462c8a9384 100644 --- a/conf/airframes/slicer1.xml +++ b/conf/airframes/slicer1.xml @@ -186,7 +186,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -231,7 +231,7 @@ ap.srcs += cam.c point.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c sim.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH_ROLL sim.srcs += cam.c point.c traffic_info.c diff --git a/conf/airframes/slicer2.xml b/conf/airframes/slicer2.xml index 3276e3645c..65b95b510f 100644 --- a/conf/airframes/slicer2.xml +++ b/conf/airframes/slicer2.xml @@ -168,7 +168,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -208,7 +208,7 @@ ap.srcs += nav_line.c nav_survey_rectangle.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c diff --git a/conf/airframes/spirit.xml b/conf/airframes/spirit.xml index 080995fea9..f4dfb08c7b 100755 --- a/conf/airframes/spirit.xml +++ b/conf/airframes/spirit.xml @@ -185,7 +185,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -230,7 +230,7 @@ ap.srcs += adc_generic.c # Configuration for Hardware In The Loop* # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A diff --git a/conf/airframes/spirit_proto.xml b/conf/airframes/spirit_proto.xml index 2f987a9070..0845fd51a8 100755 --- a/conf/airframes/spirit_proto.xml +++ b/conf/airframes/spirit_proto.xml @@ -173,7 +173,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -217,7 +217,7 @@ ap.srcs += adc_generic.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A diff --git a/conf/airframes/storm1.xml b/conf/airframes/storm1.xml index 60baa0c617..f82c52b7fa 100755 --- a/conf/airframes/storm1.xml +++ b/conf/airframes/storm1.xml @@ -228,7 +228,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -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 @@ -289,7 +289,7 @@ ap.srcs += $(SRC_ARCH)/gpio.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360 +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 diff --git a/conf/airframes/test_i2c.xml b/conf/airframes/test_i2c.xml index 4b3f4ddf45..bb5f88a3fc 100644 --- a/conf/airframes/test_i2c.xml +++ b/conf/airframes/test_i2c.xml @@ -19,7 +19,7 @@ LPC21ISP_XTAL = 12000 #FLASH_MODE = IAP FLASH_MODE = ISP -mb.CFLAGS += -DCONFIG=\"conf_motor_bench.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-3)' +mb.CFLAGS += -DBOARD_CONFIG=\"conf_motor_bench.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-3)' mb.srcs = $(SRC_ARCH)/main_test_i2c.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c mb.CFLAGS += -DLED diff --git a/conf/airframes/tiny2.xml b/conf/airframes/tiny2.xml index 9c52b116ab..7eef908d30 100644 --- a/conf/airframes/tiny2.xml +++ b/conf/airframes/tiny2.xml @@ -199,7 +199,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -240,7 +240,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 += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/tiny_hitl.xml b/conf/airframes/tiny_hitl.xml index e1ab49c94e..c2fd383b88 100644 --- a/conf/airframes/tiny_hitl.xml +++ b/conf/airframes/tiny_hitl.xml @@ -165,7 +165,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -205,7 +205,7 @@ ap.CFLAGS += -DHITL -UGPS_CONFIGURE -UUART0_BAUD -DUART0_BAUD=B57600 # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += nav_survey_rectangle.c nav_line.c traffic_info.c diff --git a/conf/airframes/tl.xml b/conf/airframes/tl.xml index 58cbc55c8b..abdc554d6c 100644 --- a/conf/airframes/tl.xml +++ b/conf/airframes/tl.xml @@ -86,7 +86,7 @@ ap.ARCH = arm7tdmi ap.TARGET = flt ap.TARGETDIR = flt -ap.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' -I$(TL) +ap.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' -I$(TL) ap.srcs = $(TL)/tl_main.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c ap.CFLAGS += -DLED -DLED -DTIME_LED=1 @@ -136,7 +136,7 @@ tmm.ARCH = arm7tdmi tmm.TARGET = tmm tmm.TARGETDIR = tmm -tmm.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' +tmm.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' tmm.srcs = $(TL)/tl_test_mm_main.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c tmm.CFLAGS += -DLED -DLED -DTIME_LED=1 @@ -154,7 +154,7 @@ timu.ARCH = arm7tdmi timu.TARGET = timu timu.TARGETDIR = timu -timu.CFLAGS += -DCONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' +timu.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' timu.srcs = $(TL)/tl_test_imu_main.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c timu.CFLAGS += -DLED -DLED -DTIME_LED=1 diff --git a/conf/airframes/twinjet1.xml b/conf/airframes/twinjet1.xml index b1785d6557..79321f5613 100644 --- a/conf/airframes/twinjet1.xml +++ b/conf/airframes/twinjet1.xml @@ -172,7 +172,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/classix.makefile # FLASH_MODE=ISP FLASH_MODE=IAP -fbw.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1 +fbw.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 fbw.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c fbw.srcs += commands.c @@ -193,7 +193,7 @@ fbw.CFLAGS += -DADC -DUSE_AD0 fbw.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DCONFIG=\"classix.h\" -DLED -DTIME_LED=2 +ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=2 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 @@ -237,12 +237,12 @@ ap.CFLAGS += -DUSE_LIGHT -test.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 +test.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"classix.h\" -DAGR_CLIMB -DLOITER_TRIM +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 diff --git a/conf/airframes/twinjet2.xml b/conf/airframes/twinjet2.xml index 553466b314..3297291ba3 100644 --- a/conf/airframes/twinjet2.xml +++ b/conf/airframes/twinjet2.xml @@ -221,7 +221,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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.CFLAGS += -DINTER_MCU @@ -279,7 +279,7 @@ ap.CFLAGS += -DUSE_MODULES # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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/twinstar6.xml b/conf/airframes/twinstar6.xml index 2106e30829..f43d69f5eb 100644 --- a/conf/airframes/twinstar6.xml +++ b/conf/airframes/twinstar6.xml @@ -180,7 +180,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/classix.makefile # FLASH_MODE=ISP FLASH_MODE=IAP -fbw.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1 +fbw.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 fbw.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c fbw.srcs += commands.c @@ -201,7 +201,7 @@ fbw.CFLAGS += -DADC -DUSE_AD0 fbw.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DCONFIG=\"classix.h\" -DLED -DTIME_LED=2 +ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=2 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 @@ -237,12 +237,12 @@ ap.CFLAGS += -DDIGITAL_CAM ap.srcs += dc.c -test.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 +test.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"classix.h\" -DAGR_CLIMB -DLOITER_TRIM +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 diff --git a/conf/airframes/twinstarmm.xml b/conf/airframes/twinstarmm.xml index 809efe1abf..c842ba6f21 100644 --- a/conf/airframes/twinstarmm.xml +++ b/conf/airframes/twinstarmm.xml @@ -190,7 +190,7 @@ FLASH_MODE=IAP include $(PAPARAZZI_SRC)/conf/autopilot/classix.makefile -fbw.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1 +fbw.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 fbw.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c fbw.srcs += commands.c @@ -212,7 +212,7 @@ fbw.srcs += $(SRC_ARCH)/adc_hw.c #fbw.CFLAGS += -DTELEMETRY_MODE_FBW=1 -ap.CFLAGS += -DAP -DCONFIG=\"classix.h\" -DLED -DTIME_LED=2 +ap.CFLAGS += -DAP -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=2 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 -DNAV @@ -242,7 +242,7 @@ ap.CFLAGS += -DUSE_GPIO ap.srcs += $(SRC_ARCH)/gpio.c -test.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 +test.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c diff --git a/conf/airframes/twisted.xml b/conf/airframes/twisted.xml index 087349ec43..804d0cdc4e 100644 --- a/conf/airframes/twisted.xml +++ b/conf/airframes/twisted.xml @@ -46,7 +46,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_coax.c main.c ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT diff --git a/conf/airframes/tyto1.xml b/conf/airframes/tyto1.xml index d288501a95..6538dd211b 100755 --- a/conf/airframes/tyto1.xml +++ b/conf/airframes/tyto1.xml @@ -205,7 +205,7 @@ FLASH_MODE=IAP ap.CFLAGS += -DTELEMETRY_MODE_FBW=1 -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -246,7 +246,7 @@ ap.srcs += nav_survey_rectangle.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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/usb_test.xml b/conf/airframes/usb_test.xml index 58a313bbc6..6d6a636e60 100644 --- a/conf/airframes/usb_test.xml +++ b/conf/airframes/usb_test.xml @@ -173,7 +173,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1 +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 @@ -223,7 +223,7 @@ ap.CFLAGS += -DUSE_JOYSTICK # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +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 diff --git a/conf/airframes/vor.xml b/conf/airframes/vor.xml index dfa7274038..f3f0e047e1 100644 --- a/conf/airframes/vor.xml +++ b/conf/airframes/vor.xml @@ -12,7 +12,7 @@ main.ARCH = arm7tdmi main.TARGET = main main.TARGETDIR = main -main.CFLAGS += -DCONFIG=\"conf_demo.h\" +main.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" main.srcs = $(VOR)/lpc_vor_main.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./29880.)' diff --git a/conf/airframes/wind_tunnel.xml b/conf/airframes/wind_tunnel.xml index 1b3064ea12..27eb480e38 100644 --- a/conf/airframes/wind_tunnel.xml +++ b/conf/airframes/wind_tunnel.xml @@ -14,7 +14,7 @@ ap.ARCH = arm7tdmi ap.TARGET = ap ap.TARGETDIR = ap -ap.CFLAGS += -DCONFIG=\"conf_demo.h\" -I$(WIND_TUNNEL) +ap.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" -I$(WIND_TUNNEL) ap.srcs = $(WIND_TUNNEL)/main.c ap.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-1)' @@ -47,7 +47,7 @@ mb.ARCH = arm7tdmi mb.TARGET = mb mb.TARGETDIR = mb -mb.CFLAGS += -DCONFIG=\"conf_demo.h\" -I$(WIND_TUNNEL) -I$(MB) +mb.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\" -I$(WIND_TUNNEL) -I$(MB) mb.srcs = $(WIND_TUNNEL)/main_mb.c mb.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-2)' diff --git a/conf/airframes/xxx1.xml b/conf/airframes/xxx1.xml index 122a2d6b8e..14acae3af2 100644 --- a/conf/airframes/xxx1.xml +++ b/conf/airframes/xxx1.xml @@ -210,7 +210,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -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 @@ -270,7 +270,7 @@ ap.CFLAGS += -DMOBILE_CAM # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM # -DMOBILE_CAM sim.srcs += nav_line.c nav_survey_rectangle.c # cam_roll.c jeremy_tuning.c @@ -283,7 +283,7 @@ setup_actuators.ARCH = arm7tdmi setup_actuators.TARGET = setup_actuators setup_actuators.TARGETDIR = setup_actuators -setup_actuators.CFLAGS += -DFBW -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c diff --git a/conf/autopilot/booz2_autopilot.makefile b/conf/autopilot/booz2_autopilot.makefile index aa574882f4..f89421bd8c 100644 --- a/conf/autopilot/booz2_autopilot.makefile +++ b/conf/autopilot/booz2_autopilot.makefile @@ -25,10 +25,6 @@ ARCHI=arm7 FLASH_MODE = IAP -BOARD_CFG = \"booz2_board_v1_0.h\" - -SRC_BOOZ=booz -SRC_BOOZ_ARCH=$(SRC_BOOZ)/arm7 ap.ARCHDIR = $(ARCHI) ap.ARCH = arm7tdmi @@ -36,8 +32,8 @@ ap.TARGET = ap ap.TARGETDIR = ap -ap.CFLAGS += -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -ap.CFLAGS += -DCONFIG=$(BOARD_CFG) +ap.CFLAGS += $(BOOZ_INC) +ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_BOOZ)/booz2_main.c ap.CFLAGS += -DPERIPHERALS_AUTO_INIT @@ -95,11 +91,17 @@ ap.srcs += $(SRC_BOOZ)/booz2_battery.c ap.CFLAGS += -DADC0_VIC_SLOT=2 ap.CFLAGS += -DADC1_VIC_SLOT=3 -ap.srcs += $(SRC_BOOZ)/booz2_analog.c $(SRC_BOOZ_ARCH)/booz2_analog_hw.c +ap.srcs += $(SRC_BOOZ)/booz2_analog.c \ + $(SRC_BOOZ_ARCH)/booz2_analog_hw.c + +# +# GPS choice +# +# include booz2_gps.makefile +# or +# nothing +# -ap.srcs += $(SRC_BOOZ)/booz2_gps.c -ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -DUART0_VIC_SLOT=5 -ap.CFLAGS += -DUSE_GPS -DGPS_LINK=Uart0 -DGPS_LED=4 @@ -108,7 +110,7 @@ ap.srcs += $(SRC_BOOZ)/booz2_autopilot.c ap.CFLAGS += -DAHRS_ALIGNER_LED=3 ap.srcs += $(SRC_BOOZ)/booz_ahrs_aligner.c ap.srcs += $(SRC_BOOZ)/booz2_filter_attitude_cmpl_euler.c -ap.srcs += $(SRC_BOOZ)/booz_trig_int.c +ap.srcs += math/pprz_trig_int.c ap.srcs += $(SRC_BOOZ)/booz2_stabilization.c ap.srcs += $(SRC_BOOZ)/booz2_stabilization_rate.c ap.srcs += $(SRC_BOOZ)/booz2_stabilization_attitude.c @@ -116,7 +118,7 @@ ap.srcs += $(SRC_BOOZ)/booz2_stabilization_attitude.c ap.srcs += $(SRC_BOOZ)/booz2_guidance_h.c ap.srcs += $(SRC_BOOZ)/booz2_guidance_v.c ap.srcs += $(SRC_BOOZ)/booz2_ins.c -ap.srcs += pprz_geodetic_int.c pprz_geodetic_float.c +ap.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c ap.srcs += $(SRC_BOOZ)/booz2_hf_float.c # vertical filter float version ap.srcs += $(SRC_BOOZ)/booz2_vf_float.c @@ -125,13 +127,12 @@ ap.CFLAGS += -DUSE_VFF -DDT_VFILTER="(1./512.)" -DFLOAT_T=float ap.srcs += $(SRC_BOOZ)/booz2_navigation.c - -ap.CFLAGS += -DHS_YAW - -ap.srcs += $(SRC_BOOZ)/booz2_fms.c - -#ap.CFLAGS += -DBOOZ2_FMS_TYPE=BOOZ2_FMS_TYPE_DATALINK -#ap.srcs += $(SRC_BOOZ)/booz2_fms_datalink.c - -ap.CFLAGS += -DBOOZ2_FMS_TYPE=BOOZ2_FMS_TYPE_TEST_SIGNAL -ap.srcs += $(SRC_BOOZ)/booz2_fms_test_signal.c +# +# FMS choice +# +# include booz2_fms_test_signal.makefile +# or +# include booz2_fms_datalink.makefile +# or +# nothing +# diff --git a/conf/autopilot/booz2_board_v1_0.h b/conf/autopilot/booz2_board_v1_0.h index 3b35376919..166c46d331 100644 --- a/conf/autopilot/booz2_board_v1_0.h +++ b/conf/autopilot/booz2_board_v1_0.h @@ -53,23 +53,23 @@ -/* Micromag on SSP, IMU connector */ -#define MM_SS_PIN 28 -#define MM_SS_IODIR IO1DIR -#define MM_SS_IOSET IO1SET -#define MM_SS_IOCLR IO1CLR +/* MS2001 on SSP, IMU connector */ +#define MS2001_SS_PIN 28 +#define MS2001_SS_IODIR IO1DIR +#define MS2001_SS_IOSET IO1SET +#define MS2001_SS_IOCLR IO1CLR -#define MM_RESET_PIN 19 -#define MM_RESET_IODIR IO1DIR -#define MM_RESET_IOSET IO1SET -#define MM_RESET_IOCLR IO1CLR +#define MS2001_RESET_PIN 19 +#define MS2001_RESET_IODIR IO1DIR +#define MS2001_RESET_IOSET IO1SET +#define MS2001_RESET_IOCLR IO1CLR -#define MM_DRDY_PIN 30 -#define MM_DRDY_PINSEL PINSEL1 -#define MM_DRDY_PINSEL_BIT 28 -#define MM_DRDY_PINSEL_VAL 2 -#define MM_DRDY_EINT 3 -#define MM_DRDY_VIC_IT VIC_EINT3 +#define MS2001_DRDY_PIN 30 +#define MS2001_DRDY_PINSEL PINSEL1 +#define MS2001_DRDY_PINSEL_BIT 28 +#define MS2001_DRDY_PINSEL_VAL 2 +#define MS2001_DRDY_EINT 3 +#define MS2001_DRDY_VIC_IT VIC_EINT3 /* PWM5 on CAM connector */ /* P0.21 */ diff --git a/conf/autopilot/booz2_fms_datalink.makefile b/conf/autopilot/booz2_fms_datalink.makefile new file mode 100644 index 0000000000..c8025fdf4d --- /dev/null +++ b/conf/autopilot/booz2_fms_datalink.makefile @@ -0,0 +1,4 @@ +ap.CFLAGS += -DUSE_FMS -DBOOZ_FMS_TYPE=BOOZ_FMS_TYPE_DATALINK +ap.srcs += $(SRC_BOOZ)/booz_fms.c +ap.srcs += $(SRC_BOOZ)/impl/booz_fms_datalink.c + diff --git a/conf/autopilot/booz2_fms_test_signal.makefile b/conf/autopilot/booz2_fms_test_signal.makefile new file mode 100644 index 0000000000..d52a3fad38 --- /dev/null +++ b/conf/autopilot/booz2_fms_test_signal.makefile @@ -0,0 +1,3 @@ +ap.CFLAGS += -DUSE_FMS -DBOOZ_FMS_TYPE=BOOZ_FMS_TYPE_TEST_SIGNAL +ap.srcs += $(SRC_BOOZ)/booz_fms.c +ap.srcs += $(SRC_BOOZ)/booz_fms_test_signal.c diff --git a/conf/autopilot/booz2_gps.makefile b/conf/autopilot/booz2_gps.makefile new file mode 100644 index 0000000000..7ba168f5da --- /dev/null +++ b/conf/autopilot/booz2_gps.makefile @@ -0,0 +1,4 @@ + +ap.srcs += $(SRC_BOOZ)/booz2_gps.c +ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -DUART0_VIC_SLOT=5 +ap.CFLAGS += -DUSE_GPS -DGPS_LINK=Uart0 -DGPS_LED=4 diff --git a/conf/autopilot/booz2_imu_b2v1.makefile b/conf/autopilot/booz2_imu_b2v1.makefile index 24ff0d77e9..010a53db59 100644 --- a/conf/autopilot/booz2_imu_b2v1.makefile +++ b/conf/autopilot/booz2_imu_b2v1.makefile @@ -47,28 +47,18 @@ # # imu Booz2 v1 -ap.CFLAGS += -DBOOZ2_IMU_TYPE_H=\"booz2_imu_b2.h\" +ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"impl/booz_imu_b2.h\" ap.CFLAGS += -DSSP_VIC_SLOT=9 -ap.srcs += $(SRC_BOOZ)/booz2_imu_b2.c $(SRC_BOOZ_ARCH)/booz2_imu_b2_hw.c +ap.srcs += $(SRC_BOOZ)/booz_imu.c \ + $(SRC_BOOZ)/impl/booz_imu_b2.c \ + $(SRC_BOOZ_ARCH)/impl/booz_imu_b2_arch.c + ap.CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -ap.srcs += $(SRC_BOOZ)/booz2_max1168.c $(SRC_BOOZ_ARCH)/booz2_max1168_hw.c -ap.CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 -DI2C1_BUF_LEN=16 -#ap.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +ap.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \ + $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c + ap.CFLAGS += -DUSE_AMI601 -ap.srcs += AMI601.c -ap.srcs += $(SRC_BOOZ)/booz2_imu.c +ap.srcs += $(SRC_BOOZ)/peripherals/booz_ami601.c +ap.CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 -DI2C1_BUF_LEN=16 - -sim.CFLAGS += -DBOOZ2_IMU_TYPE_H=\"booz2_imu_b2.h\" -sim.srcs += $(SRC_BOOZ)/booz2_imu.c \ - $(SRC_BOOZ)/booz2_imu_b2.c \ - $(SRC_BOOZ_SIM)/booz2_imu_b2_hw.c \ - $(SRC_BOOZ)/booz2_max1168.c \ - $(SRC_BOOZ_SIM)/booz2_max1168_sim.c - -sim.CFLAGS += -DUSE_I2C1 -# -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 -DI2C1_BUF_LEN=16 -#sim.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c -sim.CFLAGS += -DUSE_AMI601 -sim.srcs += AMI601.c \ No newline at end of file diff --git a/conf/autopilot/booz2_imu_b2v1_1.makefile b/conf/autopilot/booz2_imu_b2v1_1.makefile index d483cb63f1..1949861f25 100644 --- a/conf/autopilot/booz2_imu_b2v1_1.makefile +++ b/conf/autopilot/booz2_imu_b2v1_1.makefile @@ -47,21 +47,17 @@ # # imu Booz2 v1.1 -ap.CFLAGS += -DBOOZ2_IMU_TYPE_H=\"booz2_imu_b2.h\" +ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"impl/booz_imu_b2.h\" +ap.srcs += $(SRC_BOOZ)/booz_imu.c ap.CFLAGS += -DSSP_VIC_SLOT=9 -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -ap.srcs += $(SRC_BOOZ)/booz2_imu_b2.c $(SRC_BOOZ_ARCH)/booz2_imu_b2_hw.c +ap.srcs += $(SRC_BOOZ)/impl/booz_imu_b2.c \ + $(SRC_BOOZ_ARCH)/impl/booz_imu_b2_arch.c + ap.CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -ap.srcs += $(SRC_BOOZ)/booz2_max1168.c $(SRC_BOOZ_ARCH)/booz2_max1168_hw.c +ap.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \ + $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c + ap.CFLAGS += -DUSE_MICROMAG -DMICROMAG_DRDY_VIC_SLOT=11 -ap.srcs += micromag.c $(SRC_ARCH)/micromag_hw.c -ap.srcs += $(SRC_BOOZ)/booz2_imu.c - - - -sim.CFLAGS += -DBOOZ2_IMU_TYPE=\"booz2_imu_b2.h\" -sim.srcs += $(SRC_BOOZ)/booz2_imu.c \ - $(SRC_BOOZ)/booz2_imu_b2.c \ - $(SRC_BOOZ_SIM)/booz2_imu_b2_hw.c \ - $(SRC_BOOZ)/booz2_max1168.c \ - $(SRC_BOOZ_SIM)/booz2_max1168_sim.c +ap.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c \ + $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c diff --git a/conf/autopilot/booz2_imu_crista.makefile b/conf/autopilot/booz2_imu_crista.makefile index d5704d6fd7..ab5cb2df68 100644 --- a/conf/autopilot/booz2_imu_crista.makefile +++ b/conf/autopilot/booz2_imu_crista.makefile @@ -48,19 +48,13 @@ -ap.CFLAGS += -DBOOZ2_IMU_TYPE_H=\"booz2_imu_crista.h\" -ap.srcs += $(SRC_BOOZ)/booz2_imu_crista.c $(SRC_BOOZ_ARCH)/booz2_imu_crista_hw.c +ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"impl/booz_imu_crista.h\" +ap.srcs += $(SRC_BOOZ)/booz_imu.c \ + $(SRC_BOOZ_IMPL)/booz_imu_crista.c \ + $(SRC_BOOZ_ARCH_IMPL)/booz_imu_crista_arch.c ap.CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 -DI2C1_BUF_LEN=16 ap.CFLAGS += -DUSE_AMI601 -ap.srcs += AMI601.c -ap.srcs += $(SRC_BOOZ)/booz2_imu.c +ap.srcs += $(SRC_BOOZ_PERIPH)/booz_ami601.c -sim.CFLAGS += -DBOOZ2_IMU_TYPE_H=\"booz2_imu_crista.h\" -sim.srcs += $(SRC_BOOZ)/booz2_imu.c \ - $(SRC_BOOZ)/booz2_imu_crista.c \ - -sim.CFLAGS += -DUSE_I2C1 -sim.CFLAGS += -DUSE_AMI601 -sim.srcs += AMI601.c \ No newline at end of file diff --git a/conf/autopilot/booz2_radio_control_ppm.makefile b/conf/autopilot/booz2_radio_control_ppm.makefile index 98bb6753ec..d38b606d61 100644 --- a/conf/autopilot/booz2_radio_control_ppm.makefile +++ b/conf/autopilot/booz2_radio_control_ppm.makefile @@ -1,6 +1,7 @@ + ap.CFLAGS += -DUSE_RADIO_CONTROL -DRADIO_CONTROL_LED=1 -ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"booz_radio_control_ppm.h\" +ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"impl/booz_radio_control_ppm.h\" ap.CFLAGS += -DRADIO_CONTROL_TYPE_PPM -ap.srcs += $(SRC_BOOZ)/booz_radio_control.c \ - $(SRC_BOOZ)/booz_radio_control_ppm.c \ - $(SRC_BOOZ_ARCH)/booz_radio_control_ppm_hw.c \ No newline at end of file +ap.srcs += $(SRC_BOOZ)/booz_radio_control.c \ + $(SRC_BOOZ_IMPL)/booz_radio_control_ppm.c \ + $(SRC_BOOZ_ARCH_IMPL)/booz_radio_control_ppm_arch.c \ No newline at end of file diff --git a/conf/autopilot/booz2_simulator.makefile b/conf/autopilot/booz2_simulator.makefile index 9975dca1a5..64961b6943 100644 --- a/conf/autopilot/booz2_simulator.makefile +++ b/conf/autopilot/booz2_simulator.makefile @@ -45,7 +45,7 @@ sim.srcs = $(SIMDIR)/booz2_sim_main.c \ $(SIMDIR)/booz_sensors_model_gps.c \ $(SIMDIR)/booz_wind_model.c \ -sim.CFLAGS += -DCONFIG=\"booz2_board_v1_0.h\" +sim.CFLAGS += -DBOARD_CONFIG=\"booz2_board_v1_0.h\" sim.srcs += $(SRC_BOOZ_SIM)/booz2_unsimulated_peripherals.c sim.srcs += $(SRC_BOOZ)/booz2_main.c diff --git a/conf/autopilot/booz2_simulator_nps.makefile b/conf/autopilot/booz2_simulator_nps.makefile index 525186b1fd..73e8974108 100644 --- a/conf/autopilot/booz2_simulator_nps.makefile +++ b/conf/autopilot/booz2_simulator_nps.makefile @@ -48,7 +48,7 @@ sim.srcs += $(SRC_BOOZ)/booz_trig_int.c \ -sim.CFLAGS += -DCONFIG=\"booz2_board_v1_0.h\" +sim.CFLAGS += -DBOARD_CONFIG=\"booz2_board_v1_0.h\" sim.srcs += $(SRC_BOOZ_SIM)/booz2_unsimulated_peripherals.c sim.srcs += $(SRC_BOOZ)/booz2_main.c @@ -66,8 +66,15 @@ sim.srcs += $(SRC_BOOZ)/booz2_telemetry.c \ sim.srcs += $(SRC_BOOZ)/booz2_commands.c -sim.CFLAGS += -DRADIO_CONTROL -DRC_LED=1 -sim.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c +#sim.CFLAGS += -DRADIO_CONTROL -DRC_LED=1 +#sim.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c + +sim.CFLAGS += -DUSE_RADIO_CONTROL -DRADIO_CONTROL_LED=1 +sim.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"booz_radio_control_ppm.h\" +sim.CFLAGS += -DRADIO_CONTROL_TYPE_PPM +sim.srcs += $(SRC_BOOZ)/booz_radio_control.c \ + $(SRC_BOOZ)/booz_radio_control_ppm.c \ + $(SRC_BOOZ_SIM)/booz_radio_control_ppm_hw.c sim.CFLAGS += -DBOOZ2_ANALOG_BARO_LED=2 -DBOOZ2_ANALOG_BARO_PERIOD='SYS_TICS_OF_SEC((1./100.))' diff --git a/conf/autopilot/booz2_test_progs.makefile b/conf/autopilot/booz2_test_progs.makefile index 56026c1012..0928e9472b 100644 --- a/conf/autopilot/booz2_test_progs.makefile +++ b/conf/autopilot/booz2_test_progs.makefile @@ -22,11 +22,6 @@ # # -BOARD_CFG = \"booz2_board_v1_0.h\" - -SRC_BOOZ=booz -SRC_BOOZ_ARCH=$(SRC_BOOZ)/arm7 -SRC_BOOZ_TEST=$(SRC_BOOZ)/test # # tunnel hw @@ -36,7 +31,7 @@ tunnel.ARCH = arm7tdmi tunnel.TARGET = tunnel tunnel.TARGETDIR = tunnel -tunnel.CFLAGS += -DCONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) +tunnel.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) tunnel.srcs += $(SRC_BOOZ_TEST)/booz2_tunnel.c tunnel.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 tunnel.CFLAGS += -DLED @@ -58,7 +53,7 @@ tunnel_bb.ARCH = arm7tdmi tunnel_bb.TARGET = tunnel_bb tunnel_bb.TARGETDIR = tunnel_bb -tunnel_bb.CFLAGS += -DCONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) +tunnel_bb.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) tunnel_bb.srcs += $(SRC_BOOZ_TEST)/booz2_tunnel_bb.c tunnel_bb.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 tunnel_bb.CFLAGS += -DLED @@ -73,7 +68,7 @@ test_led.ARCH = arm7tdmi test_led.TARGET = test_led test_led.TARGETDIR = test_led -test_led.CFLAGS += -DCONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) +test_led.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) test_led.srcs += $(SRC_BOOZ_TEST)/booz2_test_led.c test_led.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_led.CFLAGS += -DLED @@ -88,7 +83,7 @@ test_gps.ARCH = arm7tdmi test_gps.TARGET = test_gps test_gps.TARGETDIR = test_gps -test_gps.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_gps.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_gps.srcs += $(SRC_BOOZ_TEST)/booz2_test_gps.c test_gps.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_gps.CFLAGS += -DLED @@ -116,7 +111,7 @@ test_modem.ARCH = arm7tdmi test_modem.TARGET = test_modem test_modem.TARGETDIR = test_modem -test_modem.CFLAGS += -DCONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) +test_modem.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) test_modem.srcs += $(SRC_BOOZ_TEST)/booz2_test_modem.c test_modem.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_modem.CFLAGS += -DLED @@ -140,7 +135,7 @@ test_usb.ARCH = arm7tdmi test_usb.TARGET = test_usb test_usb.TARGETDIR = test_usb -test_usb.CFLAGS += -DCONFIG=\"booz2_board_usb.h\" $(BOOZ_CFLAGS) +test_usb.CFLAGS += -DBOARD_CONFIG=\"booz2_board_usb.h\" $(BOOZ_CFLAGS) test_usb.srcs += $(SRC_BOOZ_TEST)/booz2_test_usb.c test_usb.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' # -DTIME_LED=1 @@ -172,7 +167,7 @@ test_ami.ARCH = arm7tdmi test_ami.TARGET = test_ami test_ami.TARGETDIR = test_ami -test_ami.CFLAGS += -DCONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) +test_ami.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) test_ami.srcs += $(SRC_BOOZ_TEST)/booz2_test_ami.c test_ami.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./50.))' -DTIME_LED=1 test_ami.CFLAGS += -DLED @@ -198,7 +193,7 @@ test_crista.ARCH = arm7tdmi test_crista.TARGET = test_crista test_crista.TARGETDIR = test_crista -test_crista.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_crista.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_crista.srcs += $(SRC_BOOZ_TEST)/booz2_test_crista.c test_crista.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_crista.CFLAGS += -DLED @@ -223,7 +218,7 @@ test_max1168.ARCH = arm7tdmi test_max1168.TARGET = test_max1168 test_max1168.TARGETDIR = test_max1168 -test_max1168.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_max1168.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_max1168.srcs += $(SRC_BOOZ_TEST)/booz2_test_max1168.c test_max1168.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_max1168.CFLAGS += -DLED @@ -249,7 +244,7 @@ test_micromag.ARCH = arm7tdmi test_micromag.TARGET = test_micromag test_micromag.TARGETDIR = test_micromag -test_micromag.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_micromag.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_micromag.srcs += $(SRC_BOOZ_TEST)/booz2_test_micromag.c test_micromag.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_micromag.CFLAGS += -DLED @@ -275,7 +270,7 @@ test_micromag2.ARCH = arm7tdmi test_micromag2.TARGET = test_micromag2 test_micromag2.TARGETDIR = test_micromag2 -test_micromag2.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_micromag2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_micromag2.srcs += $(SRC_BOOZ_TEST)/booz2_test_micromag_2.c test_micromag2.CFLAGS += -DSSP_VIC_SLOT=9 test_micromag2.CFLAGS += -DMICROMAG_DRDY_VIC_SLOT=8 @@ -302,7 +297,7 @@ test_imu_b2.ARCH = arm7tdmi test_imu_b2.TARGET = test_imu_b2 test_imu_b2.TARGETDIR = test_imu_b2 -test_imu_b2.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_imu_b2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_imu_b2.srcs += $(SRC_BOOZ_TEST)/booz2_test_imu_b2.c test_imu_b2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_imu_b2.CFLAGS += -DLED @@ -334,7 +329,7 @@ test_rc_spektrum.ARCH = arm7tdmi test_rc_spektrum.TARGET = test_rc_spektrum test_rc_spektrum.TARGETDIR = test_rc_spektrum -test_rc_spektrum.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) $(BOOZ_CFLAGS) +test_rc_spektrum.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) $(BOOZ_CFLAGS) test_rc_spektrum.CFLAGS += -DPERIPHERALS_AUTO_INIT test_rc_spektrum.srcs += $(SRC_BOOZ_TEST)/booz2_test_radio_control.c test_rc_spektrum.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 @@ -369,7 +364,7 @@ test_rc_ppm.ARCH = arm7tdmi test_rc_ppm.TARGET = test_rc_ppm test_rc_ppm.TARGETDIR = test_rc_ppm -test_rc_ppm.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) $(BOOZ_CFLAGS) +test_rc_ppm.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) $(BOOZ_CFLAGS) test_rc_ppm.CFLAGS += -DPERIPHERALS_AUTO_INIT test_rc_ppm.srcs += $(SRC_BOOZ_TEST)/booz2_test_radio_control.c test_rc_ppm.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 @@ -390,8 +385,8 @@ test_rc_ppm.CFLAGS += -DUSE_RADIO_CONTROL -DRADIO_CONTROL_LED=1 test_rc_ppm.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"booz_radio_control_ppm.h\" test_rc_ppm.CFLAGS += -DRADIO_CONTROL_TYPE_PPM test_rc_ppm.srcs += $(SRC_BOOZ)/booz_radio_control.c \ - $(SRC_BOOZ)/booz_radio_control_ppm.c \ - $(SRC_BOOZ_ARCH)/booz_radio_control_ppm_hw.c \ + $(SRC_BOOZ)/$(IMPL)/booz_radio_control_ppm.c \ + $(SRC_BOOZ)/$(IMPL)/$(ARCH)/booz_radio_control_ppm_arch.c \ # @@ -402,7 +397,7 @@ test_mc.ARCH = arm7tdmi test_mc.TARGET = test_mc test_mc.TARGETDIR = test_mc -test_mc.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_mc.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_mc.srcs += $(SRC_BOOZ_TEST)/booz2_test_mc.c test_mc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_mc.CFLAGS += -DLED @@ -428,7 +423,7 @@ test_amc.ARCH = arm7tdmi test_amc.TARGET = test_amc test_amc.TARGETDIR = test_amc -test_amc.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +test_amc.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_amc.srcs += $(SRC_BOOZ_TEST)/booz2_test_amc.c test_amc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 test_amc.CFLAGS += -DLED @@ -458,7 +453,7 @@ test_baro_24.ARCH = arm7tdmi test_baro_24.TARGET = test_baro_24 test_baro_24.TARGETDIR = test_baro_24 -test_baro_24.CFLAGS += -DCONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) $(BOOZ_CFLAGS) +test_baro_24.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) $(BOOZ_CFLAGS) test_baro_24.srcs += $(SRC_BOOZ_TEST)/booz2_test_baro_24.c test_baro_24.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./5.))' -DTIME_LED=1 test_baro_24.CFLAGS += -DLED diff --git a/conf/autopilot/classix.makefile b/conf/autopilot/classix.makefile index 04fcf9c2b7..6e9de09fec 100644 --- a/conf/autopilot/classix.makefile +++ b/conf/autopilot/classix.makefile @@ -27,7 +27,7 @@ test_adcs.ARCH = arm7tdmi test_adcs.TARGET = test_adcs test_adcs.TARGETDIR = test_adcs -test_adcs.CFLAGS += -DAP -DCONFIG=\"classix.h\" -DLED -DTIME_LED=2 -DADC -DUSE_AD1 -DUSE_AD1_2 -DUSE_AD1_3 -DUSE_AD1_4 -DUSE_AD1_5 -DUSE_AD1_6 -DUSE_AD1_7 +test_adcs.CFLAGS += -DAP -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=2 -DADC -DUSE_AD1 -DUSE_AD1_2 -DUSE_AD1_3 -DUSE_AD1_4 -DUSE_AD1_5 -DUSE_AD1_6 -DUSE_AD1_7 test_adcs.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 test_adcs.srcs += downlink.c $(SRC_ARCH)/uart_hw.c @@ -41,5 +41,5 @@ setup_actuators.ARCH = arm7tdmi setup_actuators.TARGET = setup_actuators setup_actuators.TARGETDIR = setup_actuators -setup_actuators.CFLAGS += -DFBW -DCONFIG=\"classix.h\" -DLED -DTIME_LED=2 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DUART0_BAUD=B57600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=2 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DUART0_BAUD=B57600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c diff --git a/conf/autopilot/csc.makefile b/conf/autopilot/csc.makefile index 1191033d93..76791499d7 100644 --- a/conf/autopilot/csc.makefile +++ b/conf/autopilot/csc.makefile @@ -47,7 +47,7 @@ ap.TARGET = main ap.TARGETDIR = main ap.CFLAGS += -I$(SRC_CSC) -ap.CFLAGS += -DCONFIG=$(BOARD_CFG) +ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/csc_main.c ap.CFLAGS += -DLED -DTIME_LED=1 @@ -102,7 +102,7 @@ test_uart.TARGETDIR = test_uart test_uart.CFLAGS += -I$(SRC_CSC) -test_uart.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c test_uart.CFLAGS += -DLED @@ -129,7 +129,7 @@ test_can1.TARGETDIR = test_can1 test_can1.CFLAGS += -I$(SRC_CSC) -test_can1.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_can1.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_can1.srcs += $(SRC_CSC)/test_can1.c test_can1.CFLAGS += -DLED diff --git a/conf/autopilot/csc_ap.makefile b/conf/autopilot/csc_ap.makefile index 4316a69eec..3db63e0bdd 100644 --- a/conf/autopilot/csc_ap.makefile +++ b/conf/autopilot/csc_ap.makefile @@ -47,7 +47,7 @@ ap.TARGET = main ap.TARGETDIR = main ap.CFLAGS += -I$(SRC_CSC) -ap.CFLAGS += -DCONFIG=$(BOARD_CFG) +ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/csc_ap_main.c ap.CFLAGS += -DLED -DTIME_LED=1 @@ -106,7 +106,7 @@ test_uart.TARGETDIR = test_uart test_uart.CFLAGS += -I$(SRC_CSC) -test_uart.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c test_uart.CFLAGS += -DLED diff --git a/conf/autopilot/mercury.makefile b/conf/autopilot/mercury.makefile index e48de623cb..7b6e6967d6 100644 --- a/conf/autopilot/mercury.makefile +++ b/conf/autopilot/mercury.makefile @@ -49,7 +49,7 @@ ap.TARGET = main ap.TARGETDIR = main ap.CFLAGS += -I$(SRC_CSC) -I$(SRC_BOOZ) -I$(SRC_CSC_ARCH) -ap.CFLAGS += -DCONFIG=$(BOARD_CFG) +ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/mercury_main.c ap.CFLAGS += -DLED -DTIME_LED=1 ap.CFLAGS += -DAHRS_ALIGNER_LED=2 @@ -72,8 +72,8 @@ ap.srcs += downlink.c pprz_transport.c $(SRC_CSC)/csc_telemetry.c ap.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart1 ap.srcs += $(SRC_CSC)/csc_datalink.c -ap.CFLAGS += -DBOOZ_TRIG_CONST=const -ap.srcs += $(SRC_CSC)/mercury_xsens.c $(SRC_BOOZ)/booz2_imu.c $(SRC_BOOZ)/booz_trig_int.c +ap.CFLAGS += -DPPRZ_TRIG_CONST=const +ap.srcs += $(SRC_CSC)/mercury_xsens.c $(SRC_BOOZ)/booz_imu.c math/pprz_trig_int.c ap.CFLAGS += -DXSENS1_LINK=Uart0 -DBOOZ2_IMU_TYPE=\"mercury_xsens.h\" ap.srcs += $(SRC_BOOZ)/booz2_filter_attitude_cmpl_euler.c $(SRC_BOOZ)/booz_ahrs_aligner.c @@ -125,7 +125,7 @@ test_uart.TARGETDIR = test_uart test_uart.CFLAGS += -I$(SRC_CSC) -test_uart.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c test_uart.CFLAGS += -DLED diff --git a/conf/autopilot/mercury_csc.makefile b/conf/autopilot/mercury_csc.makefile index 7c6155644c..2cbcd5bae4 100644 --- a/conf/autopilot/mercury_csc.makefile +++ b/conf/autopilot/mercury_csc.makefile @@ -48,7 +48,7 @@ ap.TARGET = main ap.TARGETDIR = main ap.CFLAGS += -I$(SRC_CSC) -I$(SRC_CSC_ARCH) -ap.CFLAGS += -DCONFIG=$(BOARD_CFG) +ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/mercury_csc_main.c ap.CFLAGS += -DLED -DTIME_LED=1 @@ -110,7 +110,7 @@ test_uart.TARGETDIR = test_uart test_uart.CFLAGS += -I$(SRC_CSC) -test_uart.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c test_uart.CFLAGS += -DLED @@ -137,7 +137,7 @@ test_can1.TARGETDIR = test_can1 test_can1.CFLAGS += -I$(SRC_CSC) -test_can1.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_can1.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_can1.srcs += $(SRC_CSC)/test_can1.c test_can1.CFLAGS += -DLED diff --git a/conf/autopilot/stm32_test_progs.makefile b/conf/autopilot/stm32_test_progs.makefile index 442a5bf12e..f88e76f164 100644 --- a/conf/autopilot/stm32_test_progs.makefile +++ b/conf/autopilot/stm32_test_progs.makefile @@ -12,7 +12,7 @@ test_led.ARCHDIR = $(ARCHI) test_led.TARGET = test_led test_led.TARGETDIR = test_led test_led.CFLAGS += -I$(SRC_FYA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT -test_led.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_led.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_led.srcs += $(SRC_FYA)/test_led.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c @@ -26,7 +26,7 @@ test_periodic.ARCHDIR = $(ARCHI) test_periodic.TARGET = test_periodic test_periodic.TARGETDIR = test_periodic test_periodic.CFLAGS += -I$(SRC_FYA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT -test_periodic.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_periodic.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_periodic.srcs += $(SRC_FYA)/test_periodic.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c @@ -43,7 +43,7 @@ test_uart.ARCHDIR = $(ARCHI) test_uart.TARGET = test_uart test_uart.TARGETDIR = test_uart test_uart.CFLAGS = -I$(SRC_FYA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT -test_uart.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs = $(SRC_FYA)/test_uart.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c @@ -63,7 +63,7 @@ test_telemetry1.ARCHDIR = $(ARCHI) test_telemetry1.TARGET = test_telemetry1 test_telemetry1.TARGETDIR = test_telemetry1 test_telemetry1.CFLAGS = -I$(SRC_FYA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT -test_telemetry1.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_telemetry1.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_telemetry1.srcs = $(SRC_FYA)/test_telemetry.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c @@ -84,7 +84,7 @@ test_telemetry2.ARCHDIR = $(ARCHI) test_telemetry2.TARGET = test_telemetry2 test_telemetry2.TARGETDIR = test_telemetry2 test_telemetry2.CFLAGS = -I$(SRC_FYA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT -test_telemetry2.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_telemetry2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_telemetry2.srcs = $(SRC_FYA)/test_telemetry.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c @@ -105,7 +105,7 @@ test_telemetry3.ARCHDIR = $(ARCHI) test_telemetry3.TARGET = test_telemetry3 test_telemetry3.TARGETDIR = test_telemetry3 test_telemetry3.CFLAGS = -I$(SRC_FYA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT -test_telemetry3.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_telemetry3.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_telemetry3.srcs = $(SRC_FYA)/test_telemetry.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c @@ -125,7 +125,7 @@ test_datalink.ARCHDIR = $(ARCHI) test_datalink.TARGET = test_datalink test_datalink.TARGETDIR = test_datalink test_datalink.CFLAGS = -I$(SRC_FYA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT -test_datalink.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_datalink.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_datalink.srcs = $(SRC_FYA)/test_datalink.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c @@ -152,7 +152,7 @@ test_rc_24.ARCHDIR = $(ARCHI) test_rc_24.TARGET = test_rc_24 test_rc_24.TARGETDIR = test_rc_24 test_rc_24.CFLAGS += -I$(SRC_FYA) -I$(ARCHI) -I$(SRC_BOOZ) -DPERIPHERALS_AUTO_INIT -test_rc_24.CFLAGS += -DCONFIG=$(BOARD_CFG) +test_rc_24.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_rc_24.srcs += $(SRC_BOOZ_TEST)/booz2_test_radio_control.c \ $(SRC_FYA)/exceptions.c \ $(SRC_FYA)/vector_table.c diff --git a/conf/autopilot/tiny.makefile b/conf/autopilot/tiny.makefile index db32d4ed9c..145b7a845c 100644 --- a/conf/autopilot/tiny.makefile +++ b/conf/autopilot/tiny.makefile @@ -16,7 +16,7 @@ setup_actuators.ARCH = arm7tdmi setup_actuators.TARGET = setup_actuators setup_actuators.TARGETDIR = setup_actuators -setup_actuators.CFLAGS += -DFBW -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c @@ -26,7 +26,7 @@ tunnel.ARCH = arm7tdmi tunnel.TARGET = tunnel tunnel.TARGETDIR = tunnel -tunnel.CFLAGS += -DFBW -DCONFIG=\"tiny_2_1_1_usb.h\" +tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c @@ -36,7 +36,7 @@ test_adcs.ARCH = arm7tdmi test_adcs.TARGET = test_adcs test_adcs.TARGETDIR = test_adcs -test_adcs.CFLAGS += -DCONFIG=$(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 -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 += -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 @@ -49,7 +49,7 @@ usb_tunnel_0.ARCHDIR = $(ARCHI) usb_tunnel_0.ARCH = arm7tdmi usb_tunnel_0.TARGET = usb_tunnel_0 usb_tunnel_0.TARGETDIR = usb_tunnel_0 -usb_tunnel_0.CFLAGS += -DFBW -DCONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART0 -DUART0_BAUD=B115200 +usb_tunnel_0.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART0 -DUART0_BAUD=B115200 usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c @@ -60,7 +60,7 @@ usb_tunnel_1.ARCHDIR = $(ARCHI) usb_tunnel_1.ARCH = arm7tdmi usb_tunnel_1.TARGET = usb_tunnel_1 usb_tunnel_1.TARGETDIR = usb_tunnel_1 -usb_tunnel_1.CFLAGS += -DFBW -DCONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART1 -DUART1_BAUD=B115200 +usb_tunnel_1.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART1 -DUART1_BAUD=B115200 usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c diff --git a/conf/autopilot/v1_2.makefile b/conf/autopilot/v1_2.makefile index 81839f9db8..a33480eb03 100644 --- a/conf/autopilot/v1_2.makefile +++ b/conf/autopilot/v1_2.makefile @@ -1,3 +1,3 @@ include $(PAPARAZZI_SRC)/conf/autopilot/twin_avr.makefile -LOCAL_CFLAGS += -DCTL_BRD_V1_2 -DCONFIG=\"v1_2.h\" +LOCAL_CFLAGS += -DCTL_BRD_V1_2 -DBOARD_CONFIG=\"v1_2.h\" diff --git a/conf/autopilot/v1_2_1.makefile b/conf/autopilot/v1_2_1.makefile index 8bca9e1d1c..d6a97a3661 100644 --- a/conf/autopilot/v1_2_1.makefile +++ b/conf/autopilot/v1_2_1.makefile @@ -1,3 +1,3 @@ include $(PAPARAZZI_SRC)/conf/autopilot/twin_avr.makefile -LOCAL_CFLAGS += -DCTL_BRD_V1_2_1 -DCONFIG=\"v1_2_1.h\" +LOCAL_CFLAGS += -DCTL_BRD_V1_2_1 -DBOARD_CONFIG=\"v1_2_1.h\" diff --git a/conf/settings/settings_booz2.xml b/conf/settings/settings_booz2.xml index d7b32439df..1c765d6b75 100644 --- a/conf/settings/settings_booz2.xml +++ b/conf/settings/settings_booz2.xml @@ -5,10 +5,6 @@ - - - - diff --git a/conf/settings/settings_booz2_fms_ts.xml b/conf/settings/settings_booz2_fms_ts.xml index 0c7844655a..cd3109b859 100644 --- a/conf/settings/settings_booz2_fms_ts.xml +++ b/conf/settings/settings_booz2_fms_ts.xml @@ -2,7 +2,11 @@ - + + + + + diff --git a/sw/airborne/AMI601.c b/sw/airborne/AMI601.c deleted file mode 100644 index 2ab663351e..0000000000 --- a/sw/airborne/AMI601.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "AMI601.h" - - - -//#include "led.h" - -//#include - - -uint8_t ami601_foo1; -uint8_t ami601_foo2; -uint8_t ami601_foo3; -uint16_t ami601_val[AMI601_NB_CHAN]; - -volatile uint8_t ami601_status; -volatile bool_t ami601_i2c_done; -volatile uint32_t ami601_nb_err; - -/* TRG ( trigger) P0.28 */ -#define AMI601_TRG_PIN 28 -#define AMI601_TRG_IODIR IO0DIR -#define AMI601_TRG_IOSET IO0SET -#define AMI601_TRG_IOCLR IO0CLR - -/* RST ( reset ) P0.29 */ -#define AMI601_RST_PIN 29 -#define AMI601_RST_IODIR IO0DIR -#define AMI601_RST_IOSET IO0SET -#define AMI601_RST_IOCLR IO0CLR - -/* BUSY ( busy ) P0.30 EINT3 */ -#define AMI601_BUSY_PIN -#define AMI601_BUSY_IODIR -#define AMI601_BUSY_IOSET -#define AMI601_BUSY_IOCLR - -void ami601_init( void ) { - /* configure TRG pin as output and assert it*/ - // SetBit(AMI601_TRG_IODIR , AMI601_TRG_PIN); - // SetBit(AMI601_TRG_IOSET , AMI601_TRG_PIN); - - /* configure RST pin as output and set it low*/ - // SetBit(AMI601_RST_IODIR , AMI601_RST_PIN); - // SetBit(AMI601_RST_IOCLR , AMI601_RST_PIN); - - - uint8_t i; - for (i=0; i< AMI601_NB_CHAN; i++) { - ami601_val[i] = 0; - } - ami601_i2c_done = TRUE; - ami601_nb_err = 0; - ami601_status = AMI601_IDLE; - - /* assert reset */ - // SetBit(AMI601_RST_IOSET , AMI601_RST_PIN); - - -} - -void ami601_read( void ) { - if (ami601_status != AMI601_IDLE) { - ami601_nb_err++; - } - else { - ami601_i2c_done = FALSE; - ami601_status = AMI601_SENDING_REQ; - // const uint8_t read_cmd[] = { 0x55, 0xAA, 0X14}; - // memcpy((void*)i2c1_buf, read_cmd, sizeof(read_cmd)); - // i2c1_transmit(AMI601_SLAVE_ADDR, sizeof(read_cmd), &ami601_i2c_done); - i2c1_buf[0] = 0x55; - i2c1_buf[1] = 0xAA; - i2c1_buf[2] = 0x14; - i2c1_transmit(AMI601_SLAVE_ADDR, 3, &ami601_i2c_done); - } -} diff --git a/sw/airborne/adc_generic.c b/sw/airborne/adc_generic.c index 7fee125b55..e2749afcc1 100644 --- a/sw/airborne/adc_generic.c +++ b/sw/airborne/adc_generic.c @@ -1,6 +1,6 @@ #include "adc_generic.h" #include "adc.h" -#include CONFIG +#include BOARD_CONFIG #ifdef USE_ADC_GENERIC uint16_t adc_generic_val1; diff --git a/sw/airborne/agl_vfilter.c b/sw/airborne/agl_vfilter.c index 25d9efd77c..a943c85e64 100644 --- a/sw/airborne/agl_vfilter.c +++ b/sw/airborne/agl_vfilter.c @@ -1,6 +1,6 @@ #include "agl_vfilter.h" -#include CONFIG +#include BOARD_CONFIG #include "airframe.h" #include "std.h" diff --git a/sw/airborne/arm7/ADS8344.c b/sw/airborne/arm7/ADS8344.c index a2f66d8711..cc2129b57d 100644 --- a/sw/airborne/arm7/ADS8344.c +++ b/sw/airborne/arm7/ADS8344.c @@ -25,7 +25,7 @@ #include "ADS8344.h" #include "LPC21xx.h" #include "armVIC.h" -#include CONFIG +#include BOARD_CONFIG #include "led.h" #include "spi_hw.h" diff --git a/sw/airborne/arm7/adc_hw.c b/sw/airborne/arm7/adc_hw.c index 0386a660f3..b44ae2e5a0 100644 --- a/sw/airborne/arm7/adc_hw.c +++ b/sw/airborne/arm7/adc_hw.c @@ -26,7 +26,7 @@ #include "LPC21xx.h" #include "armVIC.h" -#include CONFIG +#include BOARD_CONFIG #ifdef USE_AD0 diff --git a/sw/airborne/arm7/init_hw.h b/sw/airborne/arm7/init_hw.h index 24cdb82579..65af3dcc5e 100644 --- a/sw/airborne/arm7/init_hw.h +++ b/sw/airborne/arm7/init_hw.h @@ -32,7 +32,7 @@ #define INIT_HW_H #include -#include CONFIG +#include BOARD_CONFIG #include "LPC21xx.h" diff --git a/sw/airborne/arm7/led_hw.h b/sw/airborne/arm7/led_hw.h index e7ea75214a..acf69c686a 100644 --- a/sw/airborne/arm7/led_hw.h +++ b/sw/airborne/arm7/led_hw.h @@ -1,7 +1,7 @@ #ifndef LED_HW_H #define LED_HW_H -#include CONFIG +#include BOARD_CONFIG #include "LPC21xx.h" #include "std.h" diff --git a/sw/airborne/arm7/main_test_i2c.c b/sw/airborne/arm7/main_test_i2c.c deleted file mode 100644 index cf4ab2fda6..0000000000 --- a/sw/airborne/arm7/main_test_i2c.c +++ /dev/null @@ -1,149 +0,0 @@ - -#include "std.h" -#include "sys_time.h" -#include "init_hw.h" -#include "interrupt_hw.h" - - -#include "messages.h" -#include "downlink.h" -#include "uart.h" - -static uint8_t mode; - -static inline void main_init( void ); -static inline void main_periodic_task( void ); -static inline void main_event_task( void); -static inline void main_dl_parse_msg( void ); - -int main( void ) { - main_init(); - /* send start_bit */ - I2C0CONSET = 0x60; - while (1) { - if (sys_time_periodic()) - main_periodic_task(); - main_event_task(); - } - return 0; -} - -static inline void main_init( void ) { - hw_init(); - sys_time_init(); - led_init(); - uart0_init_tx(); - int_enable(); -} - -static inline void main_event_task( void ) { - if (PprzBuffer()) { - ReadPprzBuffer(); - if (pprz_msg_received) { - pprz_parse_payload(); - pprz_msg_received = FALSE; - } - } - if (dl_msg_available) { - main_dl_parse_msg(); - dl_msg_available = FALSE; - LED_TOGGLE(2); - } -} - -static inline void main_periodic_task( void ) { - static uint8_t cnt; - cnt++; - if (!(cnt%16)) { - LED_TOGGLE(1); - // DOWNLINK_SEND_MOTOR_BENCH_STATUS(&cpu_time_ticks, &cpu_time_sec, &throttle, &mode); - } -} - -bool_t dl_msg_available; -/** Flag provided to control calls to ::dl_parse_msg. NOT used in this module*/ -#define MSG_SIZE 128 -uint8_t dl_buffer[MSG_SIZE] __attribute__ ((aligned)); - -#include "settings.h" - -#define IdOfMsg(x) (x[1]) - -static inline void main_dl_parse_msg(void) { - uint8_t msg_id = IdOfMsg(dl_buffer); - if (msg_id == DL_SETTING) { - uint8_t i = DL_SETTING_index(dl_buffer); - float var = DL_SETTING_value(dl_buffer); - DlSetting(i, var); - DOWNLINK_SEND_DL_VALUE(&i, &var); - } -} - - -/* SDA0 on P0.3 */ -/* SCL0 on P0.2 */ - -/* A0 A1 A2 are low */ -#define SLAVE_ADDR 0x20 - -void i2c0_ISR(void) __attribute__((naked)); - -static inline void main_i2c_init ( void ) { - /* set P0.2 and P0.3 to I2C0 */ - PINSEL0 |= 1 << 4 | 1 << 6; - /* clear all flags */ - I2C0CONCLR = 0x6C; - /* enable I2C */ - I2C0CONSET = 0x40; - /* set bitrate */ - I2C0SCLL = 200; - I2C0SCLH = 200; - - // I2C0CONSET = ; - // initialize the interrupt vector - VICIntSelect &= ~VIC_BIT(VIC_I2C0); // I2C0 selected as IRQ - VICIntEnable = VIC_BIT(VIC_I2C0); // I2C0 interrupt enabled - VICVectCntl9 = VIC_ENABLE | VIC_I2C0; - VICVectAddr9 = (uint32_t)i2c0_ISR; // address of the ISR - -} - -void i2c0_ISR(void) -{ - // perform proper ISR entry so thumb-interwork works properly - ISR_ENTRY(); - uint32_t state = I2C0STAT; - - switch (state) { - case 8: - /* start condition transmitted */ - /* send slave addr + W */ - I2C0DAT = 0x74; - /* clear SI and start flag */ - I2C0CONCLR = 0x28; - - break; - - case 24: - /* ack received from slave for address */ - /* send data */ - I2C0DAT = 0x55; - /* clear SI */ - I2C0CONCLR = 0x8; - break; - - /* ack received from slave for byte */ - case 40: - /* transmitt stop condition */ - I2C0CONSET = 0x10; - /* clear SI */ - I2C0CONCLR = 0x8; - break; - - default: - break; - } - - VICVectAddr = 0x00000000; // clear this interrupt from the VIC - ISR_EXIT(); // recover registers and return -} diff --git a/sw/airborne/arm7/micromag_hw.h b/sw/airborne/arm7/micromag_hw.h index 1c43886b3d..6112e529bf 100644 --- a/sw/airborne/arm7/micromag_hw.h +++ b/sw/airborne/arm7/micromag_hw.h @@ -8,7 +8,7 @@ #include "interrupt_hw.h" #include "ssp_hw.h" -#include CONFIG +#include BOARD_CONFIG #include "airframe.h" diff --git a/sw/airborne/arm7/modem_hw.h b/sw/airborne/arm7/modem_hw.h index 103204871b..711c5c1556 100644 --- a/sw/airborne/arm7/modem_hw.h +++ b/sw/airborne/arm7/modem_hw.h @@ -2,7 +2,7 @@ #define MODEM_HW_H #include "LPC21xx.h" -#include CONFIG +#include BOARD_CONFIG void TIMER1_ISR ( void ) __attribute__((naked)); diff --git a/sw/airborne/arm7/ppm_hw.h b/sw/airborne/arm7/ppm_hw.h index 903bb43610..cd0898e9af 100644 --- a/sw/airborne/arm7/ppm_hw.h +++ b/sw/airborne/arm7/ppm_hw.h @@ -11,7 +11,7 @@ #include "LPC21xx.h" -#include CONFIG +#include BOARD_CONFIG static inline void ppm_init ( void ) { diff --git a/sw/airborne/arm7/servos_4015_MAT_hw.h b/sw/airborne/arm7/servos_4015_MAT_hw.h index e0ee5e491d..129af96e80 100644 --- a/sw/airborne/arm7/servos_4015_MAT_hw.h +++ b/sw/airborne/arm7/servos_4015_MAT_hw.h @@ -35,7 +35,7 @@ #include "LPC21xx.h" #include "sys_time.h" -#include CONFIG +#include BOARD_CONFIG #define SERVOS_TICS_OF_USEC(s) SYS_TICS_OF_USEC(s) #define ChopServo(x,a,b) Chop(x, a, b) diff --git a/sw/airborne/arm7/servos_4015_hw.h b/sw/airborne/arm7/servos_4015_hw.h index e029b8648a..c463522eca 100644 --- a/sw/airborne/arm7/servos_4015_hw.h +++ b/sw/airborne/arm7/servos_4015_hw.h @@ -7,7 +7,7 @@ #include "LPC21xx.h" #include "sys_time.h" -#include CONFIG +#include BOARD_CONFIG /* PWM prescaler, set PWM input clock to 15MHz, PWM_CLK = PCLK / PWM_PRESCALER */ diff --git a/sw/airborne/arm7/servos_4017_hw.h b/sw/airborne/arm7/servos_4017_hw.h index a92c8e9591..539b96495a 100644 --- a/sw/airborne/arm7/servos_4017_hw.h +++ b/sw/airborne/arm7/servos_4017_hw.h @@ -7,7 +7,7 @@ #include "LPC21xx.h" #include "sys_time.h" -#include CONFIG +#include BOARD_CONFIG #define SERVOS_TICS_OF_USEC(s) SYS_TICS_OF_USEC(s) #define ChopServo(x,a,b) Chop(x, a, b) @@ -42,6 +42,7 @@ extern uint8_t servos_4017_idx; servos_4017_idx++; \ } #else /* SERVOS_4017_CLOCK_FALLING */ + #define SERVOS_4017_RESET_WIDTH SERVOS_TICS_OF_USEC(1000) #define SERVOS_4017_FIRST_PULSE_WIDTH SERVOS_TICS_OF_USEC(100) diff --git a/sw/airborne/arm7/servos_ppm_hw.h b/sw/airborne/arm7/servos_ppm_hw.h index 72369ef418..b93460d933 100644 --- a/sw/airborne/arm7/servos_ppm_hw.h +++ b/sw/airborne/arm7/servos_ppm_hw.h @@ -33,7 +33,7 @@ #include "LPC21xx.h" #include "sys_time.h" -#include CONFIG +#include BOARD_CONFIG #define SERVOS_TICS_OF_USEC(s) SYS_TICS_OF_USEC(s) #define ChopServo(x,a,b) Chop(x, a, b) diff --git a/sw/airborne/arm7/spi_hw.h b/sw/airborne/arm7/spi_hw.h index 5776510e8a..992cb7efad 100644 --- a/sw/airborne/arm7/spi_hw.h +++ b/sw/airborne/arm7/spi_hw.h @@ -30,7 +30,7 @@ #include "std.h" #include "LPC21xx.h" -#include CONFIG +#include BOARD_CONFIG extern volatile uint8_t spi_tx_idx; extern volatile uint8_t spi_rx_idx; diff --git a/sw/airborne/arm7/sys_time_hw.c b/sw/airborne/arm7/sys_time_hw.c index 5554e2307b..0e0f76bce9 100644 --- a/sw/airborne/arm7/sys_time_hw.c +++ b/sw/airborne/arm7/sys_time_hw.c @@ -44,9 +44,9 @@ uint32_t sys_time_chrono; /* T0TC ticks */ #endif #ifdef USE_AMI601 -#include "AMI601.h" +#include "peripherals/booz_ami601.h" #else -#define AMI_601_IT 0x00 +#define AMI601_IT 0x00 #endif @@ -56,7 +56,7 @@ uint32_t sys_time_chrono; /* T0TC ticks */ MB_SCALE_IT |\ MB_TACHO_IT |\ PWM_INPUT_IT |\ - AMI_601_IT) + AMI601_IT) void TIMER0_ISR ( void ) { ISR_ENTRY(); @@ -108,9 +108,9 @@ void TIMER0_ISR ( void ) { } #endif #ifdef USE_AMI601 - if (T0IR&AMI_601_IT) { - AMI_601_ISR(); - T0IR = AMI_601_IT; + if (T0IR&AMI601_IT) { + AMI601_ISR(); + T0IR = AMI601_IT; } #endif } diff --git a/sw/airborne/arm7/sys_time_hw.h b/sw/airborne/arm7/sys_time_hw.h index 2965df0ab2..6086642b6b 100644 --- a/sw/airborne/arm7/sys_time_hw.h +++ b/sw/airborne/arm7/sys_time_hw.h @@ -32,7 +32,7 @@ #include "std.h" #include "LPC21xx.h" -#include CONFIG +#include BOARD_CONFIG #include "led.h" #include "armVIC.h" diff --git a/sw/airborne/arm7/uart_hw.h b/sw/airborne/arm7/uart_hw.h index 6a4cc5c790..0721263af4 100644 --- a/sw/airborne/arm7/uart_hw.h +++ b/sw/airborne/arm7/uart_hw.h @@ -27,7 +27,7 @@ #include "types.h" #include "LPC21xx.h" -#include CONFIG +#include BOARD_CONFIG #define UART0_RX_BUFFER_SIZE 128 // UART0 receive buffer size #define UART0_TX_BUFFER_SIZE 128 // UART0 transmit buffer size diff --git a/sw/airborne/arm7/usb_msc_hw.c b/sw/airborne/arm7/usb_msc_hw.c index 4c54c2ce29..57983bab3b 100755 --- a/sw/airborne/arm7/usb_msc_hw.c +++ b/sw/airborne/arm7/usb_msc_hw.c @@ -62,7 +62,7 @@ #include "std.h" #include "LPC21xx.h" #include "armVIC.h" -#include CONFIG +#include BOARD_CONFIG #include "lpcusb/usbapi.h" #include "msc_bot.h" diff --git a/sw/airborne/arm7/usb_ser_hw.c b/sw/airborne/arm7/usb_ser_hw.c index bf68ce5420..15ea56c292 100644 --- a/sw/airborne/arm7/usb_ser_hw.c +++ b/sw/airborne/arm7/usb_ser_hw.c @@ -52,7 +52,7 @@ #include "LPC21xx.h" #include "armVIC.h" #include "usb_serial.h" -#include CONFIG +#include BOARD_CONFIG #include "lpcusb/usbapi.h" diff --git a/sw/airborne/booz/arch/lpc21/booz_ms2001_arch.c b/sw/airborne/booz/arch/lpc21/booz_ms2001_arch.c deleted file mode 100644 index 84db53f1d9..0000000000 --- a/sw/airborne/booz/arch/lpc21/booz_ms2001_arch.c +++ /dev/null @@ -1,64 +0,0 @@ -/* PNI micromag3 connected on SPI1 */ -/* - Twisted Logic - SS on P0.20 - RESET on P0.29 - DRDY on P0.30 ( EINT3 ) -*/ - -/* - IMU v3 - SS on P0.20 - RESET on P1.21 - DRDY on P0.15 ( EINT2 ) -*/ - -/* - IMU b2 - SS on P1.28 - RESET on P1.19 - DRDY on P0.30 ( EINT3) -*/ - -#include "micromag.h" - -volatile uint8_t micromag_cur_axe; - -static void EXTINT_ISR(void) __attribute__((naked)); - -void micromag_hw_init( void ) { - - MmUnselect(); /* pin idles high */ - /* configure SS pin */ - SetBit(MM_SS_IODIR, MM_SS_PIN); /* pin is output */ - - /* configure RESET pin */ - SetBit(MM_RESET_IODIR, MM_RESET_PIN); /* pin is output */ - MmReset(); /* pin idles low */ - - /* configure DRDY pin */ - /* connected pin to EXINT */ - MM_DRDY_PINSEL |= MM_DRDY_PINSEL_VAL << MM_DRDY_PINSEL_BIT; - SetBit(EXTMODE, MM_DRDY_EINT); /* EINT is edge trigered */ - SetBit(EXTPOLAR,MM_DRDY_EINT); /* EINT is trigered on rising edge */ - SetBit(EXTINT,MM_DRDY_EINT); /* clear pending EINT */ - - /* initialize interrupt vector */ - VICIntSelect &= ~VIC_BIT( MM_DRDY_VIC_IT ); /* select EINT as IRQ source */ - VICIntEnable = VIC_BIT( MM_DRDY_VIC_IT ); /* enable it */ - _VIC_CNTL(MICROMAG_DRDY_VIC_SLOT) = VIC_ENABLE | MM_DRDY_VIC_IT; - _VIC_ADDR(MICROMAG_DRDY_VIC_SLOT) = (uint32_t)EXTINT_ISR; // address of the ISR - -} - -void EXTINT_ISR(void) { - ISR_ENTRY(); - /* no, we won't do anything asynchronously, so just notify */ - micromag_status = MM_GOT_EOC; - /* clear EINT */ - //SetBit(EXTINT,MM_DRDY_EINT); - EXTINT = (1< PI_INTEG_EULER) _a -= TWO_PI_INTEG_EULER; \ while (_a < -PI_INTEG_EULER) _a += TWO_PI_INTEG_EULER; \ @@ -94,16 +94,16 @@ void booz_ahrs_align(void) { #define PSI_OF_MAG(_psi, _mag, _phi_est, _theta_est) { \ \ int32_t sphi; \ - BOOZ_ISIN(sphi, _phi_est); \ + PPRZ_ITRIG_SIN(sphi, _phi_est); \ int32_t cphi; \ - BOOZ_ICOS(cphi, _phi_est); \ + PPRZ_ITRIG_COS(cphi, _phi_est); \ int32_t stheta; \ - BOOZ_ISIN(stheta, _theta_est); \ + PPRZ_ITRIG_SIN(stheta, _theta_est); \ int32_t ctheta; \ - BOOZ_ICOS(ctheta, _theta_est); \ + PPRZ_ITRIG_COS(ctheta, _theta_est); \ \ - int32_t sphi_stheta = BOOZ_IMULT(sphi, stheta, ITRIG_RES ); \ - int32_t cphi_stheta = BOOZ_IMULT(cphi, stheta, ITRIG_RES ); \ + int32_t sphi_stheta = (sphi*stheta)>>INT32_TRIG_FRAC; \ + int32_t cphi_stheta = (cphi*stheta)>>INT32_TRIG_FRAC; \ const int32_t mn = \ ctheta * _mag.x+ \ sphi_stheta * _mag.y+ \ @@ -113,7 +113,7 @@ void booz_ahrs_align(void) { cphi * _mag.y+ \ -sphi * _mag.z; \ float m_psi = -atan2(me, mn); \ - _psi = ((m_psi)*(float)(1<<(IANGLE_RES))*F_UPDATE); \ + _psi = ((m_psi)*(float)(1<<(INT32_ANGLE_FRAC))*F_UPDATE); \ \ } diff --git a/sw/airborne/booz/booz2_filter_attitude_cmpl_euler.h b/sw/airborne/booz/booz2_filter_attitude_cmpl_euler.h index 0cc44538bd..6c4b2f010b 100644 --- a/sw/airborne/booz/booz2_filter_attitude_cmpl_euler.h +++ b/sw/airborne/booz/booz2_filter_attitude_cmpl_euler.h @@ -26,7 +26,7 @@ #include "booz_ahrs.h" #include "std.h" -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_int.h" extern struct Int32Rates booz2_face_gyro_bias; extern struct Int32Eulers booz2_face_measure; diff --git a/sw/airborne/booz/booz2_fms.c b/sw/airborne/booz/booz2_fms.c index 455ddf674c..6d7e39d6ae 100644 --- a/sw/airborne/booz/booz2_fms.c +++ b/sw/airborne/booz/booz2_fms.c @@ -23,7 +23,7 @@ #include "booz2_fms.h" -#include "booz2_imu.h" +#include "booz_imu.h" #include "booz2_gps.h" #include "booz_ahrs.h" diff --git a/sw/airborne/booz/booz2_fms.h b/sw/airborne/booz/booz2_fms.h index 61ce4a0b1d..588aab0046 100644 --- a/sw/airborne/booz/booz2_fms.h +++ b/sw/airborne/booz/booz2_fms.h @@ -25,29 +25,28 @@ #define BOOZ2_FMS_H #include "std.h" -#include "booz_geometry_int.h" +#include "math/pprz_algebra_int.h" #include "booz2_autopilot.h" #include "booz2_guidance_h.h" #include "booz2_guidance_v.h" - struct Booz_fms_imu_info { - struct Pprz_int16_vect3 gyro; - struct Pprz_int16_vect3 accel; - struct Pprz_int16_vect3 mag; + struct Int16Vect3 gyro; + struct Int16Vect3 accel; + struct Int16Vect3 mag; }; struct Booz_fms_gps_info { - struct Pprz_int32_vect3 pos; - struct Pprz_int16_vect3 speed; + struct Int32Vect3 pos; + struct Int16Vect3 speed; int32_t pacc; uint8_t num_sv; uint8_t fix; }; struct Booz_fms_ahrs_info { - struct Pprz_int16_euler euler; - struct Pprz_int16_rate rate; + struct Int16Eulers euler; + struct Int16Eulers rate; }; struct Booz_fms_info { @@ -59,10 +58,10 @@ struct Booz_fms_info { struct Booz_fms_command { union { - struct booz_ivect rate; - struct booz_ieuler attitude; - struct booz_ivect2 speed; - struct booz_ivect pos; //FIXME Warning z is heading + struct Int32Vect3 rate; + struct Int32Eulers attitude; + struct Int32Vect2 speed; + struct Int32Vect3 pos; //FIXME Warning z is heading } h_sp; union { int32_t direct; @@ -97,6 +96,9 @@ extern void booz_fms_update_info(void); #else #error "booz2_fms.h: Unknown BOOZ2_FMS_TYPE" #endif +#else /* no FMS */ +#define booz_fms_init() {} +#define booz_fms_periodic() {} #endif #define BOOZ2_FMS_SET_POS_SP(_pos_sp,_psi_sp) { \ diff --git a/sw/airborne/booz/booz2_gps.h b/sw/airborne/booz/booz2_gps.h index 17f6150d4d..4d9e3de88c 100644 --- a/sw/airborne/booz/booz2_gps.h +++ b/sw/airborne/booz/booz2_gps.h @@ -25,7 +25,7 @@ #define BOOZ2_GPS_H #include "std.h" -#include "pprz_geodetic_int.h" +#include "math/pprz_geodetic_int.h" struct Booz_gps_state { struct EcefCoor_i ecef_pos; /* pos ECEF in cm */ diff --git a/sw/airborne/booz/booz2_guidance_h.c b/sw/airborne/booz/booz2_guidance_h.c index 6be44fe3cb..dc7e4da50f 100644 --- a/sw/airborne/booz/booz2_guidance_h.c +++ b/sw/airborne/booz/booz2_guidance_h.c @@ -31,21 +31,20 @@ #include "booz2_navigation.h" #include "airframe.h" -//#include "radio_control.h" uint8_t booz2_guidance_h_mode; -struct booz_ivect2 booz2_guidance_h_pos_sp; +struct Int32Vect2 booz2_guidance_h_pos_sp; int32_t booz2_guidance_h_psi_sp; -struct booz_ivect2 booz2_guidance_h_pos_err; -struct booz_ivect2 booz2_guidance_h_speed_err; -struct booz_ivect2 booz2_guidance_h_pos_err_sum; +struct Int32Vect2 booz2_guidance_h_pos_err; +struct Int32Vect2 booz2_guidance_h_speed_err; +struct Int32Vect2 booz2_guidance_h_pos_err_sum; -struct booz_ieuler booz2_guidance_h_rc_sp; -struct booz_ivect2 booz2_guidance_h_command_earth; -struct booz_ivect2 booz2_guidance_h_stick_earth_sp; -struct booz_ieuler booz2_guidance_h_command_body; +struct Int32Eulers booz2_guidance_h_rc_sp; +struct Int32Vect2 booz2_guidance_h_command_earth; +struct Int32Vect2 booz2_guidance_h_stick_earth_sp; +struct Int32Eulers booz2_guidance_h_command_body; int32_t booz2_guidance_h_pgain; int32_t booz2_guidance_h_dgain; @@ -62,9 +61,9 @@ void booz2_guidance_h_init(void) { booz2_guidance_h_mode = BOOZ2_GUIDANCE_H_MODE_KILL; booz2_guidance_h_psi_sp = 0; INT_VECT2_ZERO(booz2_guidance_h_pos_sp); - BOOZ_IVECT2_ZERO(booz2_guidance_h_pos_err_sum); - BOOZ_IEULER_ZERO(booz2_guidance_h_rc_sp); - BOOZ_IEULER_ZERO(booz2_guidance_h_command_body); + INT_VECT2_ZERO(booz2_guidance_h_pos_err_sum); + INT_EULERS_ZERO(booz2_guidance_h_rc_sp); + INT_EULERS_ZERO(booz2_guidance_h_command_body); booz2_guidance_h_pgain = BOOZ2_GUIDANCE_H_PGAIN; booz2_guidance_h_igain = BOOZ2_GUIDANCE_H_IGAIN; booz2_guidance_h_dgain = BOOZ2_GUIDANCE_H_DGAIN; @@ -112,13 +111,17 @@ void booz2_guidance_h_read_rc(bool_t in_flight) { case BOOZ2_GUIDANCE_H_MODE_ATTITUDE: booz2_stabilization_attitude_read_rc(in_flight); +#ifdef USE_FMS if (booz_fms_on) BOOZ2_STABILIZATION_ATTITUDE_ADD_SP(booz_fms_input.h_sp.attitude); +#endif break; case BOOZ2_GUIDANCE_H_MODE_HOVER: +#ifdef USE_FMS if (booz_fms_on && booz_fms_input.h_mode >= BOOZ2_GUIDANCE_H_MODE_HOVER) BOOZ2_FMS_SET_POS_SP(booz2_guidance_h_pos_sp,booz_stabilization_att_sp.psi); +#endif BOOZ2_STABILIZATION_ATTITUDE_READ_RC(booz2_guidance_h_rc_sp, in_flight); break; @@ -168,8 +171,8 @@ void booz2_guidance_h_run(bool_t in_flight) { } -#define MAX_POS_ERR BOOZ_POS_I_OF_F(16.) -#define MAX_SPEED_ERR BOOZ_SPEED_I_OF_F(16.) +#define MAX_POS_ERR POS_BFP_OF_REAL(16.) +#define MAX_SPEED_ERR SPEED_BFP_OF_REAL(16.) #define MAX_POS_ERR_SUM ((int32_t)(MAX_POS_ERR)<< 12) // 15 degres @@ -179,19 +182,19 @@ void booz2_guidance_h_run(bool_t in_flight) { static inline void booz2_guidance_h_hover_run(void) { /* compute position error */ - BOOZ_IVECT2_DIFF(booz2_guidance_h_pos_err, booz_ins_ltp_pos, booz2_guidance_h_pos_sp); + VECT2_DIFF(booz2_guidance_h_pos_err, booz_ins_ltp_pos, booz2_guidance_h_pos_sp); /* saturate it */ - BOOZ_IVECT2_STRIM(booz2_guidance_h_pos_err, -MAX_POS_ERR, MAX_POS_ERR); + VECT2_STRIM(booz2_guidance_h_pos_err, -MAX_POS_ERR, MAX_POS_ERR); /* compute speed error */ - BOOZ_IVECT2_COPY(booz2_guidance_h_speed_err, booz_ins_ltp_speed); + VECT2_COPY(booz2_guidance_h_speed_err, booz_ins_ltp_speed); /* saturate it */ - BOOZ_IVECT2_STRIM(booz2_guidance_h_speed_err, -MAX_SPEED_ERR, MAX_SPEED_ERR); + VECT2_STRIM(booz2_guidance_h_speed_err, -MAX_SPEED_ERR, MAX_SPEED_ERR); /* update pos error integral */ - BOOZ_IVECT2_ADD(booz2_guidance_h_pos_err_sum, booz2_guidance_h_pos_err); + VECT2_ADD(booz2_guidance_h_pos_err_sum, booz2_guidance_h_pos_err); /* saturate it */ - BOOZ_IVECT2_STRIM(booz2_guidance_h_pos_err_sum, -MAX_POS_ERR_SUM, MAX_POS_ERR_SUM); + VECT2_STRIM(booz2_guidance_h_pos_err_sum, -MAX_POS_ERR_SUM, MAX_POS_ERR_SUM); /* run PID */ // cmd_earth < 15.17 @@ -202,21 +205,21 @@ static inline void booz2_guidance_h_hover_run(void) { booz2_guidance_h_dgain *( booz2_guidance_h_speed_err.y>>9) + booz2_guidance_h_igain * (booz2_guidance_h_pos_err_sum.y >> 12); - BOOZ_IVECT2_STRIM(booz2_guidance_h_command_earth, -MAX_BANK, MAX_BANK); + VECT2_STRIM(booz2_guidance_h_command_earth, -MAX_BANK, MAX_BANK); /* Rotate to body frame */ int32_t s_psi, c_psi; - BOOZ_ISIN(s_psi, booz_ahrs.ltp_to_body_euler.psi); - BOOZ_ICOS(c_psi, booz_ahrs.ltp_to_body_euler.psi); + PPRZ_ITRIG_SIN(s_psi, booz_ahrs.ltp_to_body_euler.psi); + PPRZ_ITRIG_COS(c_psi, booz_ahrs.ltp_to_body_euler.psi); - // ITRIG_RES - 2: 100mm erreur, gain 100 -> 10000 command | 2 degres = 36000, so multiply by 4 + // INT32_TRIG_FRAC - 2: 100mm erreur, gain 100 -> 10000 command | 2 degres = 36000, so multiply by 4 booz2_guidance_h_command_body.phi = ( - s_psi * booz2_guidance_h_command_earth.x + c_psi * booz2_guidance_h_command_earth.y) - >> (ITRIG_RES - 2); + >> (INT32_TRIG_FRAC - 2); booz2_guidance_h_command_body.theta = - ( c_psi * booz2_guidance_h_command_earth.x + s_psi * booz2_guidance_h_command_earth.y) - >> (ITRIG_RES - 2); + >> (INT32_TRIG_FRAC - 2); booz2_guidance_h_command_body.phi += booz2_guidance_h_rc_sp.phi; @@ -224,32 +227,34 @@ static inline void booz2_guidance_h_hover_run(void) { booz2_guidance_h_command_body.psi = booz2_guidance_h_psi_sp + booz2_guidance_h_rc_sp.psi; ANGLE_REF_NORMALIZE(booz2_guidance_h_command_body.psi); - BOOZ_IEULER_COPY(booz_stabilization_att_sp, booz2_guidance_h_command_body); + EULERS_COPY(booz_stabilization_att_sp, booz2_guidance_h_command_body); } static inline void booz2_guidance_h_hover_enter(void) { - BOOZ_IVECT2_COPY(booz2_guidance_h_pos_sp, booz_ins_ltp_pos); + VECT2_COPY(booz2_guidance_h_pos_sp, booz_ins_ltp_pos); BOOZ2_STABILIZATION_ATTITUDE_RESET_PSI_REF( booz2_guidance_h_rc_sp ); - BOOZ_IVECT2_ZERO(booz2_guidance_h_pos_err_sum); + INT_VECT2_ZERO(booz2_guidance_h_pos_err_sum); +#ifdef USE_FMS BOOZ2_FMS_POS_INIT(booz2_guidance_h_pos_sp,booz2_guidance_h_rc_sp.psi); +#endif } static inline void booz2_guidance_h_nav_enter(void) { INT32_VECT2_NED_OF_ENU(booz2_guidance_h_pos_sp, booz2_navigation_carrot); - struct booz_ieuler tmp_sp; + struct Int32Eulers tmp_sp; BOOZ2_STABILIZATION_ATTITUDE_RESET_PSI_REF( tmp_sp ); booz2_guidance_h_psi_sp = tmp_sp.psi; nav_heading = (booz2_guidance_h_psi_sp >> (ANGLE_REF_RES - INT32_ANGLE_FRAC)); booz2_guidance_h_rc_sp.psi = 0; - BOOZ_IVECT2_ZERO(booz2_guidance_h_pos_err_sum); + INT_VECT2_ZERO(booz2_guidance_h_pos_err_sum); } diff --git a/sw/airborne/booz/booz2_guidance_h.h b/sw/airborne/booz/booz2_guidance_h.h index a6e12c8b65..64dacaf3a4 100644 --- a/sw/airborne/booz/booz2_guidance_h.h +++ b/sw/airborne/booz/booz2_guidance_h.h @@ -25,7 +25,7 @@ #define BOOZ2_GUIDANCE_H_H -#include "booz_geometry_int.h" +#include "math/pprz_algebra_int.h" #define BOOZ2_GUIDANCE_H_MODE_KILL 0 #define BOOZ2_GUIDANCE_H_MODE_RATE 1 @@ -38,16 +38,16 @@ extern uint8_t booz2_guidance_h_mode; /* horizontal setpoint in NED */ /* Q_int32_xx_8 */ -extern struct booz_ivect2 booz2_guidance_h_pos_sp; -extern int32_t booz2_guidance_h_psi_sp; +extern struct Int32Vect2 booz2_guidance_h_pos_sp; +extern int32_t booz2_guidance_h_psi_sp; -extern struct booz_ivect2 booz2_guidance_h_pos_err; -extern struct booz_ivect2 booz2_guidance_h_speed_err; -extern struct booz_ivect2 booz2_guidance_h_pos_err_sum; +extern struct Int32Vect2 booz2_guidance_h_pos_err; +extern struct Int32Vect2 booz2_guidance_h_speed_err; +extern struct Int32Vect2 booz2_guidance_h_pos_err_sum; -extern struct booz_ieuler booz2_guidance_h_rc_sp; -extern struct booz_ivect2 booz2_guidance_h_command_earth; -extern struct booz_ieuler booz2_guidance_h_command_body; +extern struct Int32Eulers booz2_guidance_h_rc_sp; +extern struct Int32Vect2 booz2_guidance_h_command_earth; +extern struct Int32Eulers booz2_guidance_h_command_body; extern int32_t booz2_guidance_h_pgain; extern int32_t booz2_guidance_h_dgain; @@ -62,7 +62,7 @@ extern void booz2_guidance_h_run(bool_t in_flight); #define booz2_guidance_h_SetKi(_val) { \ booz2_guidance_h_igain = _val; \ - BOOZ_IVECT2_ZERO(booz2_guidance_h_pos_err_sum); \ + INT_VECT2_ZERO(booz2_guidance_h_pos_err_sum); \ } #endif /* BOOZ2_GUIDANCE_H_H */ diff --git a/sw/airborne/booz/booz2_guidance_v.c b/sw/airborne/booz/booz2_guidance_v.c index 18b08abd9f..216dd7ab86 100644 --- a/sw/airborne/booz/booz2_guidance_v.c +++ b/sw/airborne/booz/booz2_guidance_v.c @@ -33,7 +33,7 @@ #include "booz2_navigation.h" #include "booz2_ins.h" -#include "booz_geometry_mixed.h" +#include "math/pprz_algebra_int.h" uint8_t booz2_guidance_v_mode; int32_t booz2_guidance_v_ff_cmd; @@ -53,7 +53,7 @@ int32_t booz2_guidance_v_z_sp; /* vertical speed setpoint in meter/s (input) */ /* Q12.19 : accuracy 0.0000019, range +/-4096 */ int32_t booz2_guidance_v_zd_sp; -#define BOOZ2_GUIDANCE_V_ZD_SP_FRAC ISPEED_RES +#define BOOZ2_GUIDANCE_V_ZD_SP_FRAC INT32_SPEED_FRAC /* altitude reference in meter */ /* Q23.8 : accuracy 0.0039, range 8388km */ @@ -168,8 +168,10 @@ void booz2_guidance_v_run(bool_t in_flight) { break; case BOOZ2_GUIDANCE_V_MODE_CLIMB: +#ifdef USE_FMS if (booz_fms_on && booz_fms_input.v_mode == BOOZ2_GUIDANCE_V_MODE_CLIMB) booz2_guidance_v_zd_sp = booz_fms_input.v_sp.climb; +#endif b2_gv_update_ref_from_zd_sp(booz2_guidance_v_zd_sp); run_hover_loop(in_flight); // saturate max authority with RC stick @@ -177,8 +179,10 @@ void booz2_guidance_v_run(bool_t in_flight) { break; case BOOZ2_GUIDANCE_V_MODE_HOVER: +#ifdef USE_FMS if (booz_fms_on && booz_fms_input.v_mode == BOOZ2_GUIDANCE_V_MODE_HOVER) booz2_guidance_v_z_sp = booz_fms_input.v_sp.height; +#endif b2_gv_update_ref_from_z_sp(booz2_guidance_v_z_sp); run_hover_loop(in_flight); // saturate max authority with RC stick @@ -215,10 +219,10 @@ void booz2_guidance_v_run(bool_t in_flight) { static inline void run_hover_loop(bool_t in_flight) { /* convert our reference to generic representation */ - int64_t tmp = b2_gv_z_ref>>(B2_GV_Z_REF_FRAC - IPOS_FRAC); + int64_t tmp = b2_gv_z_ref>>(B2_GV_Z_REF_FRAC - INT32_POS_FRAC); booz2_guidance_v_z_ref = (int32_t)tmp; - booz2_guidance_v_zd_ref = b2_gv_zd_ref<<(ISPEED_RES - B2_GV_ZD_REF_FRAC); - booz2_guidance_v_zdd_ref = b2_gv_zdd_ref<<(IACCEL_RES - B2_GV_ZDD_REF_FRAC); + booz2_guidance_v_zd_ref = b2_gv_zd_ref<<(INT32_SPEED_FRAC - B2_GV_ZD_REF_FRAC); + booz2_guidance_v_zdd_ref = b2_gv_zdd_ref<<(INT32_ACCEL_FRAC - B2_GV_ZDD_REF_FRAC); /* compute the error to our reference */ int32_t err_z = booz_ins_ltp_pos.z - booz2_guidance_v_z_ref; Bound(err_z, BOOZ2_GUIDANCE_V_MIN_ERR_Z, BOOZ2_GUIDANCE_V_MAX_ERR_Z); @@ -236,8 +240,8 @@ static inline void run_hover_loop(bool_t in_flight) { #else const int32_t inv_m = b2_gv_adapt_X>>(B2_GV_ADAPT_X_FRAC - FF_CMD_FRAC); #endif - const int32_t g_m_zdd = (int32_t)BOOZ_INT_OF_FLOAT(9.81, FF_CMD_FRAC) - - (booz2_guidance_v_zdd_ref<<(FF_CMD_FRAC - IACCEL_RES)); + const int32_t g_m_zdd = (int32_t)BFP_OF_REAL(9.81, FF_CMD_FRAC) - + (booz2_guidance_v_zdd_ref<<(FF_CMD_FRAC - INT32_ACCEL_FRAC)); if (g_m_zdd > 0) booz2_guidance_v_ff_cmd = ( g_m_zdd + (inv_m>>1)) / inv_m; else diff --git a/sw/airborne/booz/booz2_guidance_v_adpt.h b/sw/airborne/booz/booz2_guidance_v_adpt.h index 4137c3e60b..055061af57 100644 --- a/sw/airborne/booz/booz2_guidance_v_adpt.h +++ b/sw/airborne/booz/booz2_guidance_v_adpt.h @@ -57,15 +57,15 @@ int32_t b2_gv_adapt_Xmeas; /* Initial State and Covariance */ #define B2_GV_ADAPT_X0_F 0.15 -#define B2_GV_ADAPT_X0 BOOZ_INT_OF_FLOAT(B2_GV_ADAPT_X0_F, B2_GV_ADAPT_X_FRAC) +#define B2_GV_ADAPT_X0 BFP_OF_REAL(B2_GV_ADAPT_X0_F, B2_GV_ADAPT_X_FRAC) #define B2_GV_ADAPT_P0_F 0.5 -#define B2_GV_ADAPT_P0 BOOZ_INT_OF_FLOAT(B2_GV_ADAPT_P0_F, B2_GV_ADAPT_P_FRAC) +#define B2_GV_ADAPT_P0 BFP_OF_REAL(B2_GV_ADAPT_P0_F, B2_GV_ADAPT_P_FRAC) /* System and Measuremement noises */ #define B2_GV_ADAPT_SYS_NOISE_F 0.00005 -#define B2_GV_ADAPT_SYS_NOISE BOOZ_INT_OF_FLOAT(B2_GV_ADAPT_SYS_NOISE_F, B2_GV_ADAPT_P_FRAC) +#define B2_GV_ADAPT_SYS_NOISE BFP_OF_REAL(B2_GV_ADAPT_SYS_NOISE_F, B2_GV_ADAPT_P_FRAC) #define B2_GV_ADAPT_MEAS_NOISE_F 3.0 -#define B2_GV_ADAPT_MEAS_NOISE BOOZ_INT_OF_FLOAT(B2_GV_ADAPT_MEAS_NOISE_F, B2_GV_ADAPT_P_FRAC) +#define B2_GV_ADAPT_MEAS_NOISE BFP_OF_REAL(B2_GV_ADAPT_MEAS_NOISE_F, B2_GV_ADAPT_P_FRAC) static inline void b2_gv_adapt_init(void) { @@ -74,7 +74,7 @@ static inline void b2_gv_adapt_init(void) { } /* - zdd_meas : IACCEL_RES + zdd_meas : INT32_ACCEL_FRAC thrust_applied : controller input [2-200] */ #define K_FRAC 12 @@ -86,7 +86,7 @@ static inline void b2_gv_adapt_run(int32_t zdd_meas, int32_t thrust_applied) { /* We propagate our covariance */ b2_gv_adapt_P = b2_gv_adapt_P + B2_GV_ADAPT_SYS_NOISE; /* Compute our measurement. If zdd_meas is in the range +/-5g, meas is less than 24 bits */ - const int32_t g_m_zdd = ((int32_t)BOOZ_INT_OF_FLOAT(9.81, IACCEL_RES) - zdd_meas)<<(B2_GV_ADAPT_X_FRAC - IACCEL_RES); + const int32_t g_m_zdd = ((int32_t)BFP_OF_REAL(9.81, INT32_ACCEL_FRAC) - zdd_meas)<<(B2_GV_ADAPT_X_FRAC - INT32_ACCEL_FRAC); if ( g_m_zdd > 0) b2_gv_adapt_Xmeas = (g_m_zdd + (thrust_applied>>1)) / thrust_applied; else diff --git a/sw/airborne/booz/booz2_guidance_v_ref.h b/sw/airborne/booz/booz2_guidance_v_ref.h index 749d3f6691..4e1a0498c7 100644 --- a/sw/airborne/booz/booz2_guidance_v_ref.h +++ b/sw/airborne/booz/booz2_guidance_v_ref.h @@ -25,7 +25,8 @@ #define BOOZ2_GUIDANCE_V_REF_H #include "inttypes.h" -#include "booz_geometry_mixed.h" +#include "math/pprz_algebra.h" +#include "math/pprz_algebra_int.h" /* update frequency */ #define B2_GV_FREQ_FRAC 9 @@ -49,26 +50,26 @@ extern int64_t b2_gv_z_ref; /* Saturations definition */ #define B2_GV_MIN_ZDD_F (-2.0*9.81) -#define B2_GV_MIN_ZDD BOOZ_INT_OF_FLOAT(B2_GV_MIN_ZDD_F, B2_GV_ZDD_REF_FRAC) +#define B2_GV_MIN_ZDD BFP_OF_REAL(B2_GV_MIN_ZDD_F, B2_GV_ZDD_REF_FRAC) #define B2_GV_MAX_ZDD_F ( 0.8*9.81) -#define B2_GV_MAX_ZDD BOOZ_INT_OF_FLOAT(B2_GV_MAX_ZDD_F, B2_GV_ZDD_REF_FRAC) +#define B2_GV_MAX_ZDD BFP_OF_REAL(B2_GV_MAX_ZDD_F, B2_GV_ZDD_REF_FRAC) #define B2_GV_MIN_ZD_F (-3.) -#define B2_GV_MIN_ZD BOOZ_INT_OF_FLOAT(B2_GV_MIN_ZD_F , B2_GV_ZD_REF_FRAC) +#define B2_GV_MIN_ZD BFP_OF_REAL(B2_GV_MIN_ZD_F , B2_GV_ZD_REF_FRAC) #define B2_GV_MAX_ZD_F ( 3.) -#define B2_GV_MAX_ZD BOOZ_INT_OF_FLOAT(B2_GV_MAX_ZD_F , B2_GV_ZD_REF_FRAC) +#define B2_GV_MAX_ZD BFP_OF_REAL(B2_GV_MAX_ZD_F , B2_GV_ZD_REF_FRAC) /* second order model natural frequency and damping */ #define B2_GV_OMEGA RadOfDeg(100.) #define B2_GV_ZETA 0.85 #define B2_GV_ZETA_OMEGA_FRAC 10 -#define B2_GV_ZETA_OMEGA BOOZ_INT_OF_FLOAT((B2_GV_ZETA*B2_GV_OMEGA), B2_GV_ZETA_OMEGA_FRAC) +#define B2_GV_ZETA_OMEGA BFP_OF_REAL((B2_GV_ZETA*B2_GV_OMEGA), B2_GV_ZETA_OMEGA_FRAC) #define B2_GV_OMEGA_2_FRAC 7 -#define B2_GV_OMEGA_2 BOOZ_INT_OF_FLOAT((B2_GV_OMEGA*B2_GV_OMEGA), B2_GV_OMEGA_2_FRAC) +#define B2_GV_OMEGA_2 BFP_OF_REAL((B2_GV_OMEGA*B2_GV_OMEGA), B2_GV_OMEGA_2_FRAC) /* first order time constant */ #define B2_GV_REF_THAU_F 0.25 #define B2_GV_REF_INV_THAU_FRAC 16 -#define B2_GV_REF_INV_THAU BOOZ_INT_OF_FLOAT((1./0.25), B2_GV_REF_INV_THAU_FRAC) +#define B2_GV_REF_INV_THAU BFP_OF_REAL((1./0.25), B2_GV_REF_INV_THAU_FRAC) #ifdef B2_GUIDANCE_V_C static inline void b2_gv_set_ref(int32_t alt, int32_t speed, int32_t accel); @@ -80,10 +81,10 @@ int32_t b2_gv_zd_ref; int32_t b2_gv_zdd_ref; static inline void b2_gv_set_ref(int32_t alt, int32_t speed, int32_t accel) { - int64_t new_z = ((int64_t)alt)<<(B2_GV_Z_REF_FRAC - IPOS_FRAC); + int64_t new_z = ((int64_t)alt)<<(B2_GV_Z_REF_FRAC - INT32_POS_FRAC); b2_gv_z_ref = new_z; - b2_gv_zd_ref = speed>>(ISPEED_RES - B2_GV_ZD_REF_FRAC); - b2_gv_zdd_ref = accel>>(IACCEL_RES - B2_GV_ZDD_REF_FRAC); + b2_gv_zd_ref = speed>>(INT32_SPEED_FRAC - B2_GV_ZD_REF_FRAC); + b2_gv_zdd_ref = accel>>(INT32_ACCEL_FRAC - B2_GV_ZDD_REF_FRAC); } static inline void b2_gv_update_ref_from_z_sp(int32_t z_sp) { @@ -95,9 +96,9 @@ static inline void b2_gv_update_ref_from_z_sp(int32_t z_sp) { int32_t zd_zdd_res = b2_gv_zd_ref>>(B2_GV_ZD_REF_FRAC - B2_GV_ZDD_REF_FRAC); int32_t zdd_speed = ((int32_t)(-2*B2_GV_ZETA_OMEGA)*zd_zdd_res)>>(B2_GV_ZETA_OMEGA_FRAC); // compute z error in z_sp resolution - int32_t z_err_sp = z_sp - (int32_t)(b2_gv_z_ref>>(B2_GV_Z_REF_FRAC-IPOS_FRAC)); + int32_t z_err_sp = z_sp - (int32_t)(b2_gv_z_ref>>(B2_GV_Z_REF_FRAC-INT32_POS_FRAC)); // convert to accel resolution - int32_t z_err_accel = z_err_sp>>(IPOS_FRAC-B2_GV_ZDD_REF_FRAC); + int32_t z_err_accel = z_err_sp>>(INT32_POS_FRAC-B2_GV_ZDD_REF_FRAC); int32_t zdd_pos = ((int32_t)(B2_GV_OMEGA_2)*z_err_accel)>>B2_GV_OMEGA_2_FRAC; b2_gv_zdd_ref = zdd_speed + zdd_pos; @@ -123,7 +124,7 @@ static inline void b2_gv_update_ref_from_zd_sp(int32_t zd_sp) { b2_gv_z_ref += b2_gv_zd_ref; b2_gv_zd_ref += b2_gv_zdd_ref; - int32_t zd_err = b2_gv_zd_ref - (zd_sp>>(ISPEED_RES - B2_GV_ZD_REF_FRAC)); + int32_t zd_err = b2_gv_zd_ref - (zd_sp>>(INT32_SPEED_FRAC - B2_GV_ZD_REF_FRAC)); int32_t zd_err_zdd_res = zd_err>>(B2_GV_ZD_REF_FRAC-B2_GV_ZDD_REF_FRAC); b2_gv_zdd_ref = (-(int32_t)B2_GV_REF_INV_THAU * zd_err_zdd_res)>>B2_GV_REF_INV_THAU_FRAC; diff --git a/sw/airborne/booz/booz2_hf_float.c b/sw/airborne/booz/booz2_hf_float.c index 1850e8eddc..9ed678bbd4 100644 --- a/sw/airborne/booz/booz2_hf_float.c +++ b/sw/airborne/booz/booz2_hf_float.c @@ -24,9 +24,9 @@ #include "booz2_hf_float.h" #include "booz2_ins.h" -#include "booz2_imu.h" +#include "booz_imu.h" #include "booz_ahrs.h" -#include "booz_geometry_mixed.h" +#include "math/pprz_algebra_int.h" struct Int32Vect3 b2ins_accel_bias; @@ -69,9 +69,10 @@ void b2ins_propagate(void) { /* unbias accelerometers */ VECT3_DIFF(accel_imu, booz_imu.accel, scaled_biases); /* convert to LTP */ - BOOZ_IQUAT_VDIV(b2ins_accel_ltp, booz_ahrs.ltp_to_imu_quat, accel_imu); + // BOOZ_IQUAT_VDIV(b2ins_accel_ltp, booz_ahrs.ltp_to_imu_quat, accel_imu); + INT32_RMAT_TRANSP_VMULT(b2ins_accel_ltp, booz_ahrs.ltp_to_imu_rmat, accel_imu); /* correct for gravity */ - b2ins_accel_ltp.z += BOOZ_ACCEL_I_OF_F(9.81); + b2ins_accel_ltp.z += ACCEL_BFP_OF_REAL(9.81); /* propagate position */ VECT3_ADD(b2ins_pos_ltp, b2ins_speed_ltp); /* propagate speed */ @@ -90,14 +91,14 @@ void b2ins_update_gps(void) { /* FIXME : with Q_int32_XX_8 we overflow for 256m */ INT32_VECT3_SCALE_2(b2ins_meas_gps_pos_ned, booz_ins_gps_pos_cm_ned, - IPOS_OF_CM_NUM, IPOS_OF_CM_DEN); + INT32_POS_OF_CM_NUM, INT32_POS_OF_CM_DEN); INT32_VECT3_SCALE_2(b2ins_meas_gps_speed_ned, booz_ins_gps_speed_cm_s_ned, - ISPEED_OF_CM_S_NUM, ISPEED_OF_CM_S_DEN); + INT32_SPEED_OF_CM_S_NUM, INT32_SPEED_OF_CM_S_DEN); #ifdef UPDATE_FROM_POS struct Int64Vect2 scaled_pos_meas; VECT2_COPY(scaled_pos_meas, b2ins_meas_gps_pos_ned); - VECT2_SMUL(scaled_pos_meas, (1<<(B2INS_POS_LTP_FRAC-IPOS_FRAC)), scaled_pos_meas); + VECT2_SMUL(scaled_pos_meas, (1<<(B2INS_POS_LTP_FRAC-INT32_POS_FRAC)), scaled_pos_meas); struct Int64Vect3 pos_residual; VECT2_DIFF(pos_residual, scaled_pos_meas, b2ins_pos_ltp); struct Int32Vect2 pos_cor_1; @@ -110,7 +111,7 @@ void b2ins_update_gps(void) { #ifdef UPDATE_FROM_SPEED struct Int32Vect2 scaled_speed_meas; - VECT2_SMUL(scaled_speed_meas, (1<<(B2INS_SPEED_LTP_FRAC-ISPEED_RES)), b2ins_meas_gps_speed_ned); + VECT2_SMUL(scaled_speed_meas, (1<<(B2INS_SPEED_LTP_FRAC-INT32_SPEED_FRAC)), b2ins_meas_gps_speed_ned); struct Int32Vect2 speed_residual; VECT2_DIFF(speed_residual, scaled_speed_meas, b2ins_speed_ltp); struct Int32Vect2 pos_cor_s; diff --git a/sw/airborne/booz/booz2_hf_float.h b/sw/airborne/booz/booz2_hf_float.h index f10c896b22..c3f47b3321 100644 --- a/sw/airborne/booz/booz2_hf_float.h +++ b/sw/airborne/booz/booz2_hf_float.h @@ -24,8 +24,8 @@ #ifndef BOOZ2_HF_FLOAT_H #define BOOZ2_HF_FLOAT_H -#include "pprz_algebra_float.h" -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_float.h" +#include "math/pprz_algebra_int.h" extern struct Int32Vect3 b2ins_accel_bias; #define B2INS_ACCEL_BIAS_FRAC 19 diff --git a/sw/airborne/booz/booz2_imu_b2.h b/sw/airborne/booz/booz2_imu_b2.h deleted file mode 100644 index 0d3f2d799f..0000000000 --- a/sw/airborne/booz/booz2_imu_b2.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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 BOOZ2_IMU_B2_H -#define BOOZ2_IMU_B2_H - -#include "booz2_imu.h" - -#include "booz2_max1168.h" - -#define IMU_B2_MAG_NONE 0 -#define IMU_B2_MAG_MS2001 1 -#define IMU_B2_MAG_AMI601 2 - -#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 -#include "micromag.h" -#define Booz2ImuMagEvent(_mag_handler) { \ - if (micromag_status == MM_DATA_AVAILABLE) { \ - booz_imu.mag_unscaled.x = micromag_values[IMU_MAG_X_CHAN]; \ - booz_imu.mag_unscaled.y = micromag_values[IMU_MAG_Y_CHAN]; \ - booz_imu.mag_unscaled.z = micromag_values[IMU_MAG_Z_CHAN]; \ - micromag_status = MM_IDLE; \ - _mag_handler(); \ - } \ - } -#elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_AMI601 -#include "AMI601.h" -#define Booz2ImuMagEvent(_mag_handler) { \ - if (booz2_ami601_status == STA_AMI601_DATA_AVAILABLE) { \ - booz_imu.mag_unscaled.x = ami601_val[IMU_MAG_X_CHAN]; \ - booz_imu.mag_unscaled.y = ami601_val[IMU_MAG_Y_CHAN]; \ - booz_imu.mag_unscaled.z = ami601_val[IMU_MAG_Z_CHAN]; \ - booz2_ami601_status = STA_AMI601_IDLE; \ - _mag_handler(); \ - } \ - } -#else -#define Booz2ImuMagEvent(_mag_handler) {} -#endif - -extern void booz2_imu_impl_init(void); -extern void booz2_imu_periodic(void); - - -#define Booz2ImuEvent(_gyro_accel_handler, _mag_handler) { \ - if (booz2_max1168_status == STA_MAX1168_DATA_AVAILABLE) { \ - booz_imu.gyro_unscaled.p = booz2_max1168_values[IMU_GYRO_P_CHAN]; \ - booz_imu.gyro_unscaled.q = booz2_max1168_values[IMU_GYRO_Q_CHAN]; \ - booz_imu.gyro_unscaled.r = booz2_max1168_values[IMU_GYRO_R_CHAN]; \ - booz_imu.accel_unscaled.x = booz2_max1168_values[IMU_ACCEL_X_CHAN]; \ - booz_imu.accel_unscaled.y = booz2_max1168_values[IMU_ACCEL_Y_CHAN]; \ - booz_imu.accel_unscaled.z = booz2_max1168_values[IMU_ACCEL_Z_CHAN]; \ - booz2_max1168_status = STA_MAX1168_IDLE; \ - _gyro_accel_handler(); \ - } \ - Booz2ImuMagEvent(_mag_handler); \ - } - - -#include "booz2_imu_b2_hw.h" - -#endif /* BOOZ2_IMU_B2_H */ - diff --git a/sw/airborne/booz/booz2_imu_crista.h b/sw/airborne/booz/booz2_imu_crista.h deleted file mode 100644 index bc344286aa..0000000000 --- a/sw/airborne/booz/booz2_imu_crista.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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 BOOZ2_IMU_CRISTA_H -#define BOOZ2_IMU_CRISTA_H - -#include "booz2_imu.h" -#include "booz2_imu_crista_hw.h" - - -extern void booz2_imu_impl_init(void); -extern void booz2_imu_periodic(void); - -#define ADS8344_NB_CHANNELS 8 -extern uint16_t ADS8344_values[ADS8344_NB_CHANNELS]; -extern bool_t ADS8344_available; - -#define Booz2ImuEvent(_gyro_accel_handler, _mag_handler) { \ - if (ADS8344_available) { \ - ADS8344_available = FALSE; \ - booz_imu.gyro_unscaled.p = ADS8344_values[IMU_GYRO_P_CHAN]; \ - booz_imu.gyro_unscaled.q = ADS8344_values[IMU_GYRO_Q_CHAN]; \ - booz_imu.gyro_unscaled.r = ADS8344_values[IMU_GYRO_R_CHAN]; \ - booz_imu.accel_unscaled.x = ADS8344_values[IMU_ACCEL_X_CHAN]; \ - booz_imu.accel_unscaled.y = ADS8344_values[IMU_ACCEL_Y_CHAN]; \ - booz_imu.accel_unscaled.z = ADS8344_values[IMU_ACCEL_Z_CHAN]; \ - /* spare 3, temp 7 */ \ - _gyro_accel_handler(); \ - } \ - Booz2ImuMagEvent(_mag_handler); \ - } - -#ifdef USE_AMI601 -#include "AMI601.h" -#define foo_handler() {} -#define Booz2ImuMagEvent(_mag_handler) { \ - AMI601Event(foo_handler); \ - if (ami601_status == AMI601_DATA_AVAILABLE) { \ - booz_imu.mag_unscaled.x = ami601_val[IMU_MAG_X_CHAN]; \ - booz_imu.mag_unscaled.y = ami601_val[IMU_MAG_Y_CHAN]; \ - booz_imu.mag_unscaled.z = ami601_val[IMU_MAG_Z_CHAN]; \ - ami601_status = AMI601_IDLE; \ - _mag_handler(); \ - } \ - } -#else -#define Booz2ImuMagEvent(_mag_handler) {} -#endif - -#endif /* BOOZ2_IMU_CRISTA_H */ - diff --git a/sw/airborne/booz/booz2_ins.c b/sw/airborne/booz/booz2_ins.c index 1ef406f14e..a2bb93c4d3 100644 --- a/sw/airborne/booz/booz2_ins.c +++ b/sw/airborne/booz/booz2_ins.c @@ -23,12 +23,12 @@ #include "booz2_ins.h" -#include "booz2_imu.h" +#include "booz_imu.h" #include "booz2_analog_baro.h" #include "booz2_gps.h" #include "airframe.h" -#include "booz_geometry_mixed.h" +#include "math/pprz_algebra_int.h" #ifdef USE_VFF #include "booz2_vf_float.h" @@ -37,7 +37,7 @@ #include "booz_ahrs.h" #include "booz2_hf_float.h" -#include "pprz_geodetic_int.h" +#include "math/pprz_geodetic_int.h" /* gps transformed to LTP-NED */ @@ -82,11 +82,11 @@ void booz_ins_propagate() { #ifdef USE_VFF if (booz2_analog_baro_status == BOOZ2_ANALOG_BARO_RUNNING && booz_ins_baro_initialised) { - float accel_float = BOOZ_ACCEL_F_OF_I(booz_imu.accel.z); + float accel_float = ACCEL_FLOAT_OF_BFP(booz_imu.accel.z); b2_vff_propagate(accel_float); - booz_ins_ltp_accel.z = BOOZ_ACCEL_I_OF_F(b2_vff_zdotdot); - booz_ins_ltp_speed.z = BOOZ_SPEED_I_OF_F(b2_vff_zdot); - booz_ins_ltp_pos.z = BOOZ_POS_I_OF_F(b2_vff_z); + booz_ins_ltp_accel.z = ACCEL_BFP_OF_REAL(b2_vff_zdotdot); + booz_ins_ltp_speed.z = SPEED_BFP_OF_REAL(b2_vff_zdot); + booz_ins_ltp_pos.z = POS_BFP_OF_REAL(b2_vff_z); booz_ins_enu_pos.z = -booz_ins_ltp_pos.z; booz_ins_enu_speed.z = -booz_ins_ltp_speed.z; booz_ins_enu_accel.z = -booz_ins_ltp_accel.z; @@ -108,7 +108,7 @@ void booz_ins_update_baro() { booz_ins_baro_initialised = TRUE; } booz_ins_baro_alt = (((int32_t)booz2_analog_baro_value - booz_ins_qfe) * BOOZ_INS_BARO_SENS_NUM)/BOOZ_INS_BARO_SENS_DEN; - float alt_float = BOOZ_POS_F_OF_I(booz_ins_baro_alt); + float alt_float = POS_FLOAT_OF_BFP(booz_ins_baro_alt); if (booz_ins_vff_realign) { booz_ins_vff_realign = FALSE; booz_ins_qfe = booz2_analog_baro_value; @@ -121,7 +121,7 @@ void booz_ins_update_baro() { void booz_ins_update_gps(void) { - +#ifdef USE_GPS if (booz_gps_state.fix == BOOZ2_GPS_FIX_3D) { if (!booz_ins_ltp_initialised) { ltp_def_from_ecef_i(&booz_ins_ltp_def, &booz_gps_state.ecef_pos); @@ -131,13 +131,13 @@ void booz_ins_update_gps(void) { ned_of_ecef_vect_i(&booz_ins_gps_speed_cm_s_ned, &booz_ins_ltp_def, &booz_gps_state.ecef_speed); #ifdef USE_HFF b2ins_update_gps(); - VECT2_SDIV(booz_ins_ltp_pos, (1<<(B2INS_POS_LTP_FRAC-IPOS_FRAC)), b2ins_pos_ltp); - VECT2_SDIV(booz_ins_ltp_speed, (1<<(B2INS_SPEED_LTP_FRAC-ISPEED_RES)), b2ins_speed_ltp); + VECT2_SDIV(booz_ins_ltp_pos, (1<<(B2INS_POS_LTP_FRAC-INT32_POS_FRAC)), b2ins_pos_ltp); + VECT2_SDIV(booz_ins_ltp_speed, (1<<(B2INS_SPEED_LTP_FRAC-INT32_SPEED_FRAC)), b2ins_speed_ltp); #else INT32_VECT3_SCALE_2(b2ins_meas_gps_pos_ned, booz_ins_gps_pos_cm_ned, - IPOS_OF_CM_NUM, IPOS_OF_CM_DEN); + INT32_POS_OF_CM_NUM, INT32_POS_OF_CM_DEN); INT32_VECT3_SCALE_2(b2ins_meas_gps_speed_ned, booz_ins_gps_speed_cm_s_ned, - ISPEED_OF_CM_S_NUM, ISPEED_OF_CM_S_DEN); + INT32_SPEED_OF_CM_S_NUM, INT32_SPEED_OF_CM_S_DEN); VECT3_COPY(booz_ins_ltp_pos, b2ins_meas_gps_pos_ned); VECT3_COPY(booz_ins_ltp_speed, b2ins_meas_gps_speed_ned); #endif @@ -145,7 +145,7 @@ void booz_ins_update_gps(void) { INT32_VECT3_ENU_OF_NED(booz_ins_enu_speed, booz_ins_ltp_speed); INT32_VECT3_ENU_OF_NED(booz_ins_enu_accel, booz_ins_ltp_accel); } - +#endif /* USE_GPS */ } diff --git a/sw/airborne/booz/booz2_ins.h b/sw/airborne/booz/booz2_ins.h index 87f348d5b1..ad7ca800b5 100644 --- a/sw/airborne/booz/booz2_ins.h +++ b/sw/airborne/booz/booz2_ins.h @@ -25,8 +25,7 @@ #define BOOZ2_INS_H #include "std.h" -#include "booz_geometry_int.h" -#include "pprz_geodetic_int.h" +#include "math/pprz_geodetic_int.h" /* gps transformed to LTP-NED */ extern struct LtpDef_i booz_ins_ltp_def; diff --git a/sw/airborne/booz/booz2_main.c b/sw/airborne/booz/booz2_main.c index c5b4cc2e69..330e9f5b0b 100644 --- a/sw/airborne/booz/booz2_main.c +++ b/sw/airborne/booz/booz2_main.c @@ -28,7 +28,6 @@ #include "led.h" #include "interrupt_hw.h" -#include "messages.h" #include "downlink.h" #include "booz2_telemetry.h" #include "datalink.h" @@ -40,7 +39,7 @@ #include "booz_radio_control.h" -#include "booz2_imu.h" +#include "booz_imu.h" #include "booz2_analog_baro.h" #include "booz2_battery.h" @@ -94,8 +93,7 @@ STATIC_INLINE void booz2_main_init( void ) { booz2_analog_init(); booz2_analog_baro_init(); booz2_battery_init(); - booz2_imu_impl_init(); - booz2_imu_init(); + booz_imu_init(); booz_fms_init(); booz2_autopilot_init(); @@ -121,7 +119,7 @@ STATIC_INLINE void booz2_main_init( void ) { STATIC_INLINE void booz2_main_periodic( void ) { // t0 = T0TC; - booz2_imu_periodic(); + booz_imu_periodic(); /* run control loops */ booz2_autopilot_periodic(); /* set actuators */ @@ -162,7 +160,7 @@ STATIC_INLINE void booz2_main_event( void ) { RadioControlEvent(booz2_autopilot_on_rc_frame); - Booz2ImuEvent(on_gyro_accel_event, on_mag_event); + BoozImuEvent(on_gyro_accel_event, on_mag_event); Booz2AnalogBaroEvent(on_baro_event); @@ -174,8 +172,8 @@ STATIC_INLINE void booz2_main_event( void ) { static inline void on_gyro_accel_event( void ) { - Booz2ImuScaleGyro(); - Booz2ImuScaleAccel(); + BoozImuScaleGyro(); + BoozImuScaleAccel(); if (booz_ahrs.status == BOOZ_AHRS_UNINIT) { booz_ahrs_aligner_run(); @@ -199,5 +197,5 @@ static inline void on_gps_event(void) { } static inline void on_mag_event(void) { - Booz2ImuScaleMag(); + BoozImuScaleMag(); } diff --git a/sw/airborne/booz/booz2_navigation.c b/sw/airborne/booz/booz2_navigation.c index 11ce38e7cd..d51cc418e8 100644 --- a/sw/airborne/booz/booz2_navigation.c +++ b/sw/airborne/booz/booz2_navigation.c @@ -29,7 +29,7 @@ #include "flight_plan.h" -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_int.h" const uint8_t nb_waypoint = NB_WAYPOINT; struct EnuCoor_i waypoints[NB_WAYPOINT] = WAYPOINTS_INT32; diff --git a/sw/airborne/booz/booz2_navigation.h b/sw/airborne/booz/booz2_navigation.h index 8d179de6b3..0e0f3d85d3 100644 --- a/sw/airborne/booz/booz2_navigation.h +++ b/sw/airborne/booz/booz2_navigation.h @@ -25,7 +25,7 @@ #define BOOZ2_NAVIGATION_H #include "std.h" -#include "pprz_geodetic_int.h" +#include "math/pprz_geodetic_int.h" extern struct EnuCoor_i booz2_navigation_target; extern struct EnuCoor_i booz2_navigation_carrot; diff --git a/sw/airborne/booz/booz2_stabilization_attitude.c b/sw/airborne/booz/booz2_stabilization_attitude.c index 7ed3f76bbb..6102041502 100644 --- a/sw/airborne/booz/booz2_stabilization_attitude.c +++ b/sw/airborne/booz/booz2_stabilization_attitude.c @@ -29,50 +29,50 @@ #include "airframe.h" #include "booz_radio_control.h" -struct booz_ieuler booz_stabilization_att_sp; +struct Int32Eulers booz_stabilization_att_sp; -struct booz_ieuler booz_stabilization_att_ref; -struct booz_ivect booz_stabilization_rate_ref; -struct booz_ivect booz_stabilization_accel_ref; +struct Int32Eulers booz_stabilization_att_ref; +struct Int32Vect3 booz_stabilization_rate_ref; +struct Int32Vect3 booz_stabilization_accel_ref; -struct booz_ivect booz_stabilization_pgain; -struct booz_ivect booz_stabilization_dgain; -struct booz_ivect booz_stabilization_ddgain; -struct booz_ivect booz_stabilization_igain; -struct booz_ieuler booz_stabilization_att_sum_err; +struct Int32Vect3 booz_stabilization_pgain; +struct Int32Vect3 booz_stabilization_dgain; +struct Int32Vect3 booz_stabilization_ddgain; +struct Int32Vect3 booz_stabilization_igain; +struct Int32Eulers booz_stabilization_att_sum_err; static inline void booz_stabilization_update_ref(void); void booz2_stabilization_attitude_init(void) { - BOOZ_IEULER_ZERO(booz_stabilization_att_sp); + INT_EULERS_ZERO(booz_stabilization_att_sp); - BOOZ_IEULER_ZERO(booz_stabilization_att_ref); - BOOZ_IVECT_ZERO(booz_stabilization_rate_ref); - BOOZ_IVECT_ZERO(booz_stabilization_accel_ref); + INT_EULERS_ZERO(booz_stabilization_att_ref); + INT_VECT3_ZERO(booz_stabilization_rate_ref); + INT_VECT3_ZERO(booz_stabilization_accel_ref); - BOOZ_IVECT_ASSIGN(booz_stabilization_pgain, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_PGAIN, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_PGAIN, - BOOZ_STABILIZATION_ATTITUDE_PSI_PGAIN); + VECT3_ASSIGN(booz_stabilization_pgain, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_PGAIN, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_PGAIN, + BOOZ_STABILIZATION_ATTITUDE_PSI_PGAIN); - BOOZ_IVECT_ASSIGN(booz_stabilization_dgain, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DGAIN, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DGAIN, - BOOZ_STABILIZATION_ATTITUDE_PSI_DGAIN); + VECT3_ASSIGN(booz_stabilization_dgain, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DGAIN, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DGAIN, + BOOZ_STABILIZATION_ATTITUDE_PSI_DGAIN); + + VECT3_ASSIGN(booz_stabilization_ddgain, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DDGAIN, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DDGAIN, + BOOZ_STABILIZATION_ATTITUDE_PSI_DDGAIN); + + VECT3_ASSIGN(booz_stabilization_igain, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_IGAIN, + BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_IGAIN, + BOOZ_STABILIZATION_ATTITUDE_PSI_IGAIN); - BOOZ_IVECT_ASSIGN(booz_stabilization_ddgain, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DDGAIN, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_DDGAIN, - BOOZ_STABILIZATION_ATTITUDE_PSI_DDGAIN); - - BOOZ_IVECT_ASSIGN(booz_stabilization_igain, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_IGAIN, - BOOZ_STABILIZATION_ATTITUDE_PHI_THETA_IGAIN, - BOOZ_STABILIZATION_ATTITUDE_PSI_IGAIN); - - BOOZ_IEULER_ZERO( booz_stabilization_att_sum_err ); + INT_EULERS_ZERO( booz_stabilization_att_sum_err ); } @@ -87,7 +87,7 @@ void booz2_stabilization_attitude_read_rc(bool_t in_flight) { void booz2_stabilization_attitude_enter(void) { BOOZ2_STABILIZATION_ATTITUDE_RESET_PSI_REF( booz_stabilization_att_sp ); - BOOZ_IEULER_ZERO( booz_stabilization_att_sum_err ); + INT_EULERS_ZERO( booz_stabilization_att_sum_err ); } @@ -99,30 +99,28 @@ void booz2_stabilization_attitude_run(bool_t in_flight) { booz_stabilization_update_ref(); /* compute attitude error */ - const struct booz_ieuler att_ref_scaled = { - booz_stabilization_att_ref.phi >> (ANGLE_REF_RES - IANGLE_RES), - booz_stabilization_att_ref.theta >> (ANGLE_REF_RES - IANGLE_RES), - booz_stabilization_att_ref.psi >> (ANGLE_REF_RES - IANGLE_RES) }; - struct booz_ieuler att_err; - BOOZ_IEULER_DIFF(att_err, booz_ahrs.ltp_to_body_euler, att_ref_scaled); - BOOZ_ANGLE_NORMALIZE(att_err.psi); + const struct Int32Eulers att_ref_scaled = { + booz_stabilization_att_ref.phi >> (ANGLE_REF_RES - INT32_ANGLE_FRAC), + booz_stabilization_att_ref.theta >> (ANGLE_REF_RES - INT32_ANGLE_FRAC), + booz_stabilization_att_ref.psi >> (ANGLE_REF_RES - INT32_ANGLE_FRAC) }; + struct Int32Eulers att_err; + EULERS_DIFF(att_err, booz_ahrs.ltp_to_body_euler, att_ref_scaled); + INT32_ANGLE_NORMALIZE(att_err.psi); if (in_flight) { /* update integrator */ - BOOZ_IEULER_SUM(booz_stabilization_att_sum_err, booz_stabilization_att_sum_err, att_err); - const struct booz_ieuler _MIN_SUM_ERR = {-MAX_SUM_ERR, -MAX_SUM_ERR, -MAX_SUM_ERR}; - const struct booz_ieuler _MAX_SUM_ERR = { MAX_SUM_ERR, MAX_SUM_ERR, MAX_SUM_ERR}; - BOOZ_IEULER_BOUND(booz_stabilization_att_sum_err, booz_stabilization_att_sum_err, _MIN_SUM_ERR, _MAX_SUM_ERR); + EULERS_ADD(booz_stabilization_att_sum_err, att_err); + EULERS_BOUND_CUBE(booz_stabilization_att_sum_err, -MAX_SUM_ERR, MAX_SUM_ERR); } else { - BOOZ_IEULER_ZERO(booz_stabilization_att_sum_err); + INT_EULERS_ZERO(booz_stabilization_att_sum_err); } /* compute rate error */ const struct Int32Rates rate_ref_scaled = { - booz_stabilization_rate_ref.x >> (RATE_REF_RES - IRATE_RES), - booz_stabilization_rate_ref.y >> (RATE_REF_RES - IRATE_RES), - booz_stabilization_rate_ref.z >> (RATE_REF_RES - IRATE_RES) }; + booz_stabilization_rate_ref.x >> (RATE_REF_RES - INT32_RATE_FRAC), + booz_stabilization_rate_ref.y >> (RATE_REF_RES - INT32_RATE_FRAC), + booz_stabilization_rate_ref.z >> (RATE_REF_RES - INT32_RATE_FRAC) }; struct Int32Rates rate_err; RATES_DIFF(rate_err, booz_ahrs.body_rate, rate_ref_scaled); @@ -178,9 +176,9 @@ static inline void booz_stabilization_update_ref(void) { #ifdef USE_REF BOOZ_STABILIZATION_ATTITUDE_REF_TRAJ_EULER_UPDATE(); #else - BOOZ_IEULER_COPY(booz_stabilization_att_ref, booz_stabilization_att_sp); - BOOZ_IVECT_ZERO(booz_stabilization_rate_ref); - BOOZ_IVECT_ZERO(booz_stabilization_accel_ref); + EULERS_COPY(booz_stabilization_att_ref, booz_stabilization_att_sp); + INT_VECT3_ZERO(booz_stabilization_rate_ref); + INT_VECT3_ZERO(booz_stabilization_accel_ref); #endif diff --git a/sw/airborne/booz/booz2_stabilization_attitude.h b/sw/airborne/booz/booz2_stabilization_attitude.h index e4d12ac148..beeb21d43a 100644 --- a/sw/airborne/booz/booz2_stabilization_attitude.h +++ b/sw/airborne/booz/booz2_stabilization_attitude.h @@ -24,7 +24,7 @@ #ifndef BOOZ2_STABILIZATION_ATTITUDE_H #define BOOZ2_STABILIZATION_ATTITUDE_H -#include "booz_geometry_int.h" +#include "math/pprz_algebra_int.h" extern void booz2_stabilization_attitude_init(void); extern void booz2_stabilization_attitude_read_rc(bool_t in_flight); @@ -39,10 +39,10 @@ extern void booz2_stabilization_attitude_run(bool_t in_flight); #include "booz2_stabilization_attitude_ref_traj_euler.h" -extern struct booz_ivect booz_stabilization_igain; -extern struct booz_ivect booz_stabilization_pgain; -extern struct booz_ivect booz_stabilization_dgain; -extern struct booz_ivect booz_stabilization_ddgain; -extern struct booz_ieuler booz_stabilization_att_sum_err; +extern struct Int32Vect3 booz_stabilization_igain; +extern struct Int32Vect3 booz_stabilization_pgain; +extern struct Int32Vect3 booz_stabilization_dgain; +extern struct Int32Vect3 booz_stabilization_ddgain; +extern struct Int32Eulers booz_stabilization_att_sum_err; #endif /* BOOZ2_STABILIZATION_ATTITUDE_H */ diff --git a/sw/airborne/booz/booz2_stabilization_attitude_ref_traj_euler.h b/sw/airborne/booz/booz2_stabilization_attitude_ref_traj_euler.h index 69db078b98..d9b9c19cc2 100644 --- a/sw/airborne/booz/booz2_stabilization_attitude_ref_traj_euler.h +++ b/sw/airborne/booz/booz2_stabilization_attitude_ref_traj_euler.h @@ -24,29 +24,27 @@ #ifndef BOOZ2_STABILIZATION_ATTITUDE_REF_TRAJ_EULER_H #define BOOZ2_STABILIZATION_ATTITUDE_REF_TRAJ_EULER_H -#include "booz_geometry_mixed.h" #include "booz_radio_control.h" -extern struct booz_ieuler booz_stabilization_att_sp; -extern struct booz_ieuler booz_stabilization_att_ref; -extern struct booz_ivect booz_stabilization_rate_ref; -extern struct booz_ivect booz_stabilization_accel_ref; +extern struct Int32Eulers booz_stabilization_att_sp; +extern struct Int32Eulers booz_stabilization_att_ref; +extern struct Int32Vect3 booz_stabilization_rate_ref; +extern struct Int32Vect3 booz_stabilization_accel_ref; #define F_UPDATE_RES 9 #define F_UPDATE (1< PI_ANGLE_REF) _a -= TWO_PI_ANGLE_REF; \ while (_a < -PI_ANGLE_REF) _a += TWO_PI_ANGLE_REF; \ @@ -56,15 +54,15 @@ extern struct booz_ivect booz_stabilization_accel_ref; #define OMEGA_PQ RadOfDeg(800) #define ZETA_PQ 0.85 #define ZETA_OMEGA_PQ_RES 10 -#define ZETA_OMEGA_PQ BOOZ_INT_OF_FLOAT((ZETA_PQ*OMEGA_PQ), ZETA_OMEGA_PQ_RES) +#define ZETA_OMEGA_PQ BFP_OF_REAL((ZETA_PQ*OMEGA_PQ), ZETA_OMEGA_PQ_RES) #define OMEGA_2_PQ_RES 7 -#define OMEGA_2_PQ BOOZ_INT_OF_FLOAT((OMEGA_PQ*OMEGA_PQ), OMEGA_2_PQ_RES) +#define OMEGA_2_PQ BFP_OF_REAL((OMEGA_PQ*OMEGA_PQ), OMEGA_2_PQ_RES) #define OMEGA_R RadOfDeg(500) #define ZETA_R 0.85 #define ZETA_OMEGA_R_RES 10 -#define ZETA_OMEGA_R BOOZ_INT_OF_FLOAT((ZETA_R*OMEGA_R), ZETA_OMEGA_R_RES) +#define ZETA_OMEGA_R BFP_OF_REAL((ZETA_R*OMEGA_R), ZETA_OMEGA_R_RES) #define OMEGA_2_R_RES 7 -#define OMEGA_2_R BOOZ_INT_OF_FLOAT((OMEGA_R*OMEGA_R), OMEGA_2_R_RES) +#define OMEGA_2_R BFP_OF_REAL((OMEGA_R*OMEGA_R), OMEGA_2_R_RES) @@ -72,32 +70,28 @@ extern struct booz_ivect booz_stabilization_accel_ref; #define BOOZ_STABILIZATION_ATTITUDE_REF_TRAJ_EULER_UPDATE() { \ \ /* dumb integrate reference attitude */ \ - const struct booz_ieuler d_angle = { \ + const struct Int32Eulers d_angle = { \ booz_stabilization_rate_ref.x >> ( F_UPDATE_RES + RATE_REF_RES - ANGLE_REF_RES), \ booz_stabilization_rate_ref.y >> ( F_UPDATE_RES + RATE_REF_RES - ANGLE_REF_RES), \ booz_stabilization_rate_ref.z >> ( F_UPDATE_RES + RATE_REF_RES - ANGLE_REF_RES)}; \ - BOOZ_IEULER_SUM(booz_stabilization_att_ref, booz_stabilization_att_ref, d_angle ); \ + EULERS_ADD(booz_stabilization_att_ref, d_angle ); \ ANGLE_REF_NORMALIZE(booz_stabilization_att_ref.psi); \ \ /* integrate reference rotational speeds */ \ - const struct booz_ivect d_rate = { \ + const struct Int32Vect3 d_rate = { \ booz_stabilization_accel_ref.x >> ( F_UPDATE_RES + ACCEL_REF_RES - RATE_REF_RES), \ booz_stabilization_accel_ref.y >> ( F_UPDATE_RES + ACCEL_REF_RES - RATE_REF_RES), \ booz_stabilization_accel_ref.z >> ( F_UPDATE_RES + ACCEL_REF_RES - RATE_REF_RES)}; \ - BOOZ_IVECT_SUM(booz_stabilization_rate_ref, booz_stabilization_rate_ref, d_rate); \ - \ - const struct booz_ivect MIN_RATE = { -RATE_REF_MAX_PQ, -RATE_REF_MAX_PQ, -RATE_REF_MAX_R }; \ - const struct booz_ivect MAX_RATE = { RATE_REF_MAX_PQ, RATE_REF_MAX_PQ, RATE_REF_MAX_R }; \ - BOOZ_IVECT_BOUND(booz_stabilization_rate_ref, booz_stabilization_rate_ref, MIN_RATE, MAX_RATE); \ + VECT3_ADD(booz_stabilization_rate_ref, d_rate); \ \ /* compute reference attitude error */ \ - struct booz_ieuler ref_err; \ - BOOZ_IEULER_DIFF(ref_err, booz_stabilization_att_ref, booz_stabilization_att_sp); \ + struct Int32Eulers ref_err; \ + EULERS_DIFF(ref_err, booz_stabilization_att_ref, booz_stabilization_att_sp); \ /* wrap it in the shortest direction */ \ ANGLE_REF_NORMALIZE(ref_err.psi); \ \ /* compute reference angular accelerations */ \ - const struct booz_ivect accel_rate = { \ + const struct Int32Vect3 accel_rate = { \ ((int32_t)(-2.*ZETA_OMEGA_PQ)* (booz_stabilization_rate_ref.x >> (RATE_REF_RES - ACCEL_REF_RES))) \ >> (ZETA_OMEGA_PQ_RES), \ ((int32_t)(-2.*ZETA_OMEGA_PQ)* (booz_stabilization_rate_ref.y >> (RATE_REF_RES - ACCEL_REF_RES))) \ @@ -105,18 +99,19 @@ extern struct booz_ivect booz_stabilization_accel_ref; ((int32_t)(-2.*ZETA_OMEGA_R) * (booz_stabilization_rate_ref.z >> (RATE_REF_RES - ACCEL_REF_RES))) \ >> (ZETA_OMEGA_R_RES) }; \ \ - const struct booz_ivect accel_angle = { \ + const struct Int32Vect3 accel_angle = { \ ((int32_t)(-OMEGA_2_PQ)* (ref_err.phi >> (ANGLE_REF_RES - ACCEL_REF_RES))) >> (OMEGA_2_PQ_RES), \ ((int32_t)(-OMEGA_2_PQ)* (ref_err.theta >> (ANGLE_REF_RES - ACCEL_REF_RES))) >> (OMEGA_2_PQ_RES), \ ((int32_t)(-OMEGA_2_R )* (ref_err.psi >> (ANGLE_REF_RES - ACCEL_REF_RES))) >> (OMEGA_2_R_RES ) }; \ \ - BOOZ_IVECT_SUM(booz_stabilization_accel_ref, accel_rate, accel_angle); \ + VECT3_SUM(booz_stabilization_accel_ref, accel_rate, accel_angle); \ + \ + /* saturate acceleration */ \ + const struct Int32Vect3 MIN_ACCEL = { -ACCEL_REF_MAX_PQ, -ACCEL_REF_MAX_PQ, -ACCEL_REF_MAX_R }; \ + const struct Int32Vect3 MAX_ACCEL = { ACCEL_REF_MAX_PQ, ACCEL_REF_MAX_PQ, ACCEL_REF_MAX_R }; \ + VECT3_BOUND_BOX(booz_stabilization_accel_ref, MIN_ACCEL, MAX_ACCEL); \ \ - const struct booz_ivect MIN_ACCEL = { -ACCEL_REF_MAX_PQ, -ACCEL_REF_MAX_PQ, -ACCEL_REF_MAX_R }; \ - const struct booz_ivect MAX_ACCEL = { ACCEL_REF_MAX_PQ, ACCEL_REF_MAX_PQ, ACCEL_REF_MAX_R }; \ - BOOZ_IVECT_BOUND(booz_stabilization_accel_ref, booz_stabilization_accel_ref, MIN_ACCEL, MAX_ACCEL); \ - \ - /* trim accel to zero if rate has been saturated */ \ + /* saturate speed and trim accel accordingly */ \ if (booz_stabilization_rate_ref.x >= RATE_REF_MAX_PQ) { \ booz_stabilization_rate_ref.x = RATE_REF_MAX_PQ; \ if (booz_stabilization_accel_ref.x > 0) \ @@ -162,31 +157,31 @@ extern struct booz_ivect booz_stabilization_accel_ref; \ _sp.phi = \ ((int32_t)-radio_control.values[RADIO_CONTROL_ROLL] * BOOZ_STABILIZATION_ATTITUDE_SP_MAX_PHI / MAX_PPRZ) \ - << (ANGLE_REF_RES - IANGLE_RES); \ + << (ANGLE_REF_RES - INT32_ANGLE_FRAC); \ _sp.theta = \ ((int32_t) radio_control.values[RADIO_CONTROL_PITCH] * BOOZ_STABILIZATION_ATTITUDE_SP_MAX_THETA / MAX_PPRZ) \ - << (ANGLE_REF_RES - IANGLE_RES); \ + << (ANGLE_REF_RES - INT32_ANGLE_FRAC); \ if (_inflight) { \ if (YAW_DEADBAND_EXCEEDED()) { \ _sp.psi += \ ((int32_t)-radio_control.values[RADIO_CONTROL_YAW] * BOOZ_STABILIZATION_ATTITUDE_SP_MAX_R / MAX_PPRZ / RC_UPDATE_FREQ) \ - << (ANGLE_REF_RES - IANGLE_RES); \ + << (ANGLE_REF_RES - INT32_ANGLE_FRAC); \ ANGLE_REF_NORMALIZE(_sp.psi); \ } \ } \ else { /* if not flying, use current yaw as setpoint */ \ - _sp.psi = (booz_ahrs.ltp_to_body_euler.psi << (ANGLE_REF_RES - IANGLE_RES)); \ + _sp.psi = (booz_ahrs.ltp_to_body_euler.psi << (ANGLE_REF_RES - INT32_ANGLE_FRAC)); \ } \ } -#define BOOZ2_STABILIZATION_ATTITUDE_ADD_SP(_add_sp) { \ - BOOZ_IEULER_SUM(booz_stabilization_att_sp,booz_stabilization_att_sp,_add_sp); \ +#define BOOZ2_STABILIZATION_ATTITUDE_ADD_SP(_add_sp) { \ + EULERS_ADD(booz_stabilization_att_sp,_add_sp); \ ANGLE_REF_NORMALIZE(booz_stabilization_att_sp.psi); \ } -#define BOOZ2_STABILIZATION_ATTITUDE_RESET_PSI_REF(_sp) { \ - _sp.psi = booz_ahrs.ltp_to_body_euler.psi << (ANGLE_REF_RES - IANGLE_RES); \ +#define BOOZ2_STABILIZATION_ATTITUDE_RESET_PSI_REF(_sp) { \ + _sp.psi = booz_ahrs.ltp_to_body_euler.psi << (ANGLE_REF_RES - INT32_ANGLE_FRAC); \ booz_stabilization_att_ref.psi = _sp.psi; \ booz_stabilization_rate_ref.z = 0; \ } diff --git a/sw/airborne/booz/booz2_stabilization_rate.c b/sw/airborne/booz/booz2_stabilization_rate.c index 4c6acb05f5..5065aa4317 100644 --- a/sw/airborne/booz/booz2_stabilization_rate.c +++ b/sw/airborne/booz/booz2_stabilization_rate.c @@ -26,7 +26,7 @@ #include "booz_ahrs_aligner.h" #include "booz2_stabilization.h" -#include "booz2_imu.h" +#include "booz_imu.h" #include "booz_radio_control.h" #include "airframe.h" diff --git a/sw/airborne/booz/booz2_stabilization_rate.h b/sw/airborne/booz/booz2_stabilization_rate.h index 7ae653e7a2..01b9b27e41 100644 --- a/sw/airborne/booz/booz2_stabilization_rate.h +++ b/sw/airborne/booz/booz2_stabilization_rate.h @@ -24,7 +24,7 @@ #ifndef BOOZ2_STABILIZATION_RATE #define BOOZ2_STABILIZATION_RATE -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_int.h" extern void booz2_stabilization_rate_init(void); extern void booz2_stabilization_rate_read_rc(void); diff --git a/sw/airborne/booz/booz2_telemetry.h b/sw/airborne/booz/booz2_telemetry.h index 16dc95d606..cc4ffc2a72 100644 --- a/sw/airborne/booz/booz2_telemetry.h +++ b/sw/airborne/booz/booz2_telemetry.h @@ -40,9 +40,11 @@ #define PERIODIC_SEND_ALIVE() DOWNLINK_SEND_ALIVE(16, MD5SUM) #include "booz2_battery.h" -#include "booz2_imu.h" +#include "booz_imu.h" #include "booz2_gps.h" #include "booz2_ins.h" + +#ifdef USE_GPS #define PERIODIC_SEND_BOOZ_STATUS() { \ uint32_t booz_imu_nb_err = 0; \ DOWNLINK_SEND_BOOZ_STATUS(&booz_imu_nb_err, \ @@ -58,6 +60,24 @@ &cpu_time_sec \ ); \ } +#else /* !USE_GPS */ +#define PERIODIC_SEND_BOOZ_STATUS() { \ + uint32_t booz_imu_nb_err = 0; \ + uint8_t fix = BOOZ2_GPS_FIX_NONE; \ + DOWNLINK_SEND_BOOZ_STATUS(&booz_imu_nb_err, \ + &twi_blmc_nb_err, \ + &radio_control.status, \ + &fix, \ + &booz2_autopilot_mode, \ + &booz2_autopilot_in_flight, \ + &booz2_autopilot_motors_on, \ + &booz2_guidance_h_mode, \ + &booz2_guidance_v_mode, \ + &booz2_battery_voltage, \ + &cpu_time_sec \ + ); \ + } +#endif /* USE_GPS */ #ifdef USE_RADIO_CONTROL #define PERIODIC_SEND_RC() DOWNLINK_SEND_RC(RADIO_CONTROL_NB_CHANNEL, radio_control.values) @@ -117,7 +137,6 @@ &booz2_analog_baro_value_filtered); \ } -#include "booz2_imu.h" #include "booz2_stabilization.h" #include "booz2_stabilization_rate.h" #define PERIODIC_SEND_BOOZ2_RATE_LOOP() { \ @@ -319,6 +338,7 @@ ); \ } +#ifdef USE_GPS #define PERIODIC_SEND_BOOZ2_INS3() { \ DOWNLINK_SEND_BOOZ2_INS3(&b2ins_meas_gps_pos_ned.x, \ &b2ins_meas_gps_pos_ned.y, \ @@ -328,7 +348,9 @@ &b2ins_meas_gps_speed_ned.z \ ); \ } - +#else /* !USE_GPS */ +#define PERIODIC_SEND_BOOZ2_INS3() {} +#endif /* USE_GPS */ #define PERIODIC_SEND_BOOZ2_INS_REF() { \ DOWNLINK_SEND_BOOZ2_INS_REF(&booz_ins_ltp_def.ecef.x, \ @@ -402,7 +424,7 @@ &booz2_stabilization_cmd[COMMAND_THRUST]); \ } - +#ifdef USE_GPS #define PERIODIC_SEND_BOOZ2_GPS() { \ DOWNLINK_SEND_BOOZ2_GPS( &booz_gps_state.ecef_pos.x, \ &booz_gps_state.ecef_pos.y, \ @@ -416,7 +438,9 @@ &booz_gps_state.num_sv, \ &booz_gps_state.fix); \ } - +#else +#define PERIODIC_SEND_BOOZ2_GPS() {} +#endif #include "booz2_navigation.h" #define PERIODIC_SEND_BOOZ2_NAV_REF() { \ diff --git a/sw/airborne/booz/booz_ahrs.h b/sw/airborne/booz/booz_ahrs.h index 7bfe959837..cca8ee9187 100644 --- a/sw/airborne/booz/booz_ahrs.h +++ b/sw/airborne/booz/booz_ahrs.h @@ -25,7 +25,7 @@ #define BOOZ_AHRS_H #include "std.h" -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_int.h" #define BOOZ_AHRS_UNINIT 0 #define BOOZ_AHRS_RUNNING 1 diff --git a/sw/airborne/booz/booz_ahrs_aligner.c b/sw/airborne/booz/booz_ahrs_aligner.c index 256a980c4b..a5ef4d5f51 100644 --- a/sw/airborne/booz/booz_ahrs_aligner.c +++ b/sw/airborne/booz/booz_ahrs_aligner.c @@ -23,7 +23,8 @@ #include "booz_ahrs_aligner.h" -#include "booz2_imu.h" +#include /* for abs() */ +#include "booz_imu.h" #include "led.h" struct BoozAhrsAligner booz_ahrs_aligner; diff --git a/sw/airborne/booz/booz_ahrs_aligner.h b/sw/airborne/booz/booz_ahrs_aligner.h index 81f55c4c59..a2b7c96fbd 100644 --- a/sw/airborne/booz/booz_ahrs_aligner.h +++ b/sw/airborne/booz/booz_ahrs_aligner.h @@ -25,7 +25,7 @@ #define BOOZ_AHRS_ALIGNER_H #include "std.h" -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_int.h" #define BOOZ_AHRS_ALIGNER_UNINIT 0 #define BOOZ_AHRS_ALIGNER_RUNNING 1 diff --git a/sw/airborne/booz/booz_ahrs_float_ekf.c b/sw/airborne/booz/booz_ahrs_float_ekf.c index 3704409a6d..2496a9bd43 100644 --- a/sw/airborne/booz/booz_ahrs_float_ekf.c +++ b/sw/airborne/booz/booz_ahrs_float_ekf.c @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#include "pprz_algebra_float.h" +#include "math/pprz_algebra_float.h" /* our estimated attitude */ struct FloatQuat bafe_quat; diff --git a/sw/airborne/booz/booz_ahrs_float_ekf.h b/sw/airborne/booz/booz_ahrs_float_ekf.h index 938189f3d3..b9dbd73df7 100644 --- a/sw/airborne/booz/booz_ahrs_float_ekf.h +++ b/sw/airborne/booz/booz_ahrs_float_ekf.h @@ -25,8 +25,6 @@ #define BOOZ_AHRS_FLOAT_EKF_H -#include "pprz_algebra_float.h" - extern void booz_ahrs_init(void); extern void booz_ahrs_align(void); diff --git a/sw/airborne/booz/booz_geometry_int.h b/sw/airborne/booz/booz_geometry_int.h deleted file mode 100644 index 0e78eae69f..0000000000 --- a/sw/airborne/booz/booz_geometry_int.h +++ /dev/null @@ -1,639 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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 BOOZ_GEOMETRY_INT_H -#define BOOZ_GEOMETRY_INT_H - -#include - - -#define IPOS_OF_CM 2.56 -#define IPOS_OF_CM_NUM 64 -#define IPOS_OF_CM_DEN 25 -#define ISPEED_OF_CM_S 5242.88 -#define ISPEED_OF_CM_S_NUM 41943 -#define ISPEED_OF_CM_S_DEN 8 - - -#define IQUAT_RES 15 -#define IPOS_FRAC 8 -/* max 8 rad/s for 16bits */ -#define IRATE_RES 12 -#define IANGLE_RES 12 -#define IACCEL_RES 10 -#define ISPEED_RES 19 -#define IMAG_RES 11 -#define ITRIG_RES 14 - -#define PI_2_INT (int32_t)( 1.5707963267948966192313216916397514*(1< PI_INT) _a -= TWO_PI_INT; \ - while (_a < -PI_INT) _a += TWO_PI_INT; \ - } - -#define BOOZ_IMULT(_a, _b, _r) (((_a)*(_b))>>(_r)) - -struct booz_iquat { - int32_t qi; - int32_t qx; - int32_t qy; - int32_t qz; -}; - -struct booz_ivect2 { - int32_t x; - int32_t y; -}; - -struct booz_ivect { - int32_t x; - int32_t y; - int32_t z; -}; - -struct booz_ieuler { - int32_t phi; - int32_t theta; - int32_t psi; -}; - - -struct Pprz_int16_vect2 { - int16_t x; - int16_t y; -}; - -struct Pprz_int16_vect3 { - int16_t x; - int16_t y; - int16_t z; -}; - -struct Pprz_int16_rate { - int16_t p; - int16_t q; - int16_t r; -}; - -struct Pprz_int16_euler { - int16_t phi; - int16_t theta; - int16_t psi; -}; - -struct Pprz_int16_quat { - int16_t qi; - int16_t qx; - int16_t qy; - int16_t qz; -}; - -struct Pprz_int32_vect2 { - int32_t x; - int32_t y; -}; - -struct Pprz_int32_vect3 { - int32_t x; - int32_t y; - int32_t z; -}; - -struct Pprz_int32_rate { - int32_t p; - int32_t q; - int32_t r; -}; - -struct Pprz_int32_euler { - int32_t phi; - int32_t theta; - int32_t psi; -}; - -struct Pprz_int32_lla { - int32_t lat; - int32_t lon; - int32_t alt; -}; - -struct Pprz_int32_quat { - int32_t qi; - int32_t qx; - int32_t qy; - int32_t qz; -}; - - -#define PPRZ_INT16_OF_INT32_VECT2(_o, _i) { \ - _o.x = (int16_t)_i.x; \ - _o.y = (int16_t)_i.y; \ - } - -#define PPRZ_INT16_OF_INT32_VECT3(_o, _i) { \ - _o.x = (int16_t)_i.x; \ - _o.y = (int16_t)_i.y; \ - _o.z = (int16_t)_i.z; \ - } - -#define PPRZ_INT16_OF_INT32_RATE(_o, _i) { \ - _o.p = (int16_t)_i.p; \ - _o.q = (int16_t)_i.q; \ - _o.r = (int16_t)_i.r; \ - } - -#define PPRZ_INT16_OF_INT32_EULER(_o, _i) { \ - _o.phi = (int16_t)_i.phi; \ - _o.theta = (int16_t)_i.theta; \ - _o.psi = (int16_t)_i.psi; \ - } - -#define PPRZ_INT32_VECT3_COPY(_o, _i) { \ - _o.x = _i.x; \ - _o.y = _i.y; \ - _o.z = _i.z; \ - } - -#define PPRZ_INT32_VECT3_ASSIGN(v, _x, _y, _z) { \ - v.x = _x; \ - v.y = _y; \ - v.z = _z; \ - } - -#define PPRZ_INT32_VECT2_DIFF(_o_i32v2, _i1_i32v2, _i2_i32v2) { \ - _o_i32v2.x = _i1_i32v2.x - _i2_i32v2.x; \ - _o_i32v2.y = _i1_i32v2.y - _i2_i32v2.y; \ - } - -#define PPRZ_INT32_EULER_ASSIGN(e, _phi, _theta, _psi) { \ - e.phi = _phi; \ - e.theta = _theta; \ - e.psi = _psi; \ - } - -// FIXME -#define PPRZ_INT32_VECT2_OF_LL(_o_i32v2, _i_lla) { \ - _o_i32v2.x = _i_lla.lat; \ - _o_i32v2.y = _i_lla.lon; \ - } - -#define PPRZ_INT32_LL_OF_VECT2(_o_lla, _i_i32v2) { \ - _o_lla.lat = _i_i32v2.x; \ - _o_lla.lon = _i_i32v2.y; \ - } - - -#define BOOZ_INT32_ZERO(_v) { \ - _v.lat = 0; \ - _v.lon = 0; \ - _v.alt = 0; \ - } - -#define PPRZ_INT32_LLA_ASSIGN(_o_lla, _lat, _lon, _alt) { \ - _o_lla.lat = _lat; \ - _o_lla.lon = _lon; \ - _o_lla.alt = _alt; \ - } - -#define PPRZ_INT32_LLA_VECT2_SUM(_o_lla, _i_lla, _i_i32v2) { \ - _o_lla.lat = _i_lla.lat + _i_i32v2.y; \ - _o_lla.lon = _i_lla.lon + _i_i32v2.x; \ - } - -#define PPRZ_INT32_LLA_VECT2_DIFF(_o_lla, _i_lla, _i_i32v2) { \ - _o_lla.lat = _i_lla.lat - _i_i32v2.y; \ - _o_lla.lon = _i_lla.lon - _i_i32v2.x; \ - } - -#define PPRZ_INT32_LLA_COPY(_o_lla, _i_lla) { \ - _o_lla.lat = _i_lla.lat; \ - _o_lla.lon = _i_lla.lon; \ - _o_lla.alt = _i_lla.alt; \ - } - -#define PPRZ_INT32_LLA_STRIM_LL(_o_lla, _min, _max) { \ - _o_lla.lat = _o_lla.lat < _min ? _min : _o_lla.lat > _max ? _max : _o_lla.lat; \ - _o_lla.lon = _o_lla.lon < _min ? _min : _o_lla.lon > _max ? _max : _o_lla.lon; \ -} - -#define PPRZ_INT32_LLA_NORM_LL(_n, _i_lla) { \ - int32_t n2 = _i_lla.lat*_i_lla.lat + _i_lla.lon*_i_lla.lon; \ - BOOZ_ISQRT(_n, n2); \ - } - -#define PPRZ_INT32_LLA_SMULT_LL(_o_lla, _i_lla, _s) { \ - _o_lla.lat = _i_lla.lat * _s; \ - _o_lla.lon = _i_lla.lon * _s; \ - } - -#define PPRZ_INT32_LLA_SDIV_LL(_o_lla, _i_lla, _s) { \ - _o_lla.lat = _o_lla.lat / _s; \ - _o_lla.lon = _o_lla.lon / _s; \ - } - -#define PPRZ_INT32_LLA_SUM_LL(_o_lla, _i1_lla, _i2_lla) { \ - _o_lla.lat =_i1_lla.lat + _i2_lla.lat; \ - _o_lla.lon =_i1_lla.lon + _i2_lla.lon; \ - } - -#define PPRZ_INT32_LLA_DIFF_LL(_o_lla, _i1_lla, _i2_lla) { \ - _o_lla.lat =_i1_lla.lat - _i2_lla.lat; \ - _o_lla.lon =_i1_lla.lon - _i2_lla.lon; \ - } - - - -#define BOOZ_IQUAT_COPY(_qo, _qi) { \ - _qo.qi = _qi.qi; \ - _qo.qx = _qi.qx; \ - _qo.qy = _qi.qy; \ - _qo.qz = _qi.qz; \ - } - - -#define BOOZ_IQUAT_EXPLEMENTARY(b,a) { \ - b.qi = -a.qi; \ - b.qx = -a.qx; \ - b.qy = -a.qy; \ - b.qz = -a.qz; \ - } - -#define BOOZ_IQUAT_WRAP_SHORTEST(q) { \ - if (q.qi < 0) \ - BOOZ_IQUAT_EXPLEMENTARY(q,q); \ - } - - -#define BOOZ_IQUAT_QDOT(qdot, q, r) { \ - qdot.qi = (-r.x*q.qx -r.y*q.qy -r.z*q.qz)>>(IRATE_RES+1); \ - qdot.qx = ( r.x*q.qi +r.z*q.qy -r.y*q.qz)>>(IRATE_RES+1); \ - qdot.qy = ( r.y*q.qi -r.z*q.qx +r.x*q.qz)>>(IRATE_RES+1); \ - qdot.qz = ( r.z*q.qi +r.y*q.qx -r.x*q.qy)>>(IRATE_RES+1); \ - } - - -#define BOOZ_IQUAT_QDOT_L(qdot, q, r) { \ - qdot.qi = (-r.x*q.qx -r.y*q.qy -r.z*q.qz)>>(IRATE_RES+1); \ - qdot.qx = ( r.x*q.qi +r.z*q.qy -r.y*q.qz)>>(IRATE_RES+1); \ - qdot.qy = ( r.y*q.qi -r.z*q.qx +r.x*q.qz)>>(IRATE_RES+1); \ - qdot.qz = ( r.z*q.qi +r.y*q.qx -r.x*q.qy)>>(IRATE_RES+1); \ - int32_t n; \ - BOOZ_IQUAT_NORM(n, q); \ - int32_t dn = (1<>IQUAT_RES); \ - qdot.qx = qdot.qx + ((dn * q.qx)>>IQUAT_RES); \ - qdot.qy = qdot.qy + ((dn * q.qy)>>IQUAT_RES); \ - qdot.qz = qdot.qz + ((dn * q.qz)>>IQUAT_RES); \ - } - - -/* wrong !!! */ -#define BOOZ_IQUAT_INTEG_T(q,qdot,f) { \ - q.qi = q.qi + (qdot.qi+1) / f; \ - q.qx = q.qx + (qdot.qx+1) / f; \ - q.qy = q.qy + (qdot.qy+1) / f; \ - q.qz = q.qz + (qdot.qz+1) / f; \ - } - - -#define BOOZ_IQUAT_INTEG(q,qdot,f) { \ - q.qi = q.qi + (qdot.qi) / f; \ - q.qx = q.qx + (qdot.qx) / f; \ - q.qy = q.qy + (qdot.qy) / f; \ - q.qz = q.qz + (qdot.qz) / f; \ - } - - - - - -/* - rotate a vector by the invert of a quaternion -*/ -#define BOOZ_IQUAT_VDIV(v_out, q, v_in) { \ - const int32_t qi2 = (q.qi*q.qi)>>IQUAT_RES; \ - const int32_t qx2 = (q.qx*q.qx)>>IQUAT_RES; \ - const int32_t qy2 = (q.qy*q.qy)>>IQUAT_RES; \ - const int32_t qz2 = (q.qz*q.qz)>>IQUAT_RES; \ - const int32_t qiqx = (q.qi*q.qx)>>IQUAT_RES; \ - const int32_t qiqy = (q.qi*q.qy)>>IQUAT_RES; \ - const int32_t qiqz = (q.qi*q.qz)>>IQUAT_RES; \ - const int32_t qxqy = (q.qx*q.qy)>>IQUAT_RES; \ - const int32_t qxqz = (q.qx*q.qz)>>IQUAT_RES; \ - const int32_t qyqz = (q.qy*q.qz)>>IQUAT_RES; \ - const int32_t m00 = qi2 + qx2 - qy2 - qz2; \ - const int32_t m01 = 2 * (qxqy + qiqz ); \ - const int32_t m02 = 2 * (qxqz - qiqy ); \ - const int32_t m10 = 2 * (qxqy - qiqz ); \ - const int32_t m11 = qi2 - qx2 + qy2 - qz2; \ - const int32_t m12 = 2 * (qyqz + qiqx ); \ - const int32_t m20 = 2 * (qxqz + qiqy ); \ - const int32_t m21 = 2 * (qyqz - qiqx ); \ - const int32_t m22 = qi2 - qx2 - qy2 + qz2; \ - v_out.x = (m00 * v_in.x + m10 * v_in.y + m20 * v_in.z)>>IQUAT_RES; \ - v_out.y = (m01 * v_in.x + m11 * v_in.y + m21 * v_in.z)>>IQUAT_RES; \ - v_out.z = (m02 * v_in.x + m12 * v_in.y + m22 * v_in.z)>>IQUAT_RES; \ - } - - - - - -/* - rotate a vector having only a z coordinate by a quaternion - same as BOOZ_IQUAT_VMULT with zeros explicitely removed -*/ -#define BOOZ_IQUAT_ZVMULT(v_out, q, zv_in) { \ - const int32_t qi2 = (q.qi*q.qi)>>IQUAT_RES; \ - const int32_t qx2 = (q.qx*q.qx)>>IQUAT_RES; \ - const int32_t qy2 = (q.qy*q.qy)>>IQUAT_RES; \ - const int32_t qz2 = (q.qz*q.qz)>>IQUAT_RES; \ - const int32_t qiqx = (q.qi*q.qx)>>IQUAT_RES; \ - const int32_t qiqy = (q.qi*q.qy)>>IQUAT_RES; \ - const int32_t qxqz = (q.qx*q.qz)>>IQUAT_RES; \ - const int32_t qyqz = (q.qy*q.qz)>>IQUAT_RES; \ - const int32_t m02 = 2 * (qxqz - qiqy ); \ - const int32_t m12 = 2 * (qyqz + qiqx ); \ - const int32_t m22 = qi2 - qx2 - qy2 + qz2; \ - v_out.x = (m02 * zv_in)>>IQUAT_RES; \ - v_out.y = (m12 * zv_in)>>IQUAT_RES; \ - v_out.z = (m22 * zv_in)>>IQUAT_RES; \ - } - - - -#define BOOZ_IVECT2_ASSIGN(v, _x, _y) { \ - v.x = _x; \ - v.y = _y; \ - } - -#define BOOZ_IVECT2_ZERO(v) { \ - BOOZ_IVECT2_ASSIGN(v, 0, 0); \ - } - -#define BOOZ_IVECT2_SUM(c, a, b) { \ - c.x = a.x + b.x; \ - c.y = a.y + b.y; \ - } - -#define BOOZ_IVECT2_ADD(a, b) { \ - a.x += b.x; \ - a.y += b.y; \ - } - -#define BOOZ_IVECT2_DIFF(_c, _a, _b) { \ - _c.x = _a.x - _b.x; \ - _c.y = _a.y - _b.y; \ - } - -#define BOOZ_IVECT2_COPY(_out, _in) { \ - _out.x = _in.x; \ - _out.y = _in.y; \ - } - -#define BOOZ_IVECT2_NORM(n, v) { \ - int32_t n2 = v.x*v.x + v.y*v.y; \ - BOOZ_ISQRT(n, n2); \ - } - -#define BOOZ_IVECT2_SMULT(o, i, s) { \ - o.x = i.x * s; \ - o.y = i.y * s; \ -} - -#define BOOZ_IVECT2_SDIV(o, i, s) { \ - o.x = i.x / s; \ - o.y = i.y / s; \ -} - -#define BOOZ_IVECT2_BOUND(_out, _in, _min, _max) { \ - _out.x = _in.x < _min.x ? _min.x : _in.x > _max.x ? _max.x : _in.x; \ - _out.y = _in.y < _min.y ? _min.y : _in.y > _max.y ? _max.y : _in.y; \ - } - -#define BOOZ_IVECT2_TRIM(_v, _min, _max) { \ - _v.x = _v.x < _min.x ? _min.x : _v.x > _max.x ? _max.x : _v.x; \ - _v.y = _v.y < _min.y ? _min.y : _v.y > _max.y ? _max.y : _v.y; \ - } - -#define BOOZ_IVECT2_STRIM(_v, _min, _max) { \ - _v.x = _v.x < _min ? _min : _v.x > _max ? _max : _v.x; \ - _v.y = _v.y < _min ? _min : _v.y > _max ? _max : _v.y; \ - } - - -#define BOOZ_IVECT_ASSIGN(v, _x, _y, _z) { \ - v.x = _x; \ - v.y = _y; \ - v.z = _z; \ - } - - -#define BOOZ_IVECT_ZERO(v) { \ - BOOZ_IVECT_ASSIGN(v, 0, 0, 0); \ - } - - - -#define BOOZ_IVECT_DIFF(c, a, b) { \ - c.x = a.x - b.x; \ - c.y = a.y - b.y; \ - c.z = a.z - b.z; \ - } - - -#define BOOZ_IVECT_SUM(c, a, b) { \ - c.x = a.x + b.x; \ - c.y = a.y + b.y; \ - c.z = a.z + b.z; \ - } - - -/* scalar vector multiplication */ -#define BOOZ_IVECT_SMULT(o, i, s) { \ - o.x = i.x * s; \ - o.y = i.y * s; \ - o.z = i.z * s; \ -} - -/* Element wise vector multiplication */ -#define BOOZ_IVECT_EWMULT(c, a, b, r) { \ - c.x = (a.x * b.x) >> (r); \ - c.y = (a.y * b.y) >> (r); \ - c.z = (a.z * b.z) >> (r); \ - } - -#define BOOZ_IVECT_SDIV(o, i, s) { \ - o.x = i.x / s; \ - o.y = i.y / s; \ - o.z = i.z / s; \ -} - -#define BOOZ_IVECT_SDIV_ACC(o, i, s) { \ - o.x = i.x + (i.x>=0 ? s/2 : -s/2); \ - o.x /= s; \ - o.y = i.y + (i.y>=0 ? s/2 : -s/2); \ - o.y /= s; \ - o.z = i.z + (i.z>=0 ? s/2 : -s/2); \ - o.z /= s; \ -} - - -#define BOOZ_IVECT_SUB_EWMULT(o, i, n, s) { \ - o.x = (i.x - n.x) * s.x; \ - o.y = (i.y - n.y) * s.y; \ - o.z = (i.z - n.z) * s.z; \ -} - - -#define BOOZ_IVECT_CROSS_PRODUCT(vo, v1, v2, r) { \ - vo.x = (v1.y*v2.z - v1.z*v2.y)>>(r); \ - vo.y = (v1.z*v2.x - v1.x*v2.z)>>(r); \ - vo.z = (v1.x*v2.y - v1.y*v2.x)>>(r); \ - } - - -#define BOOZ_IVECT_COPY(_out, _in) { \ - _out.x = _in.x; \ - _out.y = _in.y; \ - _out.z = _in.z; \ - } - -#include -#define BOOZ_IVECT_ABS(_out, _in) { \ - _out.x = abs(_in.x); \ - _out.y = abs(_in.y); \ - _out.z = abs(_in.z); \ - } - -#define BOOZ_IVECT_BOUND(_out, _in, _min, _max) { \ - _out.x = _in.x < _min.x ? _min.x : _in.x > _max.x ? _max.x : _in.x; \ - _out.y = _in.y < _min.y ? _min.y : _in.y > _max.y ? _max.y : _in.y; \ - _out.z = _in.z < _min.z ? _min.z : _in.z > _max.z ? _max.z : _in.z; \ - } - - -#define BOOZ_IVECT_INTEG(v,vdot,f) { \ - v.x = v.x + (vdot.x) / f; \ - v.y = v.y + (vdot.y) / f; \ - v.z = v.z + (vdot.z) / f; \ - } - - -#define BOOZ_ISQRT_MAX_ITER 40 -#define BOOZ_ISQRT(_out,_in) { \ - if (_in == 0) \ - _out = 0; \ - else { \ - uint32_t s1, s2; \ - uint8_t iter = 0; \ - s2 = _in; \ - do { \ - s1 = s2; \ - s2 = _in / s1; \ - s2 += s1; \ - s2 /= 2; \ - iter++; \ - } \ - while( ( (s1-s2) > 1) && (iter < BOOZ_ISQRT_MAX_ITER)); \ - _out = s2; \ - } \ - } - -#include "booz_trig_int.h" - -#define BOOZ_ISIN(_s, _a) { \ - int32_t an = _a; \ - BOOZ_ANGLE_NORMALIZE(an); \ - if (an > PI_2_INT) an = PI_INT - an; \ - else if (an < -PI_2_INT) an = -PI_INT - an; \ - if (an >= 0) _s = booz_trig_int[an]; \ - else _s = -booz_trig_int[-an]; \ - } - - -#define BOOZ_ICOS(_c, _a) { \ - BOOZ_ISIN( _c, _a + PI_2_INT); \ - } - -#define BOOZ_IATAN2(_r, _y, _x) { \ - \ - } - - -#define BOOZ_IEULER_ZERO(_ie) { \ - _ie.phi = 0; \ - _ie.theta = 0; \ - _ie.psi = 0; \ - } - - -#define BOOZ_IEULER_COPY(_out, _in) { \ - _out.phi = _in.phi; \ - _out.theta = _in.theta; \ - _out.psi = _in.psi; \ - } - - -#define BOOZ_IEULER_INTEG(e,edot,f) { \ - e.phi = e.phi + (edot.phi) / f; \ - e.theta = e.theta + (edot.theta) / f; \ - e.psi = e.psi + (edot.psi) / f; \ - } - - -#define BOOZ_IEULER_SUM(ec, ea, eb) { \ - ec.phi = ea.phi + eb.phi; \ - ec.theta = ea.theta + eb.theta; \ - ec.psi = ea.psi + eb.psi; \ - } - - -#define BOOZ_IEULER_DIFF(ec, ea, eb) { \ - ec.phi = ea.phi - eb.phi; \ - ec.theta = ea.theta - eb.theta; \ - ec.psi = ea.psi - eb.psi; \ - } - - -#define BOOZ_IEULER_SDIV(eb, ea, s) { \ - eb.phi = ea.phi / s; \ - eb.theta = ea.theta / s; \ - eb.psi = ea.psi / s; \ - } - - -#define BOOZ_IEULER_BOUND(_out, _in, _min, _max) { \ - _out.phi = _in.phi < _min.phi ? _min.phi : _in.phi > _max.phi ? _max.phi : _in.phi; \ - _out.theta = _in.theta < _min.theta ? _min.theta : _in.theta > _max.theta ? _max.theta : _in.theta; \ - _out.psi = _in.psi < _min.psi ? _min.psi : _in.psi > _max.psi ? _max.psi : _in.psi; \ - } - - - - -#endif /* BOOZ_GEOMETRY_INT_H */ - diff --git a/sw/airborne/booz/booz_geometry_mixed.h b/sw/airborne/booz/booz_geometry_mixed.h deleted file mode 100644 index f565045910..0000000000 --- a/sw/airborne/booz/booz_geometry_mixed.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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 BOOZ_GEOMETRY_MIXED_H -#define BOOZ_GEOMETRY_MIXED_H - - -#include "booz_geometry_int.h" - -#define BOOZ_INT_OF_FLOAT(f,r) ((f)*(float)(1<<(r))) -#define BOOZ_FLOAT_OF_INT(i,r) ((float)(i)/(float)(1<<(r))) - -#define BOOZ_FQUAT_OF_IQUAT(fq, iq) { \ - fq.qi = BOOZ_FLOAT_OF_INT(iq.qi, IQUAT_RES); \ - fq.qx = BOOZ_FLOAT_OF_INT(iq.qx, IQUAT_RES); \ - fq.qy = BOOZ_FLOAT_OF_INT(iq.qy, IQUAT_RES); \ - fq.qz = BOOZ_FLOAT_OF_INT(iq.qz, IQUAT_RES); \ - } - -#define BOOZ_IQUAT_OF_FQUAT(iq, fq) { \ - iq.qi = BOOZ_INT_OF_FLOAT(fq.qi, IQUAT_RES); \ - iq.qx = BOOZ_INT_OF_FLOAT(fq.qx, IQUAT_RES); \ - iq.qy = BOOZ_INT_OF_FLOAT(fq.qy, IQUAT_RES); \ - iq.qz = BOOZ_INT_OF_FLOAT(fq.qz, IQUAT_RES); \ - } - - -#define BOOZ_RATE_F_OF_I(i) BOOZ_FLOAT_OF_INT(i,IRATE_RES) -#define BOOZ_RATE_I_OF_F(f) BOOZ_INT_OF_FLOAT(f,IRATE_RES) - -#define BOOZ_VRATE_F_OF_I(f, i) { \ - f.x = BOOZ_RATE_F_OF_I(i.x); \ - f.y = BOOZ_RATE_F_OF_I(i.y); \ - f.z = BOOZ_RATE_F_OF_I(i.z); \ - } - -#define BOOZ_VRATE_I_OF_F(i, f) { \ - i.x = BOOZ_RATE_I_OF_F(f.x); \ - i.y = BOOZ_RATE_I_OF_F(f.y); \ - i.z = BOOZ_RATE_I_OF_F(f.z); \ - } - -#define BOOZ_ANGLE_F_OF_I(i) BOOZ_FLOAT_OF_INT(i,IANGLE_RES) -#define BOOZ_ANGLE_I_OF_F(f) BOOZ_INT_OF_FLOAT(f,IANGLE_RES) - -#define BOOZ_TRIG_F_OF_I(i) BOOZ_FLOAT_OF_INT(i,ITRIG_RES) -#define BOOZ_TRIG_I_OF_F(f) BOOZ_INT_OF_FLOAT(f,ITRIG_RES) - -#define BOOZ_IEULER_OF_FEULER(_ie, _fe) { \ - _ie.phi = BOOZ_ANGLE_I_OF_F(_fe.phi); \ - _ie.theta = BOOZ_ANGLE_I_OF_F(_fe.theta); \ - _ie.psi = BOOZ_ANGLE_I_OF_F(_fe.psi); \ - } - -#define BOOZ_ACCEL_I_OF_F(f) BOOZ_INT_OF_FLOAT(f,IACCEL_RES) -#define BOOZ_ACCEL_F_OF_I(i) BOOZ_FLOAT_OF_INT(i,IACCEL_RES) - -#define BOOZ_SPEED_I_OF_F(f) BOOZ_INT_OF_FLOAT(f,ISPEED_RES) -#define BOOZ_SPEED_F_OF_I(i) BOOZ_FLOAT_OF_INT(i,ISPEED_RES) - -#define BOOZ_POS_I_OF_F(f) BOOZ_INT_OF_FLOAT(f,IPOS_FRAC) -#define BOOZ_POS_F_OF_I(i) BOOZ_FLOAT_OF_INT(i,IPOS_FRAC) - -#endif /* BOOZ_GEOMETRY_MIXED_H */ - diff --git a/sw/airborne/booz/booz2_imu.c b/sw/airborne/booz/booz_imu.c similarity index 91% rename from sw/airborne/booz/booz2_imu.c rename to sw/airborne/booz/booz_imu.c index 6dc2a7237f..3cc7eb6412 100644 --- a/sw/airborne/booz/booz2_imu.c +++ b/sw/airborne/booz/booz_imu.c @@ -21,13 +21,13 @@ * Boston, MA 02111-1307, USA. */ -#include "booz2_imu.h" +#include "booz_imu.h" #include "airframe.h" struct BoozImu booz_imu; -void booz2_imu_init(void) { +void booz_imu_init(void) { /* initialises neutrals */ RATES_ASSIGN(booz_imu.gyro_neutral, IMU_GYRO_P_NEUTRAL, IMU_GYRO_Q_NEUTRAL, IMU_GYRO_R_NEUTRAL); @@ -38,10 +38,11 @@ void booz2_imu_init(void) { Compute quaternion and rotation matrix for conversions between body and imu frame */ - struct booz_ieuler body_to_imu_eulers = {IMU_BODY_TO_IMU_PHI, IMU_BODY_TO_IMU_THETA, IMU_BODY_TO_IMU_PSI}; + struct Int32Eulers body_to_imu_eulers = {IMU_BODY_TO_IMU_PHI, IMU_BODY_TO_IMU_THETA, IMU_BODY_TO_IMU_PSI}; INT32_QUAT_OF_EULERS(booz_imu.body_to_imu_quat, body_to_imu_eulers); INT32_QUAT_NORMALISE(booz_imu.body_to_imu_quat); INT32_RMAT_OF_EULERS(booz_imu.body_to_imu_rmat, body_to_imu_eulers); + booz_imu_impl_init(); } diff --git a/sw/airborne/booz/booz2_imu.h b/sw/airborne/booz/booz_imu.h similarity index 87% rename from sw/airborne/booz/booz2_imu.h rename to sw/airborne/booz/booz_imu.h index 3fd6f208e1..35cd20e2e3 100644 --- a/sw/airborne/booz/booz2_imu.h +++ b/sw/airborne/booz/booz_imu.h @@ -21,12 +21,16 @@ * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ2_IMU_H -#define BOOZ2_IMU_H +#ifndef BOOZ_IMU_H +#define BOOZ_IMU_H -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_int.h" -#include BOOZ2_IMU_TYPE_H +/* underlying hardware */ +#include BOOZ_IMU_TYPE_H +/* must be defined by underlying hardware */ +extern void booz_imu_impl_init(void); +extern void booz_imu_periodic(void); struct BoozImu { struct Int32Rates gyro; @@ -46,9 +50,9 @@ struct BoozImu { extern struct BoozImu booz_imu; -extern void booz2_imu_init(void); +extern void booz_imu_init(void); -#define Booz2ImuScaleGyro() { \ +#define BoozImuScaleGyro() { \ RATES_COPY(booz_imu.gyro_prev, booz_imu.gyro); \ booz_imu.gyro.p = ((booz_imu.gyro_unscaled.p - booz_imu.gyro_neutral.p)*IMU_GYRO_P_SENS_NUM)/IMU_GYRO_P_SENS_DEN; \ booz_imu.gyro.q = ((booz_imu.gyro_unscaled.q - booz_imu.gyro_neutral.q)*IMU_GYRO_Q_SENS_NUM)/IMU_GYRO_Q_SENS_DEN; \ @@ -56,7 +60,7 @@ extern void booz2_imu_init(void); } -#define Booz2ImuScaleAccel() { \ +#define BoozImuScaleAccel() { \ VECT3_COPY(booz_imu.accel_prev, booz_imu.accel); \ booz_imu.accel.x = ((booz_imu.accel_unscaled.x - booz_imu.accel_neutral.x)*IMU_ACCEL_X_SENS_NUM)/IMU_ACCEL_X_SENS_DEN; \ booz_imu.accel.y = ((booz_imu.accel_unscaled.y - booz_imu.accel_neutral.y)*IMU_ACCEL_Y_SENS_NUM)/IMU_ACCEL_Y_SENS_DEN; \ @@ -64,7 +68,7 @@ extern void booz2_imu_init(void); } #if defined IMU_MAG_45_HACK -#define Booz2ImuScaleMag() { \ +#define BoozImuScaleMag() { \ int32_t msx = ((booz_imu.mag_unscaled.x - booz_imu.mag_neutral.x) * IMU_MAG_X_SENS_NUM) / IMU_MAG_X_SENS_DEN; \ int32_t msy = ((booz_imu.mag_unscaled.y - booz_imu.mag_neutral.y) * IMU_MAG_Y_SENS_NUM) / IMU_MAG_Y_SENS_DEN; \ booz_imu.mag.x = msx - msy; \ @@ -72,7 +76,7 @@ extern void booz2_imu_init(void); booz_imu.mag.z = ((booz_imu.mag_unscaled.z - booz_imu.mag_neutral.z) * IMU_MAG_Z_SENS_NUM) / IMU_MAG_Z_SENS_DEN; \ } #else -#define Booz2ImuScaleMag() { \ +#define BoozImuScaleMag() { \ booz_imu.mag.x = ((booz_imu.mag_unscaled.x - booz_imu.mag_neutral.x) * IMU_MAG_X_SENS_NUM) / IMU_MAG_X_SENS_DEN; \ booz_imu.mag.y = ((booz_imu.mag_unscaled.y - booz_imu.mag_neutral.y) * IMU_MAG_Y_SENS_NUM) / IMU_MAG_Y_SENS_DEN; \ booz_imu.mag.z = ((booz_imu.mag_unscaled.z - booz_imu.mag_neutral.z) * IMU_MAG_Z_SENS_NUM) / IMU_MAG_Z_SENS_DEN; \ @@ -80,6 +84,4 @@ extern void booz2_imu_init(void); #endif - - #endif /* BOOZ2_IMU_H */ diff --git a/sw/airborne/booz/booz_radio_control_ppm.c b/sw/airborne/booz/booz_radio_control_ppm.c deleted file mode 100644 index a18efbe368..0000000000 --- a/sw/airborne/booz/booz_radio_control_ppm.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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. - */ - -#include "booz_radio_control.h" - - -uint16_t booz_radio_control_ppm_pulses[ RADIO_CONTROL_NB_CHANNEL ]; -volatile bool_t booz_radio_control_ppm_frame_available; - -void radio_control_impl_init(void) { - booz_radio_control_ppm_frame_available = FALSE; - booz_radio_control_ppm_hw_init(); -} diff --git a/sw/airborne/booz/booz_radio_control_ppm.h b/sw/airborne/booz/booz_radio_control_ppm.h deleted file mode 100644 index a7513e0a77..0000000000 --- a/sw/airborne/booz/booz_radio_control_ppm.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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 BOOZ_RADIO_CONTROL_PPM_H -#define BOOZ_RADIO_CONTROL_PPM_H - -#include "booz_radio_control_ppm_hw.h" - -#include "conf_radio_control_ppm.h" /* generated code */ - -/** - * Radio control type : futaba is falling edge clocked whereas JR is rising edge - */ -#define PPM_PULSE_TYPE_POSITIVE 0 -#define PPM_PULSE_TYPE_NEGATIVE 1 - -extern uint16_t booz_radio_control_ppm_pulses[ RADIO_CONTROL_NB_CHANNEL ]; -extern volatile bool_t booz_radio_control_ppm_frame_available; - - -#define RadioControlEvent(_received_frame_handler) { \ - if (booz_radio_control_ppm_frame_available) { \ - radio_control.frame_cpt++; \ - radio_control.time_since_last_frame = 0; \ - radio_control.status = RADIO_CONTROL_OK; \ - NormalizePpm(); \ - _received_frame_handler(); \ - booz_radio_control_ppm_frame_available = FALSE; \ - } \ - } - -#endif /* BOOZ_RADIO_CONTROL_PPM_H */ diff --git a/sw/airborne/booz/booz_radio_control_spektrum.c b/sw/airborne/booz/booz_radio_control_spektrum.c deleted file mode 100644 index 9ef019300f..0000000000 --- a/sw/airborne/booz/booz_radio_control_spektrum.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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. - */ - -#include "booz_radio_control.h" - -bool_t rc_spk_parser_status; -uint8_t rc_spk_parser_idx; -uint8_t rc_spk_parser_buf[RADIO_CONTROL_NB_CHANNEL*2]; -const int16_t rc_spk_throw[RADIO_CONTROL_NB_CHANNEL] = RC_SPK_THROWS; - -void radio_control_impl_init(void) { - rc_spk_parser_status = RC_SPK_STA_UNINIT; - rc_spk_parser_idx = 0; -} diff --git a/sw/airborne/booz/booz_radio_control_spektrum.h b/sw/airborne/booz/booz_radio_control_spektrum.h deleted file mode 100644 index 59e1fbbb27..0000000000 --- a/sw/airborne/booz/booz_radio_control_spektrum.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Paparazzi $Id$ - * - * Copyright (C) 2009 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 BOOZ_RADIO_CONTROL_SPEKTRUM_H -#define BOOZ_RADIO_CONTROL_SPEKTRUM_H - -#include "std.h" -#include "uart.h" - -#include RADIO_CONTROL_SPEKTRUM_MODEL_H - -#define RC_SPK_SYNC_1 0x03 - -#define RC_SPK_STA_UNINIT 0 -#define RC_SPK_STA_GOT_SYNC_1 1 -#define RC_SPK_STA_GOT_SYNC_2 2 - -extern bool_t rc_spk_parser_status; -extern uint8_t rc_spk_parser_idx; -extern uint8_t rc_spk_parser_buf[RADIO_CONTROL_NB_CHANNEL*2]; - -#define MAX_SPK 344 -extern const int16_t rc_spk_throw[RADIO_CONTROL_NB_CHANNEL]; - -#define __RcLink(dev, _x) dev##_x -#define _RcLink(dev, _x) __RcLink(dev, _x) -#define RcLink(_x) _RcLink(RADIO_CONTROL_LINK, _x) - -#define RcLinkChAvailable() RcLink(ChAvailable()) -#define RcLinkGetCh() RcLink(Getch()) - -#define RadioControlEvent(_received_frame_handler) { \ - while (RcLinkChAvailable()) { \ - int8_t c = RcLinkGetCh(); \ - switch (rc_spk_parser_status) { \ - case RC_SPK_STA_UNINIT: \ - if (c==RC_SPK_SYNC_1) \ - rc_spk_parser_status = RC_SPK_STA_GOT_SYNC_1; \ - break; \ - case RC_SPK_STA_GOT_SYNC_1: \ - if (c==RC_SPK_SYNC_2) { \ - rc_spk_parser_status = RC_SPK_STA_GOT_SYNC_2; \ - rc_spk_parser_idx = 0; \ - } \ - else \ - rc_spk_parser_status = RC_SPK_STA_UNINIT; \ - break; \ - case RC_SPK_STA_GOT_SYNC_2: \ - rc_spk_parser_buf[rc_spk_parser_idx] = c; \ - 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 = RADIO_CONTROL_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; \ - } \ - } \ - } - - -#endif /* BOOZ_RADIO_CONTROL_SPEKTRUM_H */ diff --git a/sw/airborne/booz/booz_radio_control_spektrum_dx7se.h b/sw/airborne/booz/booz_radio_control_spektrum_dx7se.h deleted file mode 100644 index 5c8c772e13..0000000000 --- a/sw/airborne/booz/booz_radio_control_spektrum_dx7se.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 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 BOOZ_RADIO_CONTROL_SPEKTRUM_DX7SE_H -#define BOOZ_RADIO_CONTROL_SPEKTRUM_DX7SE_H - -#define RADIO_CONTROL_NB_CHANNEL 7 -#define RADIO_CONTROL_ROLL 0 -#define RADIO_CONTROL_THROTTLE 1 -#define RADIO_CONTROL_PITCH 2 -#define RADIO_CONTROL_YAW 3 -#define RADIO_CONTROL_MODE 5 - -#define RC_SPK_SYNC_2 0x12 - -#define RC_SPK_THROWS { MAX_PPRZ/MAX_SPK, \ - MAX_PPRZ/MAX_SPK, \ - -MAX_PPRZ/MAX_SPK, \ - MAX_PPRZ/MAX_SPK, \ - MAX_PPRZ/MAX_SPK, \ - MAX_PPRZ/MAX_SPK, \ - MAX_PPRZ/MAX_SPK } - -/* - aileron 1 - elevator 2 - rudder 3 - gear 4 - throttle 5 -*/ - -#endif /* BOOZ_RADIO_CONTROL_SPEKTRUM_DX7SE_H */ diff --git a/sw/airborne/booz/booz2_fms_datalink.c b/sw/airborne/booz/impl/booz_fms_datalink.c similarity index 100% rename from sw/airborne/booz/booz2_fms_datalink.c rename to sw/airborne/booz/impl/booz_fms_datalink.c diff --git a/sw/airborne/booz/booz2_fms_datalink.h b/sw/airborne/booz/impl/booz_fms_datalink.h similarity index 100% rename from sw/airborne/booz/booz2_fms_datalink.h rename to sw/airborne/booz/impl/booz_fms_datalink.h diff --git a/sw/airborne/booz/booz2_fms_test_signal.c b/sw/airborne/booz/impl/booz_fms_test_signal.c similarity index 100% rename from sw/airborne/booz/booz2_fms_test_signal.c rename to sw/airborne/booz/impl/booz_fms_test_signal.c diff --git a/sw/airborne/booz/booz2_fms_test_signal.h b/sw/airborne/booz/impl/booz_fms_test_signal.h similarity index 100% rename from sw/airborne/booz/booz2_fms_test_signal.h rename to sw/airborne/booz/impl/booz_fms_test_signal.h diff --git a/sw/airborne/booz/impl/booz_imu_b2.h b/sw/airborne/booz/impl/booz_imu_b2.h index ca2107b042..fe833500fe 100644 --- a/sw/airborne/booz/impl/booz_imu_b2.h +++ b/sw/airborne/booz/impl/booz_imu_b2.h @@ -35,11 +35,11 @@ #if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 #include "peripherals/booz_ms2001.h" #define BoozImuMagEvent(_mag_handler) { \ - if (micromag_status == MM_DATA_AVAILABLE) { \ - booz_imu.mag_unscaled.x = micromag_values[IMU_MAG_X_CHAN]; \ - booz_imu.mag_unscaled.y = micromag_values[IMU_MAG_Y_CHAN]; \ - booz_imu.mag_unscaled.z = micromag_values[IMU_MAG_Z_CHAN]; \ - micromag_status = MM_IDLE; \ + if (ms2001_status == MS2001_DATA_AVAILABLE) { \ + booz_imu.mag_unscaled.x = ms2001_values[IMU_MAG_X_CHAN]; \ + booz_imu.mag_unscaled.y = ms2001_values[IMU_MAG_Y_CHAN]; \ + booz_imu.mag_unscaled.z = ms2001_values[IMU_MAG_Z_CHAN]; \ + ms2001_status = MS2001_IDLE; \ _mag_handler(); \ } \ } diff --git a/sw/airborne/booz/impl/booz_imu_crista.c b/sw/airborne/booz/impl/booz_imu_crista.c index f0275e164e..94ae7f4c55 100644 --- a/sw/airborne/booz/impl/booz_imu_crista.c +++ b/sw/airborne/booz/impl/booz_imu_crista.c @@ -23,11 +23,11 @@ #include "booz_imu.h" -void booz2_imu_impl_init(void) { +void booz_imu_impl_init(void) { ADS8344_available = FALSE; - booz2_imu_crista_arch_init(); + booz_imu_crista_arch_init(); #ifdef USE_AMI601 ami601_init(); @@ -35,9 +35,9 @@ void booz2_imu_impl_init(void) { } -void booz2_imu_periodic(void) { +void booz_imu_periodic(void) { - Booz2ImuCristaHwPeriodic(); + BoozImuCristaArchPeriodic(); #ifdef USE_AMI601 RunOnceEvery(10, { ami601_read(); }); #endif diff --git a/sw/airborne/booz/impl/booz_imu_crista.h b/sw/airborne/booz/impl/booz_imu_crista.h index 9687cbf74b..d8de88236f 100644 --- a/sw/airborne/booz/impl/booz_imu_crista.h +++ b/sw/airborne/booz/impl/booz_imu_crista.h @@ -27,14 +27,11 @@ #include "booz_imu.h" -extern void booz_imu_impl_init(void); -extern void booz_imu_periodic(void); - #define ADS8344_NB_CHANNELS 8 extern uint16_t ADS8344_values[ADS8344_NB_CHANNELS]; extern bool_t ADS8344_available; -#define Booz2ImuEvent(_gyro_accel_handler, _mag_handler) { \ +#define BoozImuEvent(_gyro_accel_handler, _mag_handler) { \ if (ADS8344_available) { \ ADS8344_available = FALSE; \ booz_imu.gyro_unscaled.p = ADS8344_values[IMU_GYRO_P_CHAN]; \ @@ -46,18 +43,18 @@ extern bool_t ADS8344_available; /* spare 3, temp 7 */ \ _gyro_accel_handler(); \ } \ - Booz2ImuMagEvent(_mag_handler); \ + BoozImuMagEvent(_mag_handler); \ } #ifdef USE_AMI601 #include "peripherals/booz_ami601.h" #define foo_handler() {} -#define Booz2ImuMagEvent(_mag_handler) { \ +#define BoozImuMagEvent(_mag_handler) { \ AMI601Event(foo_handler); \ if (ami601_status == AMI601_DATA_AVAILABLE) { \ - booz_imu.mag_unscaled.x = ami601_val[IMU_MAG_X_CHAN]; \ - booz_imu.mag_unscaled.y = ami601_val[IMU_MAG_Y_CHAN]; \ - booz_imu.mag_unscaled.z = ami601_val[IMU_MAG_Z_CHAN]; \ + booz_imu.mag_unscaled.x = ami601_values[IMU_MAG_X_CHAN]; \ + booz_imu.mag_unscaled.y = ami601_values[IMU_MAG_Y_CHAN]; \ + booz_imu.mag_unscaled.z = ami601_values[IMU_MAG_Z_CHAN]; \ ami601_status = AMI601_IDLE; \ _mag_handler(); \ } \ @@ -68,7 +65,10 @@ extern bool_t ADS8344_available; /* underlying architecture */ #include "impl/booz_imu_crista_arch.h" +/* must be defined by underlying architecture */ +extern void booz_imu_crista_arch_init(void); -#endif /* BOOZ2_IMU_CRISTA_H */ + +#endif /* BOOZ_IMU_CRISTA_H */ diff --git a/sw/airborne/booz/impl/booz_radio_control_ppm.h b/sw/airborne/booz/impl/booz_radio_control_ppm.h index 2b4160651a..a3f955dab7 100644 --- a/sw/airborne/booz/impl/booz_radio_control_ppm.h +++ b/sw/airborne/booz/impl/booz_radio_control_ppm.h @@ -24,7 +24,7 @@ #ifndef BOOZ_RADIO_CONTROL_PPM_H #define BOOZ_RADIO_CONTROL_PPM_H -#include "booz_radio_control_ppm_arch.h" +#include "impl/booz_radio_control_ppm_arch.h" #include "conf_radio_control_ppm.h" /* generated code */ diff --git a/sw/airborne/booz/impl/booz_radio_control_spektrum.h b/sw/airborne/booz/impl/booz_radio_control_spektrum.h index 59e1fbbb27..55806ff90b 100644 --- a/sw/airborne/booz/impl/booz_radio_control_spektrum.h +++ b/sw/airborne/booz/impl/booz_radio_control_spektrum.h @@ -78,8 +78,8 @@ extern const int16_t rc_spk_throw[RADIO_CONTROL_NB_CHANNEL]; for (i=0;i> 10; \ - /*const int16_t val = (tmp&0x03FF) - 512;*/ \ + /*const int16_t chan = (tmp&0xFC00) >> 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) { \ diff --git a/sw/airborne/booz/peripherals/booz_ami601.c b/sw/airborne/booz/peripherals/booz_ami601.c new file mode 100644 index 0000000000..044cc7cdaf --- /dev/null +++ b/sw/airborne/booz/peripherals/booz_ami601.c @@ -0,0 +1,37 @@ +#include "booz_ami601.h" + +uint8_t ami601_foo1; +uint8_t ami601_foo2; +uint8_t ami601_foo3; +uint16_t ami601_values[AMI601_NB_CHAN]; + +volatile uint8_t ami601_status; +volatile bool_t ami601_i2c_done; +volatile uint32_t ami601_nb_err; + +void ami601_init( void ) { + + uint8_t i; + for (i=0; i< AMI601_NB_CHAN; i++) { + ami601_values[i] = 0; + } + ami601_i2c_done = TRUE; + ami601_nb_err = 0; + ami601_status = AMI601_IDLE; + + +} + +void ami601_read( void ) { + if (ami601_status != AMI601_IDLE) { + ami601_nb_err++; + } + else { + ami601_i2c_done = FALSE; + ami601_status = AMI601_SENDING_REQ; + i2c1_buf[0] = 0x55; + i2c1_buf[1] = 0xAA; + i2c1_buf[2] = 0x14; + i2c1_transmit(AMI601_SLAVE_ADDR, 3, &ami601_i2c_done); + } +} diff --git a/sw/airborne/AMI601.h b/sw/airborne/booz/peripherals/booz_ami601.h similarity index 80% rename from sw/airborne/AMI601.h rename to sw/airborne/booz/peripherals/booz_ami601.h index 4c1ce744ea..5b30f26d78 100644 --- a/sw/airborne/AMI601.h +++ b/sw/airborne/booz/peripherals/booz_ami601.h @@ -1,5 +1,5 @@ -#ifndef AMI601_H -#define AMI601_H +#ifndef BOOZ_AMI601_H +#define BOOZ_AMI601_H #include "std.h" #include "i2c.h" @@ -11,7 +11,7 @@ extern void ami601_periodic( void ); extern void ami601_scale_measures(void); #define AMI601_NB_CHAN 6 -extern uint16_t ami601_val[AMI601_NB_CHAN]; +extern uint16_t ami601_values[AMI601_NB_CHAN]; extern uint8_t ami601_foo1; extern uint8_t ami601_foo2; extern uint8_t ami601_foo3; @@ -21,8 +21,8 @@ extern uint8_t ami601_foo3; #define AMI601_WAITING_MEASURE 2 #define AMI601_READING_MEASURE 3 #define AMI601_DATA_AVAILABLE 4 -extern volatile uint8_t ami601_status; -extern volatile bool_t ami601_i2c_done; +extern volatile uint8_t ami601_status; +extern volatile bool_t ami601_i2c_done; extern volatile uint32_t ami601_nb_err; #define AMI601_SLAVE_ADDR 0x60 @@ -53,8 +53,8 @@ extern volatile uint32_t ami601_nb_err; ami601_foo3 = i2c1_buf[2]; /* ERR ? */ \ uint8_t i; \ for (i=0; i< AMI601_NB_CHAN; i++) { \ - ami601_val[i] = i2c1_buf[3 + 2 * i]; \ - ami601_val[i] += i2c1_buf[3 + 2 * i + 1] * 256; \ + ami601_values[i] = i2c1_buf[3 + 2 * i]; \ + ami601_values[i] += i2c1_buf[3 + 2 * i + 1] * 256; \ } \ ami601_status = AMI601_DATA_AVAILABLE; \ _handler(); \ @@ -64,11 +64,9 @@ extern volatile uint32_t ami601_nb_err; } #endif -#define AMI_601_IT TIR_MR1I -#define AMI_601_ISR() AMI601ReadMeasure() +#define AMI601_IT TIR_MR1I +#define AMI601_ISR() AMI601ReadMeasure() #define AMI601ReadMeasure() { \ - /* disable match 1 interrupt */ \ - /* T0MCR |= TMCR_MR1_I; */ \ ami601_i2c_done = FALSE; \ ami601_status = AMI601_READING_MEASURE; \ i2c1_receive(AMI601_SLAVE_ADDR, 15, &ami601_i2c_done); \ diff --git a/sw/airborne/booz/booz2_max1168.c b/sw/airborne/booz/peripherals/booz_max1168.c similarity index 73% rename from sw/airborne/booz/booz2_max1168.c rename to sw/airborne/booz/peripherals/booz_max1168.c index 7f243e6e60..48428a491d 100644 --- a/sw/airborne/booz/booz2_max1168.c +++ b/sw/airborne/booz/peripherals/booz_max1168.c @@ -22,23 +22,19 @@ * */ -#include "booz2_max1168.h" +#include "booz_max1168.h" -volatile uint8_t booz2_max1168_status; -uint16_t booz2_max1168_values[MAX1168_NB_CHAN]; +volatile uint8_t booz_max1168_status; +uint16_t booz_max1168_values[MAX1168_NB_CHAN]; -uint8_t do_booz2_max1168_read; +extern void booz_max1168_init( void ) { -extern void booz2_max1168_init( void ) { - - booz2_max1168_hw_init(); - - do_booz2_max1168_read = false; + booz_max1168_arch_init(); uint8_t i; for (i=0; i #include -#include CONFIG +#include BOARD_CONFIG #include "init_hw.h" #include "led.h" diff --git a/sw/airborne/fya/test_periodic.c b/sw/airborne/fya/test_periodic.c index 32191d2c1c..7d145df883 100644 --- a/sw/airborne/fya/test_periodic.c +++ b/sw/airborne/fya/test_periodic.c @@ -24,7 +24,7 @@ #include #include -#include CONFIG +#include BOARD_CONFIG #include "init_hw.h" //#include "led.h" #include "sys_time.h" diff --git a/sw/airborne/fya/test_telemetry.c b/sw/airborne/fya/test_telemetry.c index b7ab214695..eb8e1e52c8 100644 --- a/sw/airborne/fya/test_telemetry.c +++ b/sw/airborne/fya/test_telemetry.c @@ -27,7 +27,7 @@ #include #include -#include CONFIG +#include BOARD_CONFIG #include "init_hw.h" #include "sys_time.h" #include "downlink.h" diff --git a/sw/airborne/fya/test_uart.c b/sw/airborne/fya/test_uart.c index 5e6439745e..1d1cf31df4 100644 --- a/sw/airborne/fya/test_uart.c +++ b/sw/airborne/fya/test_uart.c @@ -27,7 +27,7 @@ #include #include -#include CONFIG +#include BOARD_CONFIG #include "init_hw.h" #include "sys_time.h" diff --git a/sw/airborne/gyro.c b/sw/airborne/gyro.c index a5575b63b7..fe81a18eed 100644 --- a/sw/airborne/gyro.c +++ b/sw/airborne/gyro.c @@ -27,7 +27,7 @@ * */ -#include CONFIG +#include BOARD_CONFIG #include "gyro.h" #include "std.h" #include "adc.h" diff --git a/sw/airborne/pprz_algebra.h b/sw/airborne/math/pprz_algebra.h similarity index 93% rename from sw/airborne/pprz_algebra.h rename to sw/airborne/math/pprz_algebra.h index 7aa65b9352..9b8388d392 100644 --- a/sw/airborne/pprz_algebra.h +++ b/sw/airborne/math/pprz_algebra.h @@ -148,10 +148,10 @@ } /* _v = Bound(_v, _min, _max) */ -#define VECT3_STRIM(_v, _min, _max) { \ - (_v).x = (_v).x < _min ? _min : (_v).x > _max ? _max : (_v).x; \ - (_v).y = (_v).y < _min ? _min : (_v).y > _max ? _max : (_v).y; \ - (_v).z = (_v).z < _min ? _min : (_v).z > _max ? _max : (_v).z; \ +#define VECT3_STRIM(_v, _min, _max) { \ + (_v).x = (_v).x < _min ? _min : (_v).x > _max ? _max : (_v).x; \ + (_v).y = (_v).y < _min ? _min : (_v).y > _max ? _max : (_v).y; \ + (_v).z = (_v).z < _min ? _min : (_v).z > _max ? _max : (_v).z; \ } /* */ @@ -162,12 +162,20 @@ } /* */ -#define VECT3_BOUND_CUBE(_v, _min, _max) { \ +#define VECT3_BOUND_CUBE(_v, _min, _max) { \ if ((_v).x > (_max)) (_v).x = (_max); else if ((_v).x < (_min)) (_v).x = (_min); \ if ((_v).y > (_max)) (_v).y = (_max); else if ((_v).y < (_min)) (_v).y = (_min); \ if ((_v).z > (_max)) (_v).z = (_max); else if ((_v).z < (_min)) (_v).z = (_min); \ } +/* */ +#define VECT3_BOUND_BOX(_v, _v_min, _v_max) { \ + if ((_v).x > (_v_max.x)) (_v).x = (_v_max.x); else if ((_v).x < (_v_min.x)) (_v).x = (_v_min.x); \ + if ((_v).y > (_v_max.y)) (_v).y = (_v_max.y); else if ((_v).y < (_v_min.y)) (_v).y = (_v_min.z); \ + if ((_v).z > (_v_max.y)) (_v).z = (_v_max.z); else if ((_v).z < (_v_min.z)) (_v).z = (_v_min.z); \ + } + + /* * Euler angles @@ -214,6 +222,12 @@ (_eo).psi = (_ei).psi / (_s); \ } +/* _v = Bound(_v, _min, _max) */ +#define EULERS_BOUND_CUBE(_v, _min, _max) { \ + (_v).phi = (_v).phi < _min ? _min : (_v).phi > _max ? _max : (_v).phi; \ + (_v).theta = (_v).theta < _min ? _min : (_v).theta > _max ? _max : (_v).theta; \ + (_v).psi = (_v).psi < _min ? _min : (_v).psi > _max ? _max : (_v).psi; \ + } /* * Rates diff --git a/sw/airborne/pprz_algebra_double.h b/sw/airborne/math/pprz_algebra_double.h similarity index 100% rename from sw/airborne/pprz_algebra_double.h rename to sw/airborne/math/pprz_algebra_double.h diff --git a/sw/airborne/pprz_algebra_float.h b/sw/airborne/math/pprz_algebra_float.h similarity index 100% rename from sw/airborne/pprz_algebra_float.h rename to sw/airborne/math/pprz_algebra_float.h diff --git a/sw/airborne/pprz_algebra_int.h b/sw/airborne/math/pprz_algebra_int.h similarity index 90% rename from sw/airborne/pprz_algebra_int.h rename to sw/airborne/math/pprz_algebra_int.h index 142ca662f2..500205b927 100644 --- a/sw/airborne/pprz_algebra_int.h +++ b/sw/airborne/math/pprz_algebra_int.h @@ -27,10 +27,8 @@ #include "std.h" -#include "pprz_algebra.h" - -// TO BE REMOVED -#include "booz_geometry_int.h" +#include "math/pprz_algebra.h" +#include "math/pprz_trig_int.h" struct Uint16Vect3 { uint16_t x; @@ -45,7 +43,16 @@ struct Int16Vect3 { }; #define INT32_POS_FRAC 8 +#define INT32_POS_OF_CM 2.56 +#define INT32_POS_OF_CM_NUM 64 +#define INT32_POS_OF_CM_DEN 25 + #define INT32_SPEED_FRAC 19 +#define INT32_SPEED_OF_CM_S 5242.88 +#define INT32_SPEED_OF_CM_S_NUM 41943 +#define INT32_SPEED_OF_CM_S_DEN 8 + +#define INT32_ACCEL_FRAC 10 struct Int32Vect2 { int32_t x; int32_t y; @@ -77,6 +84,18 @@ struct Int32Quat { #define INT32_RAD_OF_DEG(_deg) (int32_t)(((int64_t)_deg * 14964008)/857374503) #define INT32_DEG_OF_RAD(_rad) (int32_t)(((int64_t)_rad * 857374503)/14964008) +#define INT32_ANGLE_NORMALIZE(_a) { \ + while (_a > INT32_ANGLE_PI) _a -= INT32_ANGLE_2_PI; \ + while (_a < -INT32_ANGLE_PI) _a += INT32_ANGLE_2_PI; \ + } + + +struct Int16Eulers { + int16_t phi; + int16_t theta; + int16_t psi; +}; + struct Int32Eulers { int32_t phi; int32_t theta; @@ -129,13 +148,15 @@ struct Int64Vect3 { #define POS_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_POS_FRAC) #define SPEED_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_SPEED_FRAC) #define SPEED_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_SPEED_FRAC) +#define ACCEL_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_ACCEL_FRAC) +#define ACCEL_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_ACCEL_FRAC) #define INT_MULT_RSHIFT(_a, _b, _r) (((_a)*(_b))>>(_r)) /* * Dimension 2 Vectors */ -#define INT_VECT2_ZERO(_o) VECT2_ASSIGN(_o, 0, 0) +#define INT_VECT2_ZERO(_v) VECT2_ASSIGN(_v, 0, 0) #define INT32_VECT2_NORM(n, v) { \ int32_t n2 = v.x*v.x + v.y*v.y; \ @@ -156,8 +177,8 @@ struct Int64Vect3 { * Dimension 3 Vectors */ -#define INT_VECT3_ZERO(_o) VECT3_ASSIGN(_o, 0, 0, 0) -#define INT32_VECT3_ZERO(_o) VECT3_ASSIGN(_o, 0, 0, 0) +#define INT_VECT3_ZERO(_v) VECT3_ASSIGN(_v, 0, 0, 0) +#define INT32_VECT3_ZERO(_v) VECT3_ASSIGN(_v, 0, 0, 0) #define INT32_VECT3_COPY(_o, _i) { \ _o.x = _i.x; \ @@ -249,6 +270,12 @@ struct Int64Vect3 { (_vb).z = ( (_m_a2b).m[6]*(_va).x + (_m_a2b).m[7]*(_va).y + (_m_a2b).m[8]*(_va).z)>>INT32_TRIG_FRAC; \ } +#define INT32_RMAT_TRANSP_VMULT(_vb, _m_b2a, _va) { \ + (_vb).x = ( (_m_b2a).m[0]*(_va).x + (_m_b2a).m[3]*(_va).y + (_m_b2a).m[6]*(_va).z)>>INT32_TRIG_FRAC; \ + (_vb).y = ( (_m_b2a).m[1]*(_va).x + (_m_b2a).m[4]*(_va).y + (_m_b2a).m[7]*(_va).z)>>INT32_TRIG_FRAC; \ + (_vb).z = ( (_m_b2a).m[2]*(_va).x + (_m_b2a).m[5]*(_va).y + (_m_b2a).m[8]*(_va).z)>>INT32_TRIG_FRAC; \ + } + #define INT32_RMAT_TRANSP_RATEMULT(_vb, _m_b2a, _va) { \ (_vb).p = ( (_m_b2a).m[0]*(_va).p + (_m_b2a).m[3]*(_va).q + (_m_b2a).m[6]*(_va).r)>>INT32_TRIG_FRAC; \ @@ -273,23 +300,23 @@ struct Int64Vect3 { const int32_t one = TRIG_BFP_OF_REAL( 1); \ const int32_t two = TRIG_BFP_OF_REAL( 2); \ /* dcm00 = 1.0 - 2.*( qy2 + qz2 ); */ \ - _rm.m[0] = one - INT_MULT_RSHIFT( two, (qy2+qz2), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[0] = one - INT_MULT_RSHIFT( two, (qy2+qz2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm01 = 2.*( qxqy + qiqz ); */ \ - _rm.m[1] = INT_MULT_RSHIFT( two, (qxqy+qiqz), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[1] = INT_MULT_RSHIFT( two, (qxqy+qiqz), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm02 = 2.*( qxqz - qiqy ); */ \ - _rm.m[2] = INT_MULT_RSHIFT( two, (qxqz-qiqy), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[2] = INT_MULT_RSHIFT( two, (qxqz-qiqy), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm10 = 2.*( qxqy - qiqz ); */ \ - _rm.m[3] = INT_MULT_RSHIFT( two, (qxqy-qiqz), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[3] = INT_MULT_RSHIFT( two, (qxqy-qiqz), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm11 = 1.0 - 2.*(qx2+qz2); */ \ - _rm.m[4] = one - INT_MULT_RSHIFT( two, (qx2+qz2), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[4] = one - INT_MULT_RSHIFT( two, (qx2+qz2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm12 = 2.*( qyqz + qiqx ); */ \ - _rm.m[5] = INT_MULT_RSHIFT( two, (qyqz+qiqx), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[5] = INT_MULT_RSHIFT( two, (qyqz+qiqx), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm20 = 2.*( qxqz + qiqy ); */ \ - _rm.m[6] = INT_MULT_RSHIFT( two, (qxqz+qiqy), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[6] = INT_MULT_RSHIFT( two, (qxqz+qiqy), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm21 = 2.*( qyqz - qiqx ); */ \ - _rm.m[7] = INT_MULT_RSHIFT( two, (qyqz-qiqx), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[7] = INT_MULT_RSHIFT( two, (qyqz-qiqx), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm22 = 1.0 - 2.*( qx2 + qy2 ); */ \ - _rm.m[8] = one - INT_MULT_RSHIFT( two, (qx2+qy2), ITRIG_RES+INT32_QUAT_FRAC-ITRIG_RES); \ + _rm.m[8] = one - INT_MULT_RSHIFT( two, (qx2+qy2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ } /* @@ -301,18 +328,18 @@ struct Int64Vect3 { #define INT32_RMAT_OF_EULERS_321(_rm, _e) { \ \ int32_t sphi; \ - BOOZ_ISIN(sphi, (_e).phi); \ + PPRZ_ITRIG_SIN(sphi, (_e).phi); \ int32_t cphi; \ - BOOZ_ICOS(cphi, (_e).phi); \ + PPRZ_ITRIG_COS(cphi, (_e).phi); \ int32_t stheta; \ - BOOZ_ISIN(stheta, (_e).theta); \ + PPRZ_ITRIG_SIN(stheta, (_e).theta); \ int32_t ctheta; \ - BOOZ_ICOS(ctheta, (_e).theta); \ + PPRZ_ITRIG_COS(ctheta, (_e).theta); \ int32_t spsi; \ - BOOZ_ISIN(spsi, (_e).psi); \ + PPRZ_ITRIG_SIN(spsi, (_e).psi); \ int32_t cpsi; \ - BOOZ_ICOS(cpsi, (_e).psi); \ - \ + PPRZ_ITRIG_COS(cpsi, (_e).psi); \ + \ int32_t ctheta_cpsi = INT_MULT_RSHIFT(ctheta, cpsi, INT32_TRIG_FRAC); \ int32_t ctheta_spsi = INT_MULT_RSHIFT(ctheta, spsi, INT32_TRIG_FRAC); \ int32_t cphi_spsi = INT_MULT_RSHIFT(cphi, spsi, INT32_TRIG_FRAC); \ @@ -345,17 +372,17 @@ struct Int64Vect3 { #define INT32_RMAT_OF_EULERS_312(_rm, _e) { \ \ int32_t sphi; \ - BOOZ_ISIN(sphi, (_e).phi); \ + PPRZ_ITRIG_SIN(sphi, (_e).phi); \ int32_t cphi; \ - BOOZ_ICOS(cphi, (_e).phi); \ + PPRZ_ITRIG_COS(cphi, (_e).phi); \ int32_t stheta; \ - BOOZ_ISIN(stheta, (_e).theta); \ + PPRZ_ITRIG_SIN(stheta, (_e).theta); \ int32_t ctheta; \ - BOOZ_ICOS(ctheta, (_e).theta); \ + PPRZ_ITRIG_COS(ctheta, (_e).theta); \ int32_t spsi; \ - BOOZ_ISIN(spsi, (_e).psi); \ + PPRZ_ITRIG_SIN(spsi, (_e).psi); \ int32_t cpsi; \ - BOOZ_ICOS(cpsi, (_e).psi); \ + PPRZ_ITRIG_COS(cpsi, (_e).psi); \ \ \ int32_t stheta_spsi = INT_MULT_RSHIFT(stheta, spsi, INT32_TRIG_FRAC); \ @@ -485,17 +512,17 @@ struct Int64Vect3 { const int32_t psi2 = (_e).psi / 2; \ \ int32_t s_phi2; \ - BOOZ_ISIN(s_phi2, phi2); \ + PPRZ_ITRIG_SIN(s_phi2, phi2); \ int32_t c_phi2; \ - BOOZ_ICOS(c_phi2, phi2); \ + PPRZ_ITRIG_COS(c_phi2, phi2); \ int32_t s_theta2; \ - BOOZ_ISIN(s_theta2, theta2); \ + PPRZ_ITRIG_SIN(s_theta2, theta2); \ int32_t c_theta2; \ - BOOZ_ICOS(c_theta2, theta2); \ + PPRZ_ITRIG_COS(c_theta2, theta2); \ int32_t s_psi2; \ - BOOZ_ISIN(s_psi2, psi2); \ + PPRZ_ITRIG_SIN(s_psi2, psi2); \ int32_t c_psi2; \ - BOOZ_ICOS(c_psi2, psi2); \ + PPRZ_ITRIG_COS(c_psi2, psi2); \ \ int32_t c_th_c_ps = INT_MULT_RSHIFT(c_theta2, c_psi2, INT32_TRIG_FRAC); \ int32_t c_th_s_ps = INT_MULT_RSHIFT(c_theta2, s_psi2, INT32_TRIG_FRAC); \ diff --git a/sw/airborne/pprz_geodetic.h b/sw/airborne/math/pprz_geodetic.h similarity index 100% rename from sw/airborne/pprz_geodetic.h rename to sw/airborne/math/pprz_geodetic.h diff --git a/sw/airborne/pprz_geodetic_double.c b/sw/airborne/math/pprz_geodetic_double.c similarity index 100% rename from sw/airborne/pprz_geodetic_double.c rename to sw/airborne/math/pprz_geodetic_double.c diff --git a/sw/airborne/pprz_geodetic_double.h b/sw/airborne/math/pprz_geodetic_double.h similarity index 100% rename from sw/airborne/pprz_geodetic_double.h rename to sw/airborne/math/pprz_geodetic_double.h diff --git a/sw/airborne/pprz_geodetic_float.c b/sw/airborne/math/pprz_geodetic_float.c similarity index 100% rename from sw/airborne/pprz_geodetic_float.c rename to sw/airborne/math/pprz_geodetic_float.c diff --git a/sw/airborne/pprz_geodetic_float.h b/sw/airborne/math/pprz_geodetic_float.h similarity index 100% rename from sw/airborne/pprz_geodetic_float.h rename to sw/airborne/math/pprz_geodetic_float.h diff --git a/sw/airborne/pprz_geodetic_int.c b/sw/airborne/math/pprz_geodetic_int.c similarity index 75% rename from sw/airborne/pprz_geodetic_int.c rename to sw/airborne/math/pprz_geodetic_int.c index a7db3fd70d..a5fa5a993b 100644 --- a/sw/airborne/pprz_geodetic_int.c +++ b/sw/airborne/math/pprz_geodetic_int.c @@ -1,9 +1,28 @@ +/* + * $Id$ + * + * Copyright (C) 2008-2009 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. + */ + #include "pprz_geodetic_int.h" - - #include "pprz_algebra_int.h" -#include "booz_geometry_int.h" -#include "booz_geometry_mixed.h" #define CM_OF_M(_m) ((_m)*1e2) #define M_OF_CM(_cm) ((_cm)/1e2) @@ -20,15 +39,15 @@ void ltp_def_from_ecef_i(struct LtpDef_i* def, struct EcefCoor_i* ecef) { /* store the rotation matrix */ #if 1 - int32_t sin_lat = rint(BOOZ_INT_OF_FLOAT(sinf(RAD_OF_EM7RAD((float)def->lla.lat)), HIGH_RES_TRIG_FRAC)); - int32_t cos_lat = rint(BOOZ_INT_OF_FLOAT(cosf(RAD_OF_EM7RAD((float)def->lla.lat)), HIGH_RES_TRIG_FRAC)); - int32_t sin_lon = rint(BOOZ_INT_OF_FLOAT(sinf(RAD_OF_EM7RAD((float)def->lla.lon)), HIGH_RES_TRIG_FRAC)); - int32_t cos_lon = rint(BOOZ_INT_OF_FLOAT(cosf(RAD_OF_EM7RAD((float)def->lla.lon)), HIGH_RES_TRIG_FRAC)); + int32_t sin_lat = rint(BFP_OF_REAL(sinf(RAD_OF_EM7RAD((float)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lat = rint(BFP_OF_REAL(cosf(RAD_OF_EM7RAD((float)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t sin_lon = rint(BFP_OF_REAL(sinf(RAD_OF_EM7RAD((float)def->lla.lon)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lon = rint(BFP_OF_REAL(cosf(RAD_OF_EM7RAD((float)def->lla.lon)), HIGH_RES_TRIG_FRAC)); #else - int32_t sin_lat = rint(BOOZ_INT_OF_FLOAT(sin(RAD_OF_EM7RAD((double)def->lla.lat)), HIGH_RES_TRIG_FRAC)); - int32_t cos_lat = rint(BOOZ_INT_OF_FLOAT(cos(RAD_OF_EM7RAD((double)def->lla.lat)), HIGH_RES_TRIG_FRAC)); - int32_t sin_lon = rint(BOOZ_INT_OF_FLOAT(sin(RAD_OF_EM7RAD((double)def->lla.lon)), HIGH_RES_TRIG_FRAC)); - int32_t cos_lon = rint(BOOZ_INT_OF_FLOAT(cos(RAD_OF_EM7RAD((double)def->lla.lon)), HIGH_RES_TRIG_FRAC)); + int32_t sin_lat = rint(BFP_OF_REAL(sin(RAD_OF_EM7RAD((double)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lat = rint(BFP_OF_REAL(cos(RAD_OF_EM7RAD((double)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t sin_lon = rint(BFP_OF_REAL(sin(RAD_OF_EM7RAD((double)def->lla.lon)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lon = rint(BFP_OF_REAL(cos(RAD_OF_EM7RAD((double)def->lla.lon)), HIGH_RES_TRIG_FRAC)); #endif diff --git a/sw/airborne/pprz_geodetic_int.h b/sw/airborne/math/pprz_geodetic_int.h similarity index 100% rename from sw/airborne/pprz_geodetic_int.h rename to sw/airborne/math/pprz_geodetic_int.h diff --git a/sw/airborne/booz/booz_trig_int.c b/sw/airborne/math/pprz_trig_int.c similarity index 99% rename from sw/airborne/booz/booz_trig_int.c rename to sw/airborne/math/pprz_trig_int.c index f01e69f497..015910194a 100644 --- a/sw/airborne/booz/booz_trig_int.c +++ b/sw/airborne/math/pprz_trig_int.c @@ -21,9 +21,9 @@ * Boston, MA 02111-1307, USA. */ -#include "booz_trig_int.h" +#include "pprz_trig_int.h" -BOOZ_TRIG_CONST int16_t booz_trig_int[6434] = { 0, +PPRZ_TRIG_CONST int16_t pprz_trig_int[6434] = { 0, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 183, 187, 191, diff --git a/sw/airborne/booz/booz_trig_int.h b/sw/airborne/math/pprz_trig_int.h similarity index 62% rename from sw/airborne/booz/booz_trig_int.h rename to sw/airborne/math/pprz_trig_int.h index 78cd415e5a..354e07911b 100644 --- a/sw/airborne/booz/booz_trig_int.h +++ b/sw/airborne/math/pprz_trig_int.h @@ -21,18 +21,38 @@ * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ_TRIG_INT_H -#define BOOZ_TRIG_INT_H +#ifndef PPRZ_TRIG_INT_H +#define PPRZ_TRIG_INT_H #include "std.h" +#include "math/pprz_algebra_int.h" /* Allow makefile to define BOOZ_TRIG_CONST in case we want to make the trig tables const and store them in flash. Otherwise use the empty string and keep the table in RAM. */ -#ifndef BOOZ_TRIG_CONST -#define BOOZ_TRIG_CONST +#ifndef PPRZ_TRIG_CONST +#define PPRZ_TRIG_CONST #endif -extern BOOZ_TRIG_CONST int16_t booz_trig_int[]; -#endif /* BOOZ_TRIG_INT_H */ +extern PPRZ_TRIG_CONST int16_t pprz_trig_int[]; + + + +#define PPRZ_ITRIG_SIN(_s, _a) { \ + int32_t an = _a; \ + INT32_ANGLE_NORMALIZE(an); \ + if (an > INT32_ANGLE_PI_2) an = INT32_ANGLE_PI - an; \ + else if (an < -INT32_ANGLE_PI_2) an = -INT32_ANGLE_PI - an; \ + if (an >= 0) _s = pprz_trig_int[an]; \ + else _s = -pprz_trig_int[-an]; \ + } + + +#define PPRZ_ITRIG_COS(_c, _a) { \ + PPRZ_ITRIG_SIN( _c, _a + INT32_ANGLE_PI_2); \ + } + + + +#endif /* PPRZ_TRIG_INT_H */ diff --git a/sw/airborne/stm32/init_hw.h b/sw/airborne/stm32/init_hw.h index c5bc02ccce..e612d031d1 100644 --- a/sw/airborne/stm32/init_hw.h +++ b/sw/airborne/stm32/init_hw.h @@ -31,12 +31,12 @@ #define INIT_HW_H #include -#include CONFIG #include #include #include #include +#include BOARD_CONFIG #ifdef PERIPHERALS_AUTO_INIT #ifdef USE_LED diff --git a/sw/airborne/stm32/led_hw.h b/sw/airborne/stm32/led_hw.h index f155f05038..29cef11dfa 100644 --- a/sw/airborne/stm32/led_hw.h +++ b/sw/airborne/stm32/led_hw.h @@ -24,9 +24,11 @@ #ifndef LED_HW_H #define LED_HW_H -#include CONFIG #include #include + +#include BOARD_CONFIG + #include "std.h" #define _LED_GPIO_CLK(i) i diff --git a/sw/airborne/sys_time.h b/sw/airborne/sys_time.h index a3d2e4cffc..9e61935da0 100644 --- a/sw/airborne/sys_time.h +++ b/sw/airborne/sys_time.h @@ -31,7 +31,7 @@ #define SYS_TIME_H #include -#include CONFIG +#include BOARD_CONFIG extern uint16_t cpu_time_sec; diff --git a/sw/airborne/test/Makefile b/sw/airborne/test/Makefile index 7852477202..632eaff2d9 100644 --- a/sw/airborne/test/Makefile +++ b/sw/airborne/test/Makefile @@ -4,10 +4,10 @@ CC = gcc CFLAGS = -I.. -I../../include -I../booz -I../../booz -DFLOAT_T=double -Wall LDFLAGS = -lm -test_geodetic: test_geodetic.c ../pprz_geodetic_float.c ../pprz_geodetic_int.c ../booz/booz_trig_int.c +test_geodetic: test_geodetic.c ../math/pprz_geodetic_float.c ../math/pprz_geodetic_int.c ../math/pprz_trig_int.c $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -test_algebra: test_algebra.c ../booz/booz_trig_int.c +test_algebra: test_algebra.c ../math/pprz_trig_int.c $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) test_sqrt: test_sqrt.c @@ -20,4 +20,4 @@ test_fmul: test_fmul.c $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) clean: - rm -f *~ test_geodetic *.exe + rm -f *~ test_geodetic test_algebra *.exe diff --git a/sw/airborne/test/test_algebra.c b/sw/airborne/test/test_algebra.c index f0bdefb91c..720500cf9d 100644 --- a/sw/airborne/test/test_algebra.c +++ b/sw/airborne/test/test_algebra.c @@ -4,9 +4,9 @@ #include "std.h" -#include "pprz_algebra_float.h" -#include "pprz_algebra_double.h" -#include "pprz_algebra_int.h" +#include "math/pprz_algebra_float.h" +#include "math/pprz_algebra_double.h" +#include "math/pprz_algebra_int.h" #include "pprz_algebra_print.h" static void test_1(void); diff --git a/sw/airborne/test/test_geodetic.c b/sw/airborne/test/test_geodetic.c index a771c572da..ab3f5c66e0 100644 --- a/sw/airborne/test/test_geodetic.c +++ b/sw/airborne/test/test_geodetic.c @@ -8,9 +8,10 @@ #include "std.h" -#include "pprz_algebra_float.h" -#include "pprz_geodetic_float.h" -#include "pprz_geodetic_int.h" +#include "math/pprz_algebra_float.h" +#include "math/pprz_geodetic_double.h" +#include "math/pprz_geodetic_float.h" +#include "math/pprz_geodetic_int.h" //#define DEBUG 1 @@ -59,7 +60,7 @@ static void test_floats(void) { struct EcefCoor_f my_ecef_point = ref_coor; struct EnuCoor_f my_enu_point; - enu_of_ecef_pos_f(&my_enu_point, <p_def, &my_ecef_point); + enu_of_ecef_point_f(&my_enu_point, <p_def, &my_ecef_point); printf("ecef to enu : (%f,%f,%f) -> (%f,%f,%f)\n", my_ecef_point.x, my_ecef_point.y, my_ecef_point.z, @@ -67,7 +68,6 @@ static void test_floats(void) { printf("\n"); } -#include "booz_geometry_mixed.h" static void test_enu_of_ecef_int(void) { @@ -99,7 +99,7 @@ static void test_enu_of_ecef_int(void) { struct EcefCoor_f my_ecef_point_f = ref_coor_f; VECT3_ADD(my_ecef_point_f, offset); struct EnuCoor_f my_enu_point_f; - enu_of_ecef_pos_f(&my_enu_point_f, <p_def_f, &my_ecef_point_f); + enu_of_ecef_point_f(&my_enu_point_f, <p_def_f, &my_ecef_point_f); #if DEBUG printf("ecef to enu float : (%.02f,%.02f,%.02f) -> (%.02f,%.02f,%.02f)\n", my_ecef_point_f.x, my_ecef_point_f.y, my_ecef_point_f.z, @@ -110,7 +110,7 @@ static void test_enu_of_ecef_int(void) { rint(CM_OF_M(my_ecef_point_f.y)), rint(CM_OF_M(my_ecef_point_f.z))};; struct EnuCoor_i my_enu_point_i; - enu_of_ecef_pos_i(&my_enu_point_i, <p_def_i, &my_ecef_point_i); + enu_of_ecef_point_i(&my_enu_point_i, <p_def_i, &my_ecef_point_i); #if DEBUG // printf("def->ecef (%d,%d,%d)\n", ltp_def_i.ecef.x, ltp_def_i.ecef.y, ltp_def_i.ecef.z); @@ -151,27 +151,28 @@ static void test_enu_of_ecef_int(void) { void test_ned_to_ecef_to_ned( void ) { - struct EcefCoor_f ref_coor = { 4624497.0 , 116475.0, 4376563.0}; +#if 0 + struct EcefCoor_d ref_coor = { 4624497.0 , 116475.0, 4376563.0}; printf("ecef0 : (%.02f,%.02f,%.02f)\n", ref_coor.x, ref_coor.y, ref_coor.z); - struct LtpDef_f ltp_def; - ltp_def_from_ecef_f(<p_def, &ref_coor); + struct LtpDef_d ltp_def; + ltp_def_from_ecef_d(<p_def, &ref_coor); - struct EcefCoor_f ecef_p1 = ref_coor; - struct NedCoor_f ned_p1; - ned_of_ecef_pos_f(&ned_p1, <p_def, &ecef_p1); + struct EcefCoor_d ecef_p1 = ref_coor; + struct NedCoor_d ned_p1; + ned_of_ecef_point_d(&ned_p1, <p_def, &ecef_p1); printf("ecef to ned : (%f,%f,%f) -> (%f,%f,%f)\n", ecef_p1.x, ecef_p1.y, ecef_p1.z, ned_p1.x, ned_p1.y, ned_p1.z ); - struct EcefCoor_f ecef_p2; - ecef_of_ned_pos_f(&ecef_p2, <p_def, &ned_p1); + struct EcefCoor_d ecef_p2; + ecef_of_ned_point_d(&ecef_p2, <p_def, &ned_p1); printf("ned to ecef : (%f,%f,%f) -> (%f,%f,%f)\n", ned_p1.x, ned_p1.y, ned_p1.z, ecef_p2.x, ecef_p2.y, ecef_p2.z); printf("\n"); - +#endif } @@ -191,19 +192,20 @@ void test_enu_to_ecef_to_enu( void ) { struct EcefCoor_f ecef_p1 = ref_coor; struct EnuCoor_f enu_p1; - enu_of_ecef_pos_f(&enu_p1, <p_def, &ecef_p1); + enu_of_ecef_point_f(&enu_p1, <p_def, &ecef_p1); printf("ecef to enu : (%f,%f,%f) -> (%f,%f,%f)\n", ecef_p1.x, ecef_p1.y, ecef_p1.z, enu_p1.x, enu_p1.y, enu_p1.z ); +#if 0 struct EcefCoor_f ecef_p2; - ecef_of_enu_pos_f(&ecef_p2, <p_def, &enu_p1); + ecef_of_enu_point_f(&ecef_p2, <p_def, &enu_p1); printf("enu to ecef : (%f,%f,%f) -> (%f,%f,%f)\n", enu_p1.x, enu_p1.y, enu_p1.z, ecef_p2.x, ecef_p2.y, ecef_p2.z); printf("\n"); - +#endif } diff --git a/sw/simulator/nps_autopilot.c b/sw/simulator/nps_autopilot.c index c6b33b755b..184c0f18c1 100644 --- a/sw/simulator/nps_autopilot.c +++ b/sw/simulator/nps_autopilot.c @@ -1,3 +1,26 @@ +/* + * $Id$ + * + * Copyright (C) 2009 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. + */ + #include "nps_autopilot.h" #include "booz2_main.h"