diff --git a/conf/airframes/CDW/ChimuLisaFw.xml b/conf/airframes/CDW/ChimuLisaFw.xml index 3c7ed0971c..71aac60c58 100644 --- a/conf/airframes/CDW/ChimuLisaFw.xml +++ b/conf/airframes/CDW/ChimuLisaFw.xml @@ -154,12 +154,6 @@ -
- - -
- -
diff --git a/conf/airframes/CDW/debug_i2c.xml b/conf/airframes/CDW/debug_i2c.xml new file mode 100644 index 0000000000..db334d1447 --- /dev/null +++ b/conf/airframes/CDW/debug_i2c.xml @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ +
+ + +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/conf/airframes/ENAC/fixed-wing/drops.xml b/conf/airframes/ENAC/fixed-wing/drops.xml index 289865ccae..f77fb115e8 100644 --- a/conf/airframes/ENAC/fixed-wing/drops.xml +++ b/conf/airframes/ENAC/fixed-wing/drops.xml @@ -210,10 +210,6 @@ on
-
- - -
CONFIG = \"tiny_2_1.h\" diff --git a/conf/airframes/ENAC/fixed-wing/slayer2.xml b/conf/airframes/ENAC/fixed-wing/slayer2.xml index 70068d7f41..46d368aea6 100644 --- a/conf/airframes/ENAC/fixed-wing/slayer2.xml +++ b/conf/airframes/ENAC/fixed-wing/slayer2.xml @@ -188,13 +188,6 @@ - - include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile diff --git a/conf/airframes/ENAC/fixed-wing/weasel.xml b/conf/airframes/ENAC/fixed-wing/weasel.xml index 827a08b350..d911596b30 100644 --- a/conf/airframes/ENAC/fixed-wing/weasel.xml +++ b/conf/airframes/ENAC/fixed-wing/weasel.xml @@ -10,6 +10,8 @@ + + @@ -40,6 +42,8 @@ + + diff --git a/conf/airframes/ENAC/malolo_sim.xml b/conf/airframes/ENAC/malolo_sim.xml index 4d8c4f4cde..468d45916c 100644 --- a/conf/airframes/ENAC/malolo_sim.xml +++ b/conf/airframes/ENAC/malolo_sim.xml @@ -192,14 +192,7 @@ - - -
diff --git a/conf/airframes/ENAC/quadrotor/blender.xml b/conf/airframes/ENAC/quadrotor/blender.xml index 4a23ddd7b6..c1682f0477 100644 --- a/conf/airframes/ENAC/quadrotor/blender.xml +++ b/conf/airframes/ENAC/quadrotor/blender.xml @@ -228,7 +228,6 @@
-
diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index db0e515bc6..345cdd9621 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -193,9 +193,7 @@
- -
diff --git a/conf/airframes/ENAC/quadrotor/g1_vision.xml b/conf/airframes/ENAC/quadrotor/g1_vision.xml index 001a712d4e..521d7c87ce 100644 --- a/conf/airframes/ENAC/quadrotor/g1_vision.xml +++ b/conf/airframes/ENAC/quadrotor/g1_vision.xml @@ -174,9 +174,7 @@
- -
diff --git a/conf/airframes/ENAC/quadrotor/mkk1-vision.xml b/conf/airframes/ENAC/quadrotor/mkk1-vision.xml index b81cb8ac65..03f539783f 100644 --- a/conf/airframes/ENAC/quadrotor/mkk1-vision.xml +++ b/conf/airframes/ENAC/quadrotor/mkk1-vision.xml @@ -207,9 +207,7 @@
- -
diff --git a/conf/airframes/ENAC/quadrotor/mkk1.xml b/conf/airframes/ENAC/quadrotor/mkk1.xml index c44af4ea1c..ee3afbe1c7 100644 --- a/conf/airframes/ENAC/quadrotor/mkk1.xml +++ b/conf/airframes/ENAC/quadrotor/mkk1.xml @@ -227,9 +227,7 @@
- -
diff --git a/conf/airframes/ENAC/quadrotor/nova1.xml b/conf/airframes/ENAC/quadrotor/nova1.xml index 1d75a0ee58..a3a05aadf2 100644 --- a/conf/airframes/ENAC/quadrotor/nova1.xml +++ b/conf/airframes/ENAC/quadrotor/nova1.xml @@ -198,9 +198,7 @@
- -
diff --git a/conf/airframes/NoVa_L.xml b/conf/airframes/NoVa_L.xml index 4a8f9b0a4c..e4a4e36889 100644 --- a/conf/airframes/NoVa_L.xml +++ b/conf/airframes/NoVa_L.xml @@ -102,9 +102,7 @@
- -
diff --git a/conf/airframes/PPZUAV/fixed-wing/kalscott_easystar.xml b/conf/airframes/PPZUAV/fixed-wing/kalscott_easystar.xml deleted file mode 100644 index 67c5017f07..0000000000 --- a/conf/airframes/PPZUAV/fixed-wing/kalscott_easystar.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
- - - - -
- -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
- - - - - - - - -
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - - -
- -
- - -
- -
- - - - - - - - -
- -
- - - - - -
- -
- - -
- - -CONFIG = \"tiny_2_1_1.h\" - -# Target configuration -include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile - -FLASH_MODE=IAP - -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 -DUSE_MODULES -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 - -# Servo driver -ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c - -# Radio configuration -ap.CFLAGS += -DRADIO_CONTROL -ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c - -# Telemetry configuration -ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c - -ap.CFLAGS += -DINTER_MCU -ap.srcs += inter_mcu.c - -# ADC configuration -ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -ap.srcs += $(SRC_ARCH)/adc_hw.c - -# USE_GPS configuration -ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG -DGPS_LED=2 -ap.srcs += gps_ubx.c gps.c latlong.c - -ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -ap.srcs += infrared.c estimator.c - -# Control loops -ap.CFLAGS += -DNAV -DLOITER_TRIM -ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c - -ap.srcs += subsystems/navigation/nav_line.c -ap.srcs += subsystems/navigation/nav_survey_rectangle.c - - - -# Config for SITL simulation -include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DLOITER_TRIM -DALT_KALMAN -DUSE_MODULES -sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c - - - diff --git a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml index 9e05da1098..830c2d2260 100644 --- a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml +++ b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml @@ -178,9 +178,7 @@
- -
diff --git a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml index 7c4c1e8e8a..750ad110ec 100644 --- a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml +++ b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml @@ -196,9 +196,7 @@
- -
diff --git a/conf/airframes/Poine/booz2_a1.xml b/conf/airframes/Poine/booz2_a1.xml index f90a486d32..30358596c0 100644 --- a/conf/airframes/Poine/booz2_a1.xml +++ b/conf/airframes/Poine/booz2_a1.xml @@ -169,9 +169,7 @@
- -
diff --git a/conf/airframes/Poine/booz2_a1p.xml b/conf/airframes/Poine/booz2_a1p.xml index e0903b41a3..4dc659aa53 100644 --- a/conf/airframes/Poine/booz2_a1p.xml +++ b/conf/airframes/Poine/booz2_a1p.xml @@ -173,9 +173,7 @@
- -
diff --git a/conf/airframes/Poine/booz2_a7.xml b/conf/airframes/Poine/booz2_a7.xml index fe7afd9476..895ac7e33b 100644 --- a/conf/airframes/Poine/booz2_a7.xml +++ b/conf/airframes/Poine/booz2_a7.xml @@ -74,9 +74,7 @@
- -
diff --git a/conf/airframes/Poine/booz2_a8.xml b/conf/airframes/Poine/booz2_a8.xml index 46ad289276..c98fbb24cb 100644 --- a/conf/airframes/Poine/booz2_a8.xml +++ b/conf/airframes/Poine/booz2_a8.xml @@ -182,9 +182,7 @@
- -
diff --git a/conf/airframes/Poine/easy_glider1.xml b/conf/airframes/Poine/easy_glider1.xml index 25b6298d47..44791bc811 100644 --- a/conf/airframes/Poine/easy_glider1.xml +++ b/conf/airframes/Poine/easy_glider1.xml @@ -76,7 +76,6 @@
-
diff --git a/conf/airframes/Poine/h_hex.xml b/conf/airframes/Poine/h_hex.xml index db9214e262..44d7782f14 100644 --- a/conf/airframes/Poine/h_hex.xml +++ b/conf/airframes/Poine/h_hex.xml @@ -76,9 +76,7 @@
- -
diff --git a/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml b/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml index 9286e53a56..96d2fce242 100644 --- a/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml +++ b/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml @@ -1,6 +1,6 @@ - diff --git a/conf/airframes/TU_Delft/MicrojetCDW.xml b/conf/airframes/TU_Delft/MicrojetCDW.xml index fc038e964e..a778aeb5ff 100644 --- a/conf/airframes/TU_Delft/MicrojetCDW.xml +++ b/conf/airframes/TU_Delft/MicrojetCDW.xml @@ -184,11 +184,6 @@ -
- - -
- diff --git a/conf/airframes/TU_Delft/Trip50A.xml b/conf/airframes/TU_Delft/Trip50A.xml index 857bb271f7..a37429aeb5 100644 --- a/conf/airframes/TU_Delft/Trip50A.xml +++ b/conf/airframes/TU_Delft/Trip50A.xml @@ -231,13 +231,6 @@ inline static void h_ctl_roll_loop( void ) { - -
diff --git a/conf/airframes/TU_Delft/Trip50B.xml b/conf/airframes/TU_Delft/Trip50B.xml index dab375a875..a95827c333 100644 --- a/conf/airframes/TU_Delft/Trip50B.xml +++ b/conf/airframes/TU_Delft/Trip50B.xml @@ -236,13 +236,6 @@ inline static void h_ctl_roll_loop( void ) { - -
diff --git a/conf/airframes/TU_Delft/holiday50.xml b/conf/airframes/TU_Delft/holiday50.xml index c60b9f2e2f..5a2724fbdb 100644 --- a/conf/airframes/TU_Delft/holiday50.xml +++ b/conf/airframes/TU_Delft/holiday50.xml @@ -231,13 +231,6 @@ inline static void h_ctl_roll_loop( void ) { - -
diff --git a/conf/airframes/TU_Delft/skywalkerfiber.xml b/conf/airframes/TU_Delft/skywalkerfiber.xml index 000a3c7c25..a962c1f226 100644 --- a/conf/airframes/TU_Delft/skywalkerfiber.xml +++ b/conf/airframes/TU_Delft/skywalkerfiber.xml @@ -1,6 +1,6 @@ - + + @@ -85,7 +85,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -250,7 +250,7 @@ - +
@@ -272,7 +272,7 @@
- +
diff --git a/conf/airframes/UofAdelaide/A1000_BOOZ.xml b/conf/airframes/UofAdelaide/A1000_BOOZ.xml index 54dbc672ca..1a5c088e1c 100644 --- a/conf/airframes/UofAdelaide/A1000_BOOZ.xml +++ b/conf/airframes/UofAdelaide/A1000_BOOZ.xml @@ -242,9 +242,7 @@ second attempt
- -
diff --git a/conf/airframes/UofAdelaide/A1000_LISA.xml b/conf/airframes/UofAdelaide/A1000_LISA.xml index 5493c8d8c5..f48128a609 100644 --- a/conf/airframes/UofAdelaide/A1000_LISA.xml +++ b/conf/airframes/UofAdelaide/A1000_LISA.xml @@ -74,9 +74,7 @@
- -
diff --git a/conf/airframes/UofAdelaide/A1000_NOVA.xml b/conf/airframes/UofAdelaide/A1000_NOVA.xml index 761350b2c9..bcef6ccc71 100644 --- a/conf/airframes/UofAdelaide/A1000_NOVA.xml +++ b/conf/airframes/UofAdelaide/A1000_NOVA.xml @@ -204,10 +204,7 @@
- - -
diff --git a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml index e2189844cc..e00eac3141 100644 --- a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml +++ b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml @@ -204,10 +204,7 @@
- - -
diff --git a/conf/airframes/UofAdelaide/booz2_a1000.xml b/conf/airframes/UofAdelaide/booz2_a1000.xml index bc0f5c553a..3ea1b957b4 100755 --- a/conf/airframes/UofAdelaide/booz2_a1000.xml +++ b/conf/airframes/UofAdelaide/booz2_a1000.xml @@ -244,9 +244,7 @@ second attempt
- -
diff --git a/conf/airframes/UofAdelaide/lisa_a1000.xml b/conf/airframes/UofAdelaide/lisa_a1000.xml index 71ddb6413d..bf9899187e 100644 --- a/conf/airframes/UofAdelaide/lisa_a1000.xml +++ b/conf/airframes/UofAdelaide/lisa_a1000.xml @@ -71,9 +71,7 @@
- -
diff --git a/conf/airframes/booz2_flixr.xml b/conf/airframes/booz2_flixr.xml index 6aa4a7ee6d..f21e10ec05 100644 --- a/conf/airframes/booz2_flixr.xml +++ b/conf/airframes/booz2_flixr.xml @@ -212,7 +212,6 @@
- diff --git a/conf/airframes/booz2_ppzuav.xml b/conf/airframes/booz2_ppzuav.xml index 0961e3f73f..2078e7e7de 100644 --- a/conf/airframes/booz2_ppzuav.xml +++ b/conf/airframes/booz2_ppzuav.xml @@ -179,10 +179,7 @@
- - -
diff --git a/conf/airframes/easy_glider_example.xml b/conf/airframes/easy_glider_example.xml index 4981d5fb8f..9bbb174eab 100644 --- a/conf/airframes/easy_glider_example.xml +++ b/conf/airframes/easy_glider_example.xml @@ -69,7 +69,6 @@
-
diff --git a/conf/airframes/easystar_example.xml b/conf/airframes/easystar_example.xml index be87c02e21..58c5b0c2e6 100644 --- a/conf/airframes/easystar_example.xml +++ b/conf/airframes/easystar_example.xml @@ -164,9 +164,4 @@
-
- - -
- diff --git a/conf/airframes/esden/jt_lisam.xml b/conf/airframes/esden/jt_lisam.xml index cd1948f709..2634c9c3f1 100644 --- a/conf/airframes/esden/jt_lisam.xml +++ b/conf/airframes/esden/jt_lisam.xml @@ -65,9 +65,7 @@
- -
diff --git a/conf/airframes/esden/lisa_asctec.xml b/conf/airframes/esden/lisa_asctec.xml index b2a8c41b02..50c0a66790 100644 --- a/conf/airframes/esden/lisa_asctec.xml +++ b/conf/airframes/esden/lisa_asctec.xml @@ -81,9 +81,7 @@
- -
diff --git a/conf/airframes/esden/lisa_asctec_aspirin.xml b/conf/airframes/esden/lisa_asctec_aspirin.xml index 67bad41320..66ff357bd1 100644 --- a/conf/airframes/esden/lisa_asctec_aspirin.xml +++ b/conf/airframes/esden/lisa_asctec_aspirin.xml @@ -81,9 +81,7 @@
- -
diff --git a/conf/airframes/esden/lisa_m_pwm.xml b/conf/airframes/esden/lisa_m_pwm.xml index c7aa63004b..57a8443969 100644 --- a/conf/airframes/esden/lisa_m_pwm.xml +++ b/conf/airframes/esden/lisa_m_pwm.xml @@ -95,9 +95,7 @@
- -
diff --git a/conf/airframes/esden/lisa_pwm_aspirin.xml b/conf/airframes/esden/lisa_pwm_aspirin.xml index 86ecf78dd6..2a6bea0249 100644 --- a/conf/airframes/esden/lisa_pwm_aspirin.xml +++ b/conf/airframes/esden/lisa_pwm_aspirin.xml @@ -69,9 +69,7 @@
- -
diff --git a/conf/airframes/esden/synerani_4B.xml b/conf/airframes/esden/synerani_4B.xml index 7b6827b926..acf1337d7d 100644 --- a/conf/airframes/esden/synerani_4B.xml +++ b/conf/airframes/esden/synerani_4B.xml @@ -72,9 +72,7 @@
- -
diff --git a/conf/airframes/mentor_tum.xml b/conf/airframes/mentor_tum.xml index e7b0e7d831..df5cd797f7 100644 --- a/conf/airframes/mentor_tum.xml +++ b/conf/airframes/mentor_tum.xml @@ -208,13 +208,6 @@ - -
diff --git a/conf/airframes/microjet_example.xml b/conf/airframes/microjet_example.xml index 1a8fab6878..fc8249b7c7 100644 --- a/conf/airframes/microjet_example.xml +++ b/conf/airframes/microjet_example.xml @@ -159,12 +159,6 @@
-
- - -
- -
diff --git a/conf/airframes/mm/extra/press_t.xml b/conf/airframes/mm/extra/press_t.xml index 59172f27d6..3073f74886 100644 --- a/conf/airframes/mm/extra/press_t.xml +++ b/conf/airframes/mm/extra/press_t.xml @@ -174,11 +174,6 @@ -
- -
- -
diff --git a/conf/airframes/mm/extra/probe_t.xml b/conf/airframes/mm/extra/probe_t.xml index 37fd3601e2..01811ad4a0 100644 --- a/conf/airframes/mm/extra/probe_t.xml +++ b/conf/airframes/mm/extra/probe_t.xml @@ -194,11 +194,6 @@ -
- -
- -
diff --git a/conf/airframes/mm/extra/rctx.xml b/conf/airframes/mm/extra/rctx.xml index 6001747f16..ad468276c0 100644 --- a/conf/airframes/mm/extra/rctx.xml +++ b/conf/airframes/mm/extra/rctx.xml @@ -12,18 +12,12 @@
-
-
- - -
- CONFIG = \"tiny_2_1.h\" diff --git a/conf/airframes/mm/fixed-wing/funjeteth1.xml b/conf/airframes/mm/fixed-wing/funjeteth1.xml index d0b9b75d5b..a65932583a 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth1.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth1.xml @@ -170,11 +170,6 @@ - - -
- -
diff --git a/conf/airframes/mm/fixed-wing/funjeteth2.xml b/conf/airframes/mm/fixed-wing/funjeteth2.xml index fdd700591a..ab569e0540 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth2.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth2.xml @@ -171,11 +171,6 @@ -
- -
- -
diff --git a/conf/airframes/mm/fixed-wing/funjetfmi1.xml b/conf/airframes/mm/fixed-wing/funjetfmi1.xml index 4941da26af..bd39cefb89 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi1.xml @@ -169,11 +169,6 @@ -
- -
- -
diff --git a/conf/airframes/mm/fixed-wing/funjetfmi2.xml b/conf/airframes/mm/fixed-wing/funjetfmi2.xml index c076a05477..6dd3339263 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi2.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi2.xml @@ -170,11 +170,6 @@
-
- - -
-
diff --git a/conf/airframes/mm/fixed-wing/funjetfmi3.xml b/conf/airframes/mm/fixed-wing/funjetfmi3.xml index 564d49b045..a0bac989c2 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi3.xml @@ -168,11 +168,6 @@ - - -
- -
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi1.xml b/conf/airframes/mm/fixed-wing/funjetgfi1.xml index 402d3614d4..e6f10ef4eb 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi1.xml @@ -168,11 +168,6 @@
-
- - -
-
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi3.xml b/conf/airframes/mm/fixed-wing/funjetgfi3.xml index 3647cddfc0..b90be3eb3b 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi3.xml @@ -79,7 +79,6 @@
- @@ -186,11 +185,6 @@
-
- - -
- include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile diff --git a/conf/airframes/mm/fixed-wing/funjetgfi4.xml b/conf/airframes/mm/fixed-wing/funjetgfi4.xml index dd100932fc..e7326bcfe3 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi4.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi4.xml @@ -78,7 +78,6 @@
- @@ -169,11 +168,6 @@
-
- - -
-
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi5.xml b/conf/airframes/mm/fixed-wing/funjetgfi5.xml index 0731f33820..c2417140f0 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi5.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi5.xml @@ -168,11 +168,6 @@ - - -
- -
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi6.xml b/conf/airframes/mm/fixed-wing/funjetgfi6.xml index e4f607d80b..ba7035b60e 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi6.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi6.xml @@ -170,11 +170,6 @@
-
- - -
-
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi7.xml b/conf/airframes/mm/fixed-wing/funjetgfi7.xml index be48d15148..2938facb71 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi7.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi7.xml @@ -170,11 +170,6 @@ -
- - -
-
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi9.xml b/conf/airframes/mm/fixed-wing/funjetgfi9.xml index aaacc21284..4a10711d40 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi9.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi9.xml @@ -168,11 +168,6 @@ - - -
- -
diff --git a/conf/airframes/mm/fixed-wing/funjetmm2.xml b/conf/airframes/mm/fixed-wing/funjetmm2.xml index 03a942f097..61b63da805 100644 --- a/conf/airframes/mm/fixed-wing/funjetmm2.xml +++ b/conf/airframes/mm/fixed-wing/funjetmm2.xml @@ -176,11 +176,6 @@
-
- - -
-
diff --git a/conf/airframes/mm/fixed-wing/miniwing.xml b/conf/airframes/mm/fixed-wing/miniwing.xml index f4c41ba9f6..18705e7491 100644 --- a/conf/airframes/mm/fixed-wing/miniwing.xml +++ b/conf/airframes/mm/fixed-wing/miniwing.xml @@ -168,11 +168,6 @@ -
- - -
- CONFIG = \"tiny_2_1.h\" diff --git a/conf/airframes/mm/fixed-wing/slowfast.xml b/conf/airframes/mm/fixed-wing/slowfast.xml index 67c62bfef9..a0e58b5052 100644 --- a/conf/airframes/mm/fixed-wing/slowfast.xml +++ b/conf/airframes/mm/fixed-wing/slowfast.xml @@ -217,11 +217,6 @@ -
- - -
- CONFIG = \"tiny_2_1.h\" diff --git a/conf/airframes/mm/hangar/black_one.xml b/conf/airframes/mm/hangar/black_one.xml index be9796bf51..d7e6d06287 100644 --- a/conf/airframes/mm/hangar/black_one.xml +++ b/conf/airframes/mm/hangar/black_one.xml @@ -103,7 +103,6 @@
- diff --git a/conf/airframes/mm/hangar/glass_one1.xml b/conf/airframes/mm/hangar/glass_one1.xml index e8bf7ff754..82b92dedd8 100644 --- a/conf/airframes/mm/hangar/glass_one1.xml +++ b/conf/airframes/mm/hangar/glass_one1.xml @@ -91,7 +91,6 @@
- diff --git a/conf/airframes/mm/hangar/glass_one2.xml b/conf/airframes/mm/hangar/glass_one2.xml index 2aa4cd4511..3848eadc40 100644 --- a/conf/airframes/mm/hangar/glass_one2.xml +++ b/conf/airframes/mm/hangar/glass_one2.xml @@ -74,7 +74,6 @@
- diff --git a/conf/airframes/mm/hangar/glass_one3.xml b/conf/airframes/mm/hangar/glass_one3.xml index 64c7c610fb..834100ad89 100644 --- a/conf/airframes/mm/hangar/glass_one3.xml +++ b/conf/airframes/mm/hangar/glass_one3.xml @@ -92,7 +92,6 @@
- diff --git a/conf/airframes/mm/hangar/mac06a.xml b/conf/airframes/mm/hangar/mac06a.xml index 932014cd75..63dae8793b 100644 --- a/conf/airframes/mm/hangar/mac06a.xml +++ b/conf/airframes/mm/hangar/mac06a.xml @@ -89,7 +89,6 @@
- diff --git a/conf/airframes/mm/hangar/red_one.xml b/conf/airframes/mm/hangar/red_one.xml index 887601c421..2c074fcba9 100644 --- a/conf/airframes/mm/hangar/red_one.xml +++ b/conf/airframes/mm/hangar/red_one.xml @@ -96,7 +96,6 @@
- diff --git a/conf/airframes/mm/rotor/qmk1.xml b/conf/airframes/mm/rotor/qmk1.xml index a210004acd..c414b3214b 100644 --- a/conf/airframes/mm/rotor/qmk1.xml +++ b/conf/airframes/mm/rotor/qmk1.xml @@ -81,9 +81,7 @@
- -
diff --git a/conf/airframes/Paul/minimag1.xml b/conf/airframes/obsolete/minimag1.xml similarity index 100% rename from conf/airframes/Paul/minimag1.xml rename to conf/airframes/obsolete/minimag1.xml diff --git a/conf/airframes/LAAS/mmlaas_N1_carto_cam.xml b/conf/airframes/obsolete/mmlaas_N1_carto_cam.xml similarity index 100% rename from conf/airframes/LAAS/mmlaas_N1_carto_cam.xml rename to conf/airframes/obsolete/mmlaas_N1_carto_cam.xml diff --git a/conf/airframes/test_i2c.xml b/conf/airframes/test_i2c.xml index 53bf60d7dd..b7546315d2 100644 --- a/conf/airframes/test_i2c.xml +++ b/conf/airframes/test_i2c.xml @@ -1,10 +1,5 @@ -
- - -
- ARCH=lpc21 diff --git a/conf/autopilot/rotorcraft.makefile b/conf/autopilot/rotorcraft.makefile index 27a2e084cf..c8e4b37502 100644 --- a/conf/autopilot/rotorcraft.makefile +++ b/conf/autopilot/rotorcraft.makefile @@ -101,8 +101,9 @@ ap.srcs += mcu_periph/uart.c ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # I2C is needed for speed controllers and barometers on lisa -ap.srcs += mcu_periph/i2c.c -ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c +ifeq ($(TARGET), ap) + include $(CFG_SHARED)/i2c_select.makefile +endif ap.srcs += $(SRC_FIRMWARE)/commands.c diff --git a/conf/autopilot/subsystems/fixedwing/autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile index 51d94b56a0..25687b7151 100644 --- a/conf/autopilot/subsystems/fixedwing/autopilot.makefile +++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile @@ -87,8 +87,7 @@ $(TARGET).srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_ # # I2C # -$(TARGET).srcs += mcu_periph/i2c.c -$(TARGET).srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c +include $(CFG_SHARED)/i2c_select.makefile ###################################################################### ## diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile index e31987e894..45fd6aaf54 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile @@ -15,6 +15,4 @@ endif # Simulator sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=11 -sim.srcs += mcu_periph/i2c.c -sim.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile index a55d0e4313..5922e9c2ce 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile @@ -51,5 +51,3 @@ endif sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(MKK_I2C_SCL_TIME) -DI2C0_SCLH=$(MKK_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c1 -sim.srcs += mcu_periph/i2c.c -sim.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_skiron.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_skiron.makefile index 1db87848db..b46487f875 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_skiron.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_skiron.makefile @@ -50,6 +50,4 @@ endif sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_skiron.c sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c0 -sim.srcs += mcu_periph/i2c.c -sim.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c diff --git a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile index 491150d7eb..00b92d675e 100644 --- a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile +++ b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile @@ -63,6 +63,11 @@ sim.srcs += firmwares/rotorcraft/main.c sim.srcs += mcu.c sim.srcs += $(SRC_ARCH)/mcu_arch.c +ifeq ($(TARGET), sim) + include $(CFG_SHARED)/i2c_select.makefile +endif + + sim.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' # -DTIME_LED=1 #sim.CFLAGS += -DUSE_LED diff --git a/conf/autopilot/subsystems/shared/i2c_select.makefile b/conf/autopilot/subsystems/shared/i2c_select.makefile new file mode 100644 index 0000000000..75241931af --- /dev/null +++ b/conf/autopilot/subsystems/shared/i2c_select.makefile @@ -0,0 +1,12 @@ +#generic i2c driver + +# TODO: this file was created to be able to select different driver files. Once 1 driver is selected as the best others can be removed including this file + +$(TARGET).srcs += mcu_periph/i2c.c +ifeq ($(ARCH), stm32) +$(TARGET).srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c +#$(TARGET).srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.rewritten.c +else +$(TARGET).srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c +endif + diff --git a/conf/modules/airspeed_ads1114.xml b/conf/modules/airspeed_ads1114.xml new file mode 100644 index 0000000000..b75f51a072 --- /dev/null +++ b/conf/modules/airspeed_ads1114.xml @@ -0,0 +1,18 @@ + + + + + +
+ +
+ + + + + + + +
+ + diff --git a/conf/modules/baro_board.xml b/conf/modules/baro_board.xml index 32ce2698ad..4ace2ff541 100644 --- a/conf/modules/baro_board.xml +++ b/conf/modules/baro_board.xml @@ -12,6 +12,7 @@ +
diff --git a/conf/modules/gps_ubx_ucenter.xml b/conf/modules/gps_ubx_ucenter.xml index 063d4bc866..883ecbd0d8 100644 --- a/conf/modules/gps_ubx_ucenter.xml +++ b/conf/modules/gps_ubx_ucenter.xml @@ -7,7 +7,7 @@ -configures all the messages, and the rates -automatic baudrate detection - Warning: you still need to tell the driver + Warning: you still need to tell the driver a) which paparazzi uart you use b) inside the ublox gps there are also many ports. the tiny/ppzgps use ublox_internal_port1 but if for instance you use a LS-SAM or I2C device you need to configure: diff --git a/conf/modules/i2c_abuse_test.xml b/conf/modules/i2c_abuse_test.xml new file mode 100644 index 0000000000..c8c7039eb4 --- /dev/null +++ b/conf/modules/i2c_abuse_test.xml @@ -0,0 +1,15 @@ + + + +
+ +
+ + + + + + + +
+ diff --git a/sw/airborne/arch/stm32/sys_time_hw.h b/sw/airborne/arch/stm32/sys_time_hw.h index cc74f25896..9d88a69d8c 100644 --- a/sw/airborne/arch/stm32/sys_time_hw.h +++ b/sw/airborne/arch/stm32/sys_time_hw.h @@ -75,7 +75,7 @@ static inline void sys_time_usleep(uint32_t us) { { if (sys_time_period_elapsed) ready--; sys_time_periodic(); - } + } } #endif /* SYS_TIME_HW_H */ diff --git a/sw/airborne/boards/umarim/baro_board.c b/sw/airborne/boards/umarim/baro_board.c index c5f2a97398..a63fa457f1 100644 --- a/sw/airborne/boards/umarim/baro_board.c +++ b/sw/airborne/boards/umarim/baro_board.c @@ -55,7 +55,7 @@ void baro_init( void ) { ads1114_init(); baro.status = BS_UNINITIALIZED; baro.absolute = 0; - baro.differential = 0; /* not handled on this board */ + baro.differential = 0; /* not handled on this board, use extra module (ex: airspeed_ads1114) */ #ifdef USE_BARO_AS_ALTIMETER baro_alt = 0.; baro_alt_offset = 0.; @@ -66,7 +66,7 @@ void baro_init( void ) { void baro_periodic( void ) { #ifdef USE_BARO_AS_ALTIMETER - if (baro.status == BS_UNINITIALIZED && ads1114_data_available) { + if (baro.status == BS_UNINITIALIZED && BARO_ABS_ADS.data_available) { // IIR filter to compute an initial offset baro_alt_offset = (OFFSET_FILTER * baro_alt_offset + (float)baro.absolute) / (OFFSET_FILTER + 1); // decrease init counter @@ -75,7 +75,7 @@ void baro_periodic( void ) { } #endif // Read the ADC - ads1114_read(); + ads1114_read(&BARO_ABS_ADS); } void baro_downlink_raw( void ) diff --git a/sw/airborne/boards/umarim/baro_board.h b/sw/airborne/boards/umarim/baro_board.h index 26d27b29d2..e74b52c77d 100644 --- a/sw/airborne/boards/umarim/baro_board.h +++ b/sw/airborne/boards/umarim/baro_board.h @@ -35,6 +35,11 @@ #define BARO_FILTER_GAIN 5 +/* There is no differential pressure on the board but + * it can be available from an external sensor + * */ +#define DIFF_FILTER_GAIN 5 + #ifdef USE_BARO_AS_ALTIMETER extern float baro_alt; extern float baro_alt_offset; @@ -43,15 +48,45 @@ extern float baro_alt_offset; extern void baro_downlink_raw( void ); +#define BARO_ABS_ADS ads1114_1 + +#define BaroAbs(_ads, _handler) { \ + if (_ads.data_available) { \ + baro.absolute = (baro.absolute + BARO_FILTER_GAIN*Ads1114GetValue(_ads)) / (BARO_FILTER_GAIN+1); \ + if (baro.status == BS_RUNNING) { \ + _handler(); \ + _ads.data_available = FALSE; \ + } \ + } \ +} + +#ifndef BaroDiff // Allow custom redefinition ? + +#if USE_BARO_DIFF + +#ifndef BARO_DIFF_ADS +#define BARO_DIFF_ADS ads1114_2 +#endif +#define BaroDiff(_ads, _handler) { \ + if (_ads.data_available) { \ + baro.differential = (baro.differential + DIFF_FILTER_GAIN*Ads1114GetValue(_ads)) / (DIFF_FILTER_GAIN+1); \ + if (baro.status == BS_RUNNING) { \ + _handler(); \ + _ads.data_available = FALSE; \ + } \ + } \ +} + +#else // Not using differential with ADS1114 +#define BaroDiff(_a, _h) {} +#endif + +#endif // ifndef BaroDiff + #define BaroEvent(_b_abs_handler, _b_diff_handler) { \ Ads1114Event(); \ - if (ads1114_data_available) { \ - baro.absolute = (baro.absolute + BARO_FILTER_GAIN*Ads1114GetValue()) / (BARO_FILTER_GAIN+1); \ - if (baro.status == BS_RUNNING) { \ - _b_abs_handler(); \ - ads1114_data_available = FALSE; \ - } \ - } \ + BaroAbs(BARO_ABS_ADS,_b_abs_handler); \ + BaroDiff(BARO_DIFF_ADS,_b_diff_handler); \ } #endif // BOARDS_UMARIM_BARO_H diff --git a/sw/airborne/firmwares/fixedwing/main_fbw.c b/sw/airborne/firmwares/fixedwing/main_fbw.c index 40dcf65a58..7989e57433 100644 --- a/sw/airborne/firmwares/fixedwing/main_fbw.c +++ b/sw/airborne/firmwares/fixedwing/main_fbw.c @@ -48,11 +48,6 @@ #include "link_mcu.h" #endif -#ifdef MILLIAMP_PER_PERCENT -#error "deprecated MILLIAMP_PER_PERCENT --> Please use MILLIAMP_AT_FULL_THROTTLE" -#endif - - uint8_t fbw_mode; #include "inter_mcu.h" diff --git a/sw/airborne/modules/benchmark/i2c_abuse_test.c b/sw/airborne/modules/benchmark/i2c_abuse_test.c new file mode 100644 index 0000000000..7a9b078caa --- /dev/null +++ b/sw/airborne/modules/benchmark/i2c_abuse_test.c @@ -0,0 +1,245 @@ +/* + * $Id$ + * + * Copyright (C) 2009 Gautier Hattenberger + * + * 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 "i2c_abuse_test.h" +#include "led.h" +#include "mcu_periph/i2c.h" + +struct i2c_transaction i2c_test1; +struct i2c_transaction i2c_test2; + +uint8_t i2c_abuse_test_counter = 0; +uint16_t i2c_abuse_test_bitrate = 1000; + +void init_i2c_abuse_test(void) { + //LED_INIT(DEMO_MODULE_LED); + //LED_OFF(DEMO_MODULE_LED); + + i2c_test1.status = I2CTransSuccess; + i2c_test1.slave_addr = 0x3C; + + i2c_abuse_test_counter = 0; + i2c_abuse_test_bitrate = 10000; + + i2c_test2.status = I2CTransSuccess; + +} + +static void i2c_abuse_send_transaction(uint8_t _init) +{ + + i2c_test1.slave_addr = 0x3C; + i2c_test1.len_w = 0; + i2c_test1.len_r = 0; + + switch (_init) + { + case 1: + i2c_test1.type = I2CTransTx; + i2c_test1.buf[0] = 0x00; // set to rate to 50Hz + i2c_test1.buf[1] = 0x00 | (0x06 << 2); + i2c_test1.buf[2] = 0x01<<5; + i2c_test1.buf[3] = 0x00; + i2c_test1.len_w = 4; + i2c_submit(&i2c2,&i2c_test1); + break; + case 2: + i2c_test1.type = I2CTransTx; + i2c_test1.buf[0] = 0x01; // set to gain to 1 Gauss + i2c_test1.buf[1] = 0x01<<5; + i2c_test1.len_w = 2; + i2c_submit(&i2c2,&i2c_test1); + break; + case 3: + i2c_test1.type = I2CTransTx; + i2c_test1.buf[0] = 0x00; // set to continuous mode + i2c_test1.len_w = 1; + i2c_submit(&i2c2,&i2c_test1); + break; + case 4: + i2c_test1.type = I2CTransRx; + i2c_test1.len_r = 1; + i2c_submit(&i2c2,&i2c_test1); + break; + case 5: + i2c_test1.type = I2CTransRx; + i2c_test1.len_r = 2; + i2c_submit(&i2c2,&i2c_test1); + break; + case 6: + i2c_test1.type = I2CTransRx; + i2c_test1.len_r = 3; + i2c_submit(&i2c2,&i2c_test1); + break; + case 7: + i2c_test1.type = I2CTransRx; + i2c_test1.len_r = 4; + i2c_submit(&i2c2,&i2c_test1); + break; + case 8: + i2c_test1.type = I2CTransRx; + i2c_test1.len_r = 5; + i2c_submit(&i2c2,&i2c_test1); + break; + case 9: + // bad addr + i2c_test1.slave_addr = 0x3C + 2; + i2c_test1.type = I2CTransTx; + i2c_test1.len_w = 1; + i2c_submit(&i2c2,&i2c_test1); + break; + case 10: + // 2 consecutive + i2c_test1.type = I2CTransTx; + i2c_test1.buf[0] = 0x00; // set to continuous mode + i2c_test1.len_w = 1; + i2c_submit(&i2c2,&i2c_test1); + break; + case 11: + i2c_test1.slave_addr = 0x3C; + i2c_test1.type = I2CTransTxRx; + i2c_test1.len_r = 1; + i2c_test1.len_w = 1; + i2c_test1.buf[0] = 0x03; + i2c_submit(&i2c2, &i2c_test1); + break; + case 12: + i2c_test1.slave_addr = 0x3C; + i2c_test1.type = I2CTransTxRx; + i2c_test1.len_r = 2; + i2c_test1.len_w = 1; + i2c_test1.buf[0] = 0x03; + i2c_submit(&i2c2, &i2c_test1); + break; + case 13: + i2c_test1.slave_addr = 0x3C; + i2c_test1.type = I2CTransTxRx; + i2c_test1.len_r = 3; + i2c_test1.len_w = 1; + i2c_test1.buf[0] = 0x03; + i2c_submit(&i2c2, &i2c_test1); + break; + case 14: + i2c_test1.slave_addr = 0x3C; + i2c_test1.type = I2CTransTxRx; + i2c_test1.len_r = 4; + i2c_test1.len_w = 1; + i2c_test1.buf[0] = 0x03; + i2c_submit(&i2c2, &i2c_test1); + break; + case 15: + i2c_test1.slave_addr = 0x3C; + i2c_test1.type = I2CTransTxRx; + i2c_test1.len_r = 4; + i2c_test1.len_w = 2; + i2c_test1.buf[0] = 0x03; + i2c_submit(&i2c2, &i2c_test1); + break; + default: + i2c_test1.slave_addr = 0x3C; + i2c_test1.type = I2CTransTxRx; + i2c_test1.len_r = 5; + i2c_test1.len_w = 1; + i2c_test1.buf[0] = 0x03; + i2c_submit(&i2c2, &i2c_test1); + } +} + + +void event_i2c_abuse_test(void) +{ + if (i2c_idle(&i2c1)) + { + LED_ON(7); // green = idle + LED_OFF(6); + } + else + { + LED_ON(6); // red = busy + LED_OFF(7); + } + + if (i2c_idle(&i2c2)) + { + LED_ON(5); // green = idle + LED_OFF(4); + } + else + { + LED_ON(4); // red = busy + LED_OFF(5); + } + + // Wait for I2C transaction object to be released by the I2C driver before changing anything + if ((i2c_abuse_test_counter < 12) && (i2c_abuse_test_counter > 3)) + { + if ((i2c_test2.status == I2CTransFailed) || (i2c_test2.status == I2CTransSuccess)) + { + //i2c_test2.slave_addr = 0x90; + i2c_test2.type = I2CTransRx; + i2c_test2.slave_addr = 0x92; + i2c_test2.len_r = 2; + i2c_submit(&i2c2,&i2c_test2); + } + } + + + if ((i2c_test1.status == I2CTransFailed) || (i2c_test1.status == I2CTransSuccess)) + { + if (i2c_abuse_test_counter < 16) + { + i2c_abuse_test_counter++; + } + else + { + // wait until ready: + if (i2c_idle(&i2c2)) + { + i2c_abuse_test_counter = 1; + + i2c_setbitrate(&i2c2, i2c_abuse_test_bitrate); + + i2c_abuse_test_bitrate += 17000; + if (i2c_abuse_test_bitrate > 500000) + { + i2c_abuse_test_bitrate -= 500000; + } + LED_TOGGLE(4); + } + } + + if (i2c_abuse_test_counter < 16) + { + i2c_abuse_send_transaction( i2c_abuse_test_counter ); + LED_TOGGLE(5); + } + } +} + +void periodic_50Hz_i2c_abuse_test(void) { + // LED_TOGGLE(DEMO_MODULE_LED); +} + + + diff --git a/sw/airborne/modules/benchmark/i2c_abuse_test.h b/sw/airborne/modules/benchmark/i2c_abuse_test.h new file mode 100644 index 0000000000..e6e7b0634a --- /dev/null +++ b/sw/airborne/modules/benchmark/i2c_abuse_test.h @@ -0,0 +1,52 @@ +/* + * $Id$ + * + * Copyright (C) 2009 C. De Wagter + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +/** \file I2C_ABUSE_TEST_module.h + * + * Total I2C Abuse: + * + * -all transaction types: T1 T2 T3 T4 R1 R2 R3 R4 T1R1 T2R1 T1R2 T1R3 T1R4 T1R5 T2R5 + * -all bitrates: 1k (way too slow) to 1M (way to fast) + * -occasional Short circuit (simulate bus capacitance or EMI errors) + * -variable bus load: from empty to full stack + * + * -Connect LED to MosFet that pulls-down the SCL and SDA lines + */ + +#ifndef I2C_ABUSE_TEST_MODULE_H +#define I2C_ABUSE_TEST_MODULE_H + +#ifndef I2C_ABUSE_SHORT_SCL_LED +#define I2C_ABUSE_SHORT_SCL_LED 2 +#endif + +#ifndef I2C_ABUSE_SHORT_SDA_LED +#define I2C_ABUSE_SHORT_SDA_LED 3 +#endif + +void init_i2c_abuse_test(void); +void event_i2c_abuse_test(void); +void periodic_50Hz_i2c_abuse_test(void); + +#endif diff --git a/sw/airborne/modules/gps/gps_ubx_ucenter.c b/sw/airborne/modules/gps/gps_ubx_ucenter.c index 7abe6112bb..aa56a5395c 100644 --- a/sw/airborne/modules/gps/gps_ubx_ucenter.c +++ b/sw/airborne/modules/gps/gps_ubx_ucenter.c @@ -325,14 +325,14 @@ static inline void gps_ubx_ucenter_enable_msg(uint8_t class, uint8_t id, uint8_t #undef GOT_PAYLOAD #include "downlink.h" -static bool_t gps_ubx_ucenter_configure(uint8_t nr) +static bool_t gps_ubx_ucenter_configure(uint8_t nr) { // Store the reply of the last configuration step and reset if (nr < GPS_UBX_UCENTER_CONFIG_STEPS) gps_ubx_ucenter.replies[nr] = gps_ubx_ucenter.reply; - + gps_ubx_ucenter.reply = GPS_UBX_UCENTER_REPLY_NONE; - + switch (nr) { case 0: UbxSend_MON_GET_VER(); @@ -355,7 +355,7 @@ static bool_t gps_ubx_ucenter_configure(uint8_t nr) DOWNLINK_SEND_DEBUG(DefaultChannel,6,gps_ubx_ucenter.replies); ////////////////////////////////// - // Actual configuration start + // Actual configuration start // Use old baudrate to issue a baudrate change command gps_ubx_ucenter_config_port(); diff --git a/sw/airborne/modules/gps/gps_ubx_ucenter.h b/sw/airborne/modules/gps/gps_ubx_ucenter.h index 50f4300afc..a14e149297 100644 --- a/sw/airborne/modules/gps/gps_ubx_ucenter.h +++ b/sw/airborne/modules/gps/gps_ubx_ucenter.h @@ -30,7 +30,7 @@ /** U-Center Variables */ #define GPS_UBX_UCENTER_CONFIG_STEPS 17 -struct gps_ubx_ucenter_struct +struct gps_ubx_ucenter_struct { uint8_t status; uint8_t reply; diff --git a/sw/airborne/modules/ins/ins_chimu_spi.c b/sw/airborne/modules/ins/ins_chimu_spi.c index 87dd9f519f..1c4c0e0b81 100644 --- a/sw/airborne/modules/ins/ins_chimu_spi.c +++ b/sw/airborne/modules/ins/ins_chimu_spi.c @@ -108,9 +108,9 @@ void ins_periodic_task( void ) float gps_speed = 0; - if (gps.fix == GPS_FIX_3D) + if (gps.fix == GPS_FIX_3D) { - gps_speed = gps.speed_3d/100.; + gps_speed = gps.speed_3d/100.; } gps_speed = FloatSwap(gps_speed); diff --git a/sw/airborne/modules/sensors/airspeed_ads1114.c b/sw/airborne/modules/sensors/airspeed_ads1114.c new file mode 100644 index 0000000000..b472beb4ad --- /dev/null +++ b/sw/airborne/modules/sensors/airspeed_ads1114.c @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 Gautier Hattenberger + * + * 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. + * + */ + +/* + * Module to extend the baro_board module with an airspeed sensor + * Init and event functions are handled by the baro_board module + */ + +#include "modules/sensors/airspeed_ads1114.h" +#include "subsystems/sensors/baro.h" +#include "baro_board.h" + +void airspeed_periodic(void) { + ads1114_read(&BARO_DIFF_ADS); +} + + + diff --git a/sw/airborne/modules/sensors/airspeed_ads1114.h b/sw/airborne/modules/sensors/airspeed_ads1114.h new file mode 100644 index 0000000000..90bbce344f --- /dev/null +++ b/sw/airborne/modules/sensors/airspeed_ads1114.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 Gautier Hattenberger + * + * 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. + * + */ + +/* + * Module to extend the baro_board module with an airspeed sensor + */ + +#ifndef AIRSPEED_ADS1114_H +#define AIRSPEED_ADS1114_H + +extern void airspeed_periodic(void); + +#endif diff --git a/sw/airborne/peripherals/ads1114.c b/sw/airborne/peripherals/ads1114.c index 0c91981d26..3e6950ea71 100644 --- a/sw/airborne/peripherals/ads1114.c +++ b/sw/airborne/peripherals/ads1114.c @@ -27,28 +27,44 @@ #include "peripherals/ads1114.h" -struct i2c_transaction ads1114_trans; - -bool_t ads1114_config_done; -bool_t ads1114_data_available; +#if USE_ADS1114_1 +struct ads1114_periph ads1114_1; +#endif +#if USE_ADS1114_2 +struct ads1114_periph ads1114_2; +#endif void ads1114_init( void ) { - /* configure the ads1114 */ - ads1114_trans.buf[0] = ADS1114_POINTER_CONFIG_REG; - ads1114_trans.buf[1] = ADS1114_CONFIG_MSB; - ads1114_trans.buf[2] = ADS1114_CONFIG_LSB; - I2CTransmit(ADS1114_I2C_DEVICE, ads1114_trans, ADS1114_I2C_ADDR, 3); - ads1114_config_done = FALSE; - ads1114_data_available = FALSE; + /* configure the ads1114_1 */ +#if USE_ADS1114_1 + ads1114_1.i2c_addr = ADS1114_1_I2C_ADDR; + ads1114_1.trans.buf[0] = ADS1114_POINTER_CONFIG_REG; + ads1114_1.trans.buf[1] = ADS1114_1_CONFIG_MSB; + ads1114_1.trans.buf[2] = ADS1114_1_CONFIG_LSB; + I2CTransmit(ADS1114_I2C_DEVICE, ads1114_1.trans, ADS1114_1_I2C_ADDR, 3); + ads1114_1.config_done = FALSE; + ads1114_1.data_available = FALSE; +#endif + + /* configure the ads1114_2 */ +#if USE_ADS1114_2 + ads1114_2.i2c_addr = ADS1114_2_I2C_ADDR; + ads1114_2.trans.buf[0] = ADS1114_POINTER_CONFIG_REG; + ads1114_2.trans.buf[1] = ADS1114_2_CONFIG_MSB; + ads1114_2.trans.buf[2] = ADS1114_2_CONFIG_LSB; + I2CTransmit(ADS1114_I2C_DEVICE, ads1114_2.trans, ADS1114_2_I2C_ADDR, 3); + ads1114_2.config_done = FALSE; + ads1114_2.data_available = FALSE; +#endif } -void ads1114_read( void ) { +void ads1114_read( struct ads1114_periph * p ) { // Config done with success // start new reading when previous is done (and read if success) - if (ads1114_config_done && ads1114_trans.status == I2CTransDone) { - ads1114_trans.buf[0] = ADS1114_POINTER_CONV_REG; - I2CTransceive(ADS1114_I2C_DEVICE, ads1114_trans, ADS1114_I2C_ADDR, 1, 2); + if (p->config_done && p->trans.status == I2CTransDone) { + p->trans.buf[0] = ADS1114_POINTER_CONV_REG; + I2CTransceive(ADS1114_I2C_DEVICE, p->trans, p->i2c_addr, 1, 2); } } diff --git a/sw/airborne/peripherals/ads1114.h b/sw/airborne/peripherals/ads1114.h index 866fce50db..550cd7dfb4 100644 --- a/sw/airborne/peripherals/ads1114.h +++ b/sw/airborne/peripherals/ads1114.h @@ -32,66 +32,136 @@ /* I2C slave address */ -#define ADS1114_I2C_ADDR 0x90 // slave address byte (I2c address(7bits) + R/W @ 0) +#ifndef ADS1114_1_I2C_ADDR +#define ADS1114_1_I2C_ADDR 0x90 // slave address byte (I2c address(7bits) + R/W @ 0) +#endif +#ifndef ADS1114_2_I2C_ADDR +#define ADS1114_2_I2C_ADDR 0x92 // slave address byte (I2c address(7bits) + R/W @ 0) +#endif /* I2C conf register */ #define ADS1114_POINTER_CONV_REG 0x00 // access to the Conversion register (16bits) #define ADS1114_POINTER_CONFIG_REG 0x01 // access to the Configuration register (16bits) -/* ADS1114 default conf */ -#ifndef ADS1114_OS -#define ADS1114_OS 0x0 // Operational status +/* ADS1114_1 default conf */ +#ifndef ADS1114_1_OS +#define ADS1114_1_OS 0x0 // Operational status #endif -#ifndef ADS1114_MUX -#define ADS1114_MUX 0x0 // Input multiplexer +#ifndef ADS1114_1_MUX +#define ADS1114_1_MUX 0x0 // Input multiplexer #endif -#ifndef ADS1114_PGA -#define ADS1114_PGA 0x3 // Programable gain amplifier (= 4 with a Full Scale of +/- 1.024V) +#ifndef ADS1114_1_PGA +#define ADS1114_1_PGA 0x3 // Programable gain amplifier (= 4 with a Full Scale of +/- 1.024V) #endif -#ifndef ADS1114_MODE -#define ADS1114_MODE 0x0 // Continuous conversion mode +#ifndef ADS1114_1_MODE +#define ADS1114_1_MODE 0x0 // Continuous conversion mode #endif -#ifndef ADS1114_DR -#define ADS1114_DR 0x4 // Data rate (128 SPS) +#ifndef ADS1114_1_DR +#define ADS1114_1_DR 0x4 // Data rate (128 SPS) #endif -#ifndef ADS1114_COMP_MODE -#define ADS1114_COMP_MODE 0x0 // Comparator mode +#ifndef ADS1114_1_COMP_MODE +#define ADS1114_1_COMP_MODE 0x0 // Comparator mode #endif -#ifndef ADS1114_COMP_POL -#define ADS1114_COMP_POL 0x0 // Comparator polarity +#ifndef ADS1114_1_COMP_POL +#define ADS1114_1_COMP_POL 0x0 // Comparator polarity #endif -#ifndef ADS1114_COMP_LAT -#define ADS1114_COMP_LAT 0x0 // Latching comparator +#ifndef ADS1114_1_COMP_LAT +#define ADS1114_1_COMP_LAT 0x0 // Latching comparator #endif -#ifndef ADS1114_COMP_QUE -#define ADS1114_COMP_QUE 0x3 // Comparator queue (disable) +#ifndef ADS1114_1_COMP_QUE +#define ADS1114_1_COMP_QUE 0x3 // Comparator queue (disable) #endif -#define ADS1114_CONFIG_MSB ((ADS1114_OS<<7)|(ADS1114_MUX<<4)|(ADS1114_PGA<<1)|(ADS1114_MODE)) -#define ADS1114_CONFIG_LSB ((ADS1114_DR<<5)|(ADS1114_COMP_MODE<<4)|(ADS1114_COMP_POL<<3)|(ADS1114_COMP_LAT<<2)|(ADS1114_COMP_QUE)) +#define ADS1114_1_CONFIG_MSB ((ADS1114_1_OS<<7)|(ADS1114_1_MUX<<4)|(ADS1114_1_PGA<<1)|(ADS1114_1_MODE)) +#define ADS1114_1_CONFIG_LSB ((ADS1114_1_DR<<5)|(ADS1114_1_COMP_MODE<<4)|(ADS1114_1_COMP_POL<<3)|(ADS1114_1_COMP_LAT<<2)|(ADS1114_1_COMP_QUE)) + +/* ADS1114_1 default conf */ +#ifndef ADS1114_2_OS +#define ADS1114_2_OS 0x0 // Operational status +#endif +#ifndef ADS1114_2_MUX +#define ADS1114_2_MUX 0x0 // Input multiplexer +#endif +#ifndef ADS1114_2_PGA +#define ADS1114_2_PGA 0x3 // Programable gain amplifier (= 4 with a Full Scale of +/- 1.024V) +#endif +#ifndef ADS1114_2_MODE +#define ADS1114_2_MODE 0x0 // Continuous conversion mode +#endif +#ifndef ADS1114_2_DR +#define ADS1114_2_DR 0x4 // Data rate (128 SPS) +#endif +#ifndef ADS1114_2_COMP_MODE +#define ADS1114_2_COMP_MODE 0x0 // Comparator mode +#endif +#ifndef ADS1114_2_COMP_POL +#define ADS1114_2_COMP_POL 0x0 // Comparator polarity +#endif +#ifndef ADS1114_2_COMP_LAT +#define ADS1114_2_COMP_LAT 0x0 // Latching comparator +#endif +#ifndef ADS1114_2_COMP_QUE +#define ADS1114_2_COMP_QUE 0x3 // Comparator queue (disable) +#endif + +#define ADS1114_2_CONFIG_MSB ((ADS1114_2_OS<<7)|(ADS1114_2_MUX<<4)|(ADS1114_2_PGA<<1)|(ADS1114_2_MODE)) +#define ADS1114_2_CONFIG_LSB ((ADS1114_2_DR<<5)|(ADS1114_2_COMP_MODE<<4)|(ADS1114_2_COMP_POL<<3)|(ADS1114_2_COMP_LAT<<2)|(ADS1114_2_COMP_QUE)) /* Default I2C device */ +// FIXME all ads on the same device for now #ifndef ADS1114_I2C_DEVICE #define ADS1114_I2C_DEVICE i2c1 #endif -extern struct i2c_transaction ads1114_trans; -extern bool_t ads1114_config_done; -extern bool_t ads1114_data_available; +struct ads1114_periph { + struct i2c_transaction trans; + uint8_t i2c_addr; + bool_t config_done; + bool_t data_available; +}; + +#if USE_ADS1114_1 +extern struct ads1114_periph ads1114_1; +#endif + +#if USE_ADS1114_2 +extern struct ads1114_periph ads1114_2; +#endif extern void ads1114_init(void); -extern void ads1114_read(void); +extern void ads1114_read(struct ads1114_periph * p); -#define Ads1114Event() { \ - if (!ads1114_config_done) { \ - if (ads1114_trans.status == I2CTransSuccess) { ads1114_config_done = TRUE; ads1114_trans.status = I2CTransDone; } \ - if (ads1114_trans.status == I2CTransFailed) { ads1114_trans.status = I2CTransDone; } \ +// Generic Event Macro +#define _Ads1114Event(_p) {\ + if (!_p.config_done) { \ + if (_p.trans.status == I2CTransSuccess) { _p.config_done = TRUE; _p.trans.status = I2CTransDone; } \ + if (_p.trans.status == I2CTransFailed) { _p.trans.status = I2CTransDone; } \ } else { \ - if (ads1114_trans.status == I2CTransSuccess) { ads1114_data_available = TRUE; ads1114_trans.status = I2CTransDone; } \ - if (ads1114_trans.status == I2CTransFailed) { ads1114_trans.status = I2CTransDone; } \ - }\ + if (_p.trans.status == I2CTransSuccess) { _p.data_available = TRUE; _p.trans.status = I2CTransDone; } \ + if (_p.trans.status == I2CTransFailed) { _p.trans.status = I2CTransDone; } \ + } \ } -#define Ads1114GetValue() ((int16_t)(((int16_t)ads1114_trans.buf[0]<<8)|ads1114_trans.buf[1])) +#if USE_ADS1114_1 +#define Ads1114_1Event() _Ads1114Event(ads1114_1) +#else +#define Ads1114_1Event() {} +#endif + +#if USE_ADS1114_2 +#define Ads1114_2Event() _Ads1114Event(ads1114_2) +#else +#define Ads1114_2Event() {} +#endif + +// Final event macro +#define Ads1114Event() { \ + Ads1114_1Event(); \ + Ads1114_2Event(); \ +} + +// Get value macro +// @param ads1114 periph +#define Ads1114GetValue(_p) ((int16_t)(((int16_t)_p.trans.buf[0]<<8)|_p.trans.buf[1])) #endif // ADS_1114_H diff --git a/sw/airborne/subsystems/electrical.c b/sw/airborne/subsystems/electrical.c index 4694df4e89..c9986928c1 100644 --- a/sw/airborne/subsystems/electrical.c +++ b/sw/airborne/subsystems/electrical.c @@ -6,6 +6,13 @@ #include "generated/airframe.h" #include BOARD_CONFIG +#ifdef MILLIAMP_PER_PERCENT +#warning "deprecated MILLIAMP_PER_PERCENT --> Please use MILLIAMP_AT_FULL_THROTTLE" +#endif +#if defined BATTERY_SENS || defined BATTERY_OFFSET +#warning "BATTERY_SENS and BATTERY_OFFSET are deprecated, please remove them --> if you want to change the default use VoltageOfAdc" +#endif + struct Electrical electrical; static struct { diff --git a/sw/airborne/subsystems/imu/imu_aspirin.c b/sw/airborne/subsystems/imu/imu_aspirin.c index 86cb2a8764..bd207dadd8 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin.c +++ b/sw/airborne/subsystems/imu/imu_aspirin.c @@ -7,8 +7,8 @@ struct ImuAspirin imu_aspirin; /* initialize peripherals */ static void configure_gyro(void); -static void configure_mag(void); static void configure_accel(void); +//static void configure_mag(void); static void send_i2c_msg_with_retry(struct i2c_transaction* t) { uint8_t max_retry = 8; diff --git a/sw/tools/gen_aircraft.ml b/sw/tools/gen_aircraft.ml index 7e0f1efaba..a939129326 100644 --- a/sw/tools/gen_aircraft.ml +++ b/sw/tools/gen_aircraft.ml @@ -232,12 +232,10 @@ let parse_firmware = fun makefile_ac firmware -> (* print makefile for this target *) fprintf makefile_ac "\n###########\n# -target: '%s'\n" (Xml.attrib target "name"); fprintf makefile_ac "ifeq ($(TARGET), %s)\n" (Xml.attrib target "name"); - let has_processor = - try - not (String.compare (Xml.attrib target "processor") "" = 0) - with _ -> false in - if has_processor then - fprintf makefile_ac "BOARD_PROCESSOR = %s\n" (Xml.attrib target "processor"); + begin (* Check for "processor" attribute *) + try fprintf makefile_ac "BOARD_PROCESSOR = %s\n" (Xml.attrib target "processor") + with _ -> () + end; List.iter (print_firmware_configure makefile_ac) config; List.iter (print_firmware_configure makefile_ac) t_config; List.iter (print_firmware_define makefile_ac) defines;