diff --git a/conf/modules/MPPT.xml b/conf/modules/MPPT.xml index d50df38d8c..a77b503ff6 100644 --- a/conf/modules/MPPT.xml +++ b/conf/modules/MPPT.xml @@ -18,7 +18,7 @@ - + diff --git a/conf/modules/alt_srf08.xml b/conf/modules/alt_srf08.xml index 0fed20f9f1..501806f45c 100644 --- a/conf/modules/alt_srf08.xml +++ b/conf/modules/alt_srf08.xml @@ -8,10 +8,10 @@ - - - + + + diff --git a/conf/modules/dust_gp2y.xml b/conf/modules/dust_gp2y.xml index fcfaf6147d..1f1a591fa1 100644 --- a/conf/modules/dust_gp2y.xml +++ b/conf/modules/dust_gp2y.xml @@ -12,7 +12,7 @@ - + diff --git a/conf/modules/gsm.xml b/conf/modules/gsm.xml index 6a54c37822..5d9e942afe 100644 --- a/conf/modules/gsm.xml +++ b/conf/modules/gsm.xml @@ -8,7 +8,7 @@ - + diff --git a/conf/modules/humid_htm_b71.xml b/conf/modules/humid_htm_b71.xml index d0b2b7b067..92c5562509 100644 --- a/conf/modules/humid_htm_b71.xml +++ b/conf/modules/humid_htm_b71.xml @@ -9,8 +9,8 @@ - - + + diff --git a/conf/modules/humid_sht_i2c.xml b/conf/modules/humid_sht_i2c.xml index 75d7caac06..a956442058 100644 --- a/conf/modules/humid_sht_i2c.xml +++ b/conf/modules/humid_sht_i2c.xml @@ -9,9 +9,9 @@ - - - + + + diff --git a/conf/modules/wind_gfi.xml b/conf/modules/wind_gfi.xml index 0769bb9f70..24dd95e567 100644 --- a/conf/modules/wind_gfi.xml +++ b/conf/modules/wind_gfi.xml @@ -8,7 +8,7 @@ - + diff --git a/sw/lib/ocaml/module.ml b/sw/lib/ocaml/module.ml index a1d88eea8b..938f4c999d 100644 --- a/sw/lib/ocaml/module.ml +++ b/sw/lib/ocaml/module.ml @@ -141,7 +141,7 @@ type periodic = { call: string; fname: string; period_freq: period_freq; - delay: int option; + delay: float option; start: string option; stop: string option; autorun: autorun @@ -149,7 +149,7 @@ type periodic = { let parse_periodic = fun xml -> let get = fun x -> ExtXml.attrib_opt xml x in - let geti = fun x -> ExtXml.attrib_opt_int xml x in + let getf = fun x -> ExtXml.attrib_opt_float xml x in let call = snd (List.find (fun (a, _) -> Compat.lowercase_ascii a = "fun") (Xml.attribs xml)) in let call_regexp = Str.regexp "\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\(.*\\)" in @@ -176,7 +176,7 @@ let parse_periodic = fun xml -> with _ -> Period p end in - { call; fname; period_freq; delay = geti "delay"; + { call; fname; period_freq; delay = getf "delay"; start = get "start"; stop = get "stop"; autorun = match get "autorun" with | None -> Lock diff --git a/sw/tools/generators/gen_modules.ml b/sw/tools/generators/gen_modules.ml index 533562882f..610785cac5 100644 --- a/sw/tools/generators/gen_modules.ml +++ b/sw/tools/generators/gen_modules.ml @@ -111,7 +111,12 @@ let get_functions_modulos = fun modules -> let p, _ = get_period_and_freq x in let d = begin try let _d = float_of_string (Xml.attrib x "delay") in - if _d > 0.95 then _d /. 65536. else _d (* try to keep some backward compatibility *) + if _d > 0.99 then + begin + fprintf stderr "Warning: 'delay' attribute should be a float value between 0. and 1.\n"; + _d /. 65536. + end + else _d (* try to keep some backward compatibility *) with _ -> delay := !delay +. 0.1; if !delay > 0.9 then delay := 0.;