diff --git a/conf/modules/ahrs_chimu_spi.xml b/conf/modules/ahrs_chimu_spi.xml index 4fc6b43bb5..32c1038581 100644 --- a/conf/modules/ahrs_chimu_spi.xml +++ b/conf/modules/ahrs_chimu_spi.xml @@ -1,10 +1,9 @@ - + CHimu (SPI) -
diff --git a/conf/modules/ahrs_chimu_uart.xml b/conf/modules/ahrs_chimu_uart.xml index 8fc93dc535..2a203d69e9 100644 --- a/conf/modules/ahrs_chimu_uart.xml +++ b/conf/modules/ahrs_chimu_uart.xml @@ -1,13 +1,12 @@ - + CHimu (UART) For older CHIMU v1.0 you should define CHIMU_BIG_ENDIAN -
diff --git a/conf/modules/airspeed_ads1114.xml b/conf/modules/airspeed_ads1114.xml index d56a52b897..be7a781343 100644 --- a/conf/modules/airspeed_ads1114.xml +++ b/conf/modules/airspeed_ads1114.xml @@ -7,7 +7,6 @@ Module to extend the baro_board module with an airspeed sensor using ads1114 adc -
diff --git a/conf/modules/cam_segment.xml b/conf/modules/cam_segment.xml index 5be7d9ad86..3b985fb487 100644 --- a/conf/modules/cam_segment.xml +++ b/conf/modules/cam_segment.xml @@ -4,7 +4,7 @@ Camera control to point a segment - + cam_point
diff --git a/conf/modules/digital_cam.xml b/conf/modules/digital_cam.xml index 51371ad64f..041305de78 100644 --- a/conf/modules/digital_cam.xml +++ b/conf/modules/digital_cam.xml @@ -43,6 +43,8 @@ + digital_cam_i2c,digital_cam_servo,digital_cam_uart +
diff --git a/conf/modules/digital_cam_i2c.xml b/conf/modules/digital_cam_i2c.xml index deddfad05d..14e0245931 100644 --- a/conf/modules/digital_cam_i2c.xml +++ b/conf/modules/digital_cam_i2c.xml @@ -9,7 +9,7 @@ - + digital_cam,digital_cam_servo,digital_cam_uart
diff --git a/conf/modules/digital_cam_servo.xml b/conf/modules/digital_cam_servo.xml index afbbf37654..c677b02679 100644 --- a/conf/modules/digital_cam_servo.xml +++ b/conf/modules/digital_cam_servo.xml @@ -12,6 +12,8 @@ + digital_cam,digital_cam_i2c,digital_cam_uart +
diff --git a/conf/modules/digital_cam_shoot_rc.xml b/conf/modules/digital_cam_shoot_rc.xml index 650e0824b3..5a8a29f10f 100644 --- a/conf/modules/digital_cam_shoot_rc.xml +++ b/conf/modules/digital_cam_shoot_rc.xml @@ -11,7 +11,7 @@ - + digital_cam|digital_cam_servo|digital_cam_uart|digital_cam_i2c
diff --git a/conf/modules/digital_cam_uart.xml b/conf/modules/digital_cam_uart.xml index 58e8d2ca69..2d42a9764b 100644 --- a/conf/modules/digital_cam_uart.xml +++ b/conf/modules/digital_cam_uart.xml @@ -20,6 +20,7 @@ + digital_cam,digital_cam_servo,digital_cam_i2c
diff --git a/conf/modules/infrared_adc.xml b/conf/modules/infrared_adc.xml index 1149cc8193..4cdd200c09 100644 --- a/conf/modules/infrared_adc.xml +++ b/conf/modules/infrared_adc.xml @@ -1,6 +1,6 @@ - + Infrared sensor using ADC diff --git a/conf/modules/ins_vn100.xml b/conf/modules/ins_vn100.xml index 69722d3524..30f80e55da 100644 --- a/conf/modules/ins_vn100.xml +++ b/conf/modules/ins_vn100.xml @@ -6,7 +6,7 @@ - +
diff --git a/conf/modules/ins_xsens.xml b/conf/modules/ins_xsens.xml index fdd3438527..6ec0d450ef 100644 --- a/conf/modules/ins_xsens.xml +++ b/conf/modules/ins_xsens.xml @@ -4,7 +4,6 @@ XSens -
diff --git a/conf/modules/ins_xsens_MTiG_Uart0.xml b/conf/modules/ins_xsens_MTiG_Uart0.xml index 9a8162d388..0438e3776a 100644 --- a/conf/modules/ins_xsens_MTiG_Uart0.xml +++ b/conf/modules/ins_xsens_MTiG_Uart0.xml @@ -4,8 +4,8 @@ XSens MTiG - - + +
diff --git a/conf/modules/ins_xsens_MTi_Uart0.xml b/conf/modules/ins_xsens_MTi_Uart0.xml index 3eaa182b88..8bcb60694c 100644 --- a/conf/modules/ins_xsens_MTi_Uart0.xml +++ b/conf/modules/ins_xsens_MTi_Uart0.xml @@ -4,7 +4,7 @@ XSens MTi - +
diff --git a/conf/modules/mag_hmc5843.xml b/conf/modules/mag_hmc5843.xml index 329c9257a2..3d922fee0c 100644 --- a/conf/modules/mag_hmc5843.xml +++ b/conf/modules/mag_hmc5843.xml @@ -4,7 +4,6 @@ hmc5843 magnetometer -
diff --git a/conf/modules/meteo_stick.xml b/conf/modules/meteo_stick.xml index 80538bd116..3791cd95ed 100644 --- a/conf/modules/meteo_stick.xml +++ b/conf/modules/meteo_stick.xml @@ -34,7 +34,7 @@ - + pwm_meas
diff --git a/conf/modules/mf_ptu.xml b/conf/modules/mf_ptu.xml index 3d87087405..795f16396b 100644 --- a/conf/modules/mf_ptu.xml +++ b/conf/modules/mf_ptu.xml @@ -31,7 +31,7 @@ - + pwm_meas
diff --git a/conf/modules/module.dtd b/conf/modules/module.dtd index 609b04f5d7..a317ab62af 100644 --- a/conf/modules/module.dtd +++ b/conf/modules/module.dtd @@ -1,10 +1,11 @@ - + - + + @@ -29,10 +30,6 @@ name CDATA #REQUIRED dir CDATA #IMPLIED> - - PX4FLOW optical flow sensor - + mavlink_decoder
diff --git a/conf/modules/windturbine.xml b/conf/modules/windturbine.xml index 928d21aa41..f652dc9515 100644 --- a/conf/modules/windturbine.xml +++ b/conf/modules/windturbine.xml @@ -4,7 +4,7 @@ - + trig_test.xml
diff --git a/conf/modules/xtend_rssi.xml b/conf/modules/xtend_rssi.xml index d5e532d9c2..2a021f70a4 100644 --- a/conf/modules/xtend_rssi.xml +++ b/conf/modules/xtend_rssi.xml @@ -13,7 +13,7 @@ - + pwm_meas
diff --git a/sw/airborne/modules/digital_cam/dc_shoot_rc.c b/sw/airborne/modules/digital_cam/dc_shoot_rc.c index 36efb0f643..1cf398a2ab 100644 --- a/sw/airborne/modules/digital_cam/dc_shoot_rc.c +++ b/sw/airborne/modules/digital_cam/dc_shoot_rc.c @@ -31,7 +31,7 @@ #include "dc.h" #ifndef DC_RADIO_SHOOT -#error "You need to define DC_RADIO_SHOT to a RADIO_xxx channel to use this module" +#error "You need to define DC_RADIO_SHOOT to a RADIO_xxx channel to use this module" #endif #define DC_RADIO_SHOOT_THRESHOLD 3000 diff --git a/sw/tools/generators/gen_modules.ml b/sw/tools/generators/gen_modules.ml index 801dcb3204..191ed29051 100644 --- a/sw/tools/generators/gen_modules.ml +++ b/sw/tools/generators/gen_modules.ml @@ -290,28 +290,53 @@ let parse_modules modules = let test_section_modules = fun xml -> List.fold_right (fun x r -> ExtXml.tag_is x "modules" || r) (Xml.children xml) false -(** Check dependencies *) -let pipe_regexp = Str.regexp "|" -let dep_of_field = fun field att -> +(** create list of dependencies from string + * returns a nested list, where the second level consists of OR dependencies + *) +let deps_of_string = fun s -> + let comma_regexp = Str.regexp "," in + let pipe_regexp = Str.regexp "|" in try - Str.split pipe_regexp (Xml.attrib field att) + (* first get the comma separated deps *) + let deps = Str.split comma_regexp s in + (* split up each dependency in a list of OR deps (separated by |) *) + List.map (fun dep -> + Str.split pipe_regexp dep) + deps; with - _ -> [] + _ -> [[]] +let get_pcdata = fun xml tag -> + try + Xml.pcdata (ExtXml.child (ExtXml.child xml tag) "0") + with + Not_found -> "" + +(** Check dependencies *) let check_dependencies = fun modules names -> List.iter (fun m -> try - let dep = ExtXml.child m "depend" in - let require = dep_of_field dep "require" in - List.iter (fun req -> - if not (List.exists (fun c -> String.compare c req == 0) names) then - fprintf stderr "\nWARNING: Dependency not satisfied: module %s requires %s\n" (Xml.attrib m "name") req) + let module_name = Xml.attrib m "name" in + let dep_string = get_pcdata m "depends" in + (*fprintf stderr "\n\nWARNING: parsing dep string: %s\n\n" dep_string; + fprintf stderr "\n\nWARNING: names: %s" (String.concat "," names);*) + let require = deps_of_string dep_string in + List.iter (fun deps -> + (* iterate over all dependencies, where the second level contains the OR dependencies *) + let find_common satisfied d = if List.mem d names then d::satisfied else satisfied in + let satisfied = List.fold_left find_common [] deps in + if List.length satisfied == 0 then + begin + fprintf stderr "\nDEPENDENCY WARNING: Module %s requires %s\n" module_name (String.concat " or " deps); + fprintf stderr "Available dependencies are:\n %s\n\n" (String.concat "\n " names) + end) require; - let conflict = dep_of_field dep "conflict" in + let conflict_string = get_pcdata m "conflicts" in + let conflict_l = List.flatten (deps_of_string conflict_string) in List.iter (fun con -> if List.exists (fun c -> String.compare c con == 0) names then - fprintf stderr "\nWARNING: Dependency not satisfied: module %s conflicts with %s\n" (Xml.attrib m "name") con) - conflict + fprintf stderr "\nDEPENDENCY WARNING: Module %s conflicts with %s\n" module_name con) + conflict_l with _ -> () ) modules