diff --git a/conf/settings/estimation/body_to_imu.xml b/conf/settings/estimation/body_to_imu.xml index 506ccac38e..e518b1182d 100644 --- a/conf/settings/estimation/body_to_imu.xml +++ b/conf/settings/estimation/body_to_imu.xml @@ -1,6 +1,6 @@ - + diff --git a/sw/tools/generators/gen_settings.ml b/sw/tools/generators/gen_settings.ml index 2c5e3c9048..c6b51fc522 100644 --- a/sw/tools/generators/gen_settings.ml +++ b/sw/tools/generators/gen_settings.ml @@ -276,6 +276,17 @@ let parse_rc_mode = fun xml -> let parse_rc_modes = fun xml -> List.iter parse_rc_mode (Xml.children xml) +(* + Check if target t is marked as supported in the targets string. + The targets string is a pipe delimited list of supported targets, e.g. "ap|nps" + To specifiy a list with unsupported targets, prefix with ! + e.g. "!sim|nps" to mark support for all targets except sim and nps. +*) +let supports_target = fun t targets -> + if (String.get targets 0) = '!' then + not (Str.string_match (Str.regexp (".*"^t^".*")) targets 0) + else + Str.string_match (Str.regexp (".*"^t^".*")) targets 0 let join_xml_files = fun xml_files -> let dl_settings = ref [] @@ -302,7 +313,7 @@ let join_xml_files = fun xml_files -> if List.exists (fun n -> if Xml.tag n = "makefile" then begin let t = ExtXml.attrib_or_default n "target" Env.default_module_targets in - Str.string_match (Str.regexp (".*"^target^".*")) t 0 + supports_target target t end else false ) (Xml.children xml) @@ -313,7 +324,7 @@ let join_xml_files = fun xml_files -> (* if the top node has a target attribute, only add if matches current target *) let t = ExtXml.attrib_or_default xml "target" "" in - if t = "" || Str.string_match (Str.regexp (".*"^target^".*")) t 0 then + if t = "" || (supports_target target t) then [xml] else []