Merge branch 'master' into dev

This commit is contained in:
Felix Ruess
2011-11-09 15:42:32 +01:00
12 changed files with 44 additions and 34 deletions
+3
View File
@@ -65,6 +65,8 @@
# /sw/ground_segment/lpc21iap/ # /sw/ground_segment/lpc21iap/
/sw/ground_segment/lpc21iap/lpc21iap /sw/ground_segment/lpc21iap/lpc21iap
/sw/ground_segment/misc/ivy2serial
# /sw/ground_segment/multimon/ # /sw/ground_segment/multimon/
/sw/ground_segment/multimon/costabf.c /sw/ground_segment/multimon/costabf.c
/sw/ground_segment/multimon/mkcostab /sw/ground_segment/multimon/mkcostab
@@ -84,6 +86,7 @@
/sw/ground_segment/tmtc/diadec /sw/ground_segment/tmtc/diadec
/sw/ground_segment/tmtc/ivy_serial_bridge /sw/ground_segment/tmtc/ivy_serial_bridge
/sw/ground_segment/tmtc/GSM/SMS_GS /sw/ground_segment/tmtc/GSM/SMS_GS
/sw/ground_segment/tmtc/gpsd2ivy
# /sw/ground_segment/joystick # /sw/ground_segment/joystick
/sw/ground_segment/joystick/input2ivy /sw/ground_segment/joystick/input2ivy
+2 -2
View File
@@ -162,9 +162,9 @@ printcommands:
@echo "Using SIZE = $(SIZE)" @echo "Using SIZE = $(SIZE)"
@echo "Using OOCD = $(OOCD)" @echo "Using OOCD = $(OOCD)"
@echo "GCC version:" @echo "GCC version:"
@$(CC) --version @$(CC) --version | head -1
@echo "OOCD version:" @echo "OOCD version:"
@$(OOCD) --version @$(OOCD) --version | head -1
ifeq ("$(MULTILIB)","yes") ifeq ("$(MULTILIB)","yes")
printmultilib: printmultilib:
+1 -1
View File
@@ -78,7 +78,7 @@
<message name="BAT" id="12"> <message name="BAT" id="12">
<field name="throttle" type="int16" unit="pprz"/> <field name="throttle" type="int16" unit="pprz"/>
<field name="voltage" type="uint8" unit="1e-1V" alt_unit="V" alt_unit_coef="0.1"/> <field name="voltage" type="uint8" unit="1e-1V" alt_unit="V" alt_unit_coef="0.1"/>
<field name="amps" type="int16" unit="A" alt_unit="A" /> <field name="amps" type="int16" unit="1e-2A" alt_unit="A" alt_unit_coef="0.01"/>
<field name="flight_time" type="uint16" unit="s"/> <field name="flight_time" type="uint16" unit="s"/>
<field name="kill_auto_throttle" type="uint8" unit="bool"/> <field name="kill_auto_throttle" type="uint8" unit="bool"/>
<field name="block_time" type="uint16" unit="s"/> <field name="block_time" type="uint16" unit="s"/>
+1
View File
@@ -22,6 +22,7 @@
<dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/> <dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/> <dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink" values="Default|Minimal|Extremal"/> <dl_setting MAX="2" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink" values="Default|Minimal|Extremal"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="telemetry_mode_Fbw_DefaultChannel" shortname="tele_FBW" module="downlink" values="Default|Debug"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/> <dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/>
</dl_settings> </dl_settings>
+1
View File
@@ -22,6 +22,7 @@
<dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/> <dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/> <dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink" values="Default|Minimal|Extremal"/> <dl_setting MAX="2" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink" values="Default|Minimal|Extremal"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="telemetry_mode_Fbw_DefaultChannel" shortname="tele_FBW" module="downlink" values="Default|Debug"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/> <dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/>
</dl_settings> </dl_settings>
+1
View File
@@ -22,6 +22,7 @@
<dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/> <dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/> <dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
<dl_setting MAX="5" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink" values="Default|Minimal|Extremal|Raw|Scaled|DebugIMU"/> <dl_setting MAX="5" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink" values="Default|Minimal|Extremal|Raw|Scaled|DebugIMU"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="telemetry_mode_Fbw_DefaultChannel" shortname="tele_FBW" module="downlink" values="Default|Debug"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/> <dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/>
</dl_settings> </dl_settings>
+2 -2
View File
@@ -57,7 +57,7 @@
#define PERIODIC_SEND_ALIVE(_chan) DOWNLINK_SEND_ALIVE(_chan, 16, MD5SUM); #define PERIODIC_SEND_ALIVE(_chan) DOWNLINK_SEND_ALIVE(_chan, 16, MD5SUM);
#define PERIODIC_SEND_BAT(_chan) { \ #define PERIODIC_SEND_BAT(_chan) { \
uint16_t amps = (int16_t) (current/1000); \ int16_t amps = (int16_t) (current/10); \
Downlink({ int16_t e = energy; \ Downlink({ int16_t e = energy; \
DOWNLINK_SEND_BAT(_chan, \ DOWNLINK_SEND_BAT(_chan, \
&v_ctl_throttle_slewed, \ &v_ctl_throttle_slewed, \
@@ -69,7 +69,7 @@
&stage_time, \ &stage_time, \
&e); \ &e); \
}); \ }); \
} }
#ifdef MCU_SPI_LINK #ifdef MCU_SPI_LINK
#define PERIODIC_SEND_DEBUG_MCU_LINK(_chan) DOWNLINK_SEND_DEBUG_MCU_LINK(_chan, &link_mcu_nb_err, &link_mcu_fbw_nb_err, &mcu1_ppm_cpt); #define PERIODIC_SEND_DEBUG_MCU_LINK(_chan) DOWNLINK_SEND_DEBUG_MCU_LINK(_chan, &link_mcu_nb_err, &link_mcu_fbw_nb_err, &mcu1_ppm_cpt);
@@ -44,6 +44,7 @@ void parse_rc_3ch_datalink( uint8_t throttle_mode,
rc_dl_values[RADIO_PITCH] = pitch; rc_dl_values[RADIO_PITCH] = pitch;
rc_dl_values[RADIO_THROTTLE] = (int8_t)throttle; rc_dl_values[RADIO_THROTTLE] = (int8_t)throttle;
rc_dl_values[RADIO_MODE] = (int8_t)mode; rc_dl_values[RADIO_MODE] = (int8_t)mode;
rc_dl_values[RADIO_YAW] = 0;
rc_dl_frame_available = TRUE; rc_dl_frame_available = TRUE;
} }
@@ -69,7 +69,7 @@ extern void parse_rc_4ch_datalink(
Bound(_out[RADIO_ROLL], MIN_PPRZ, MAX_PPRZ); \ Bound(_out[RADIO_ROLL], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_PITCH] = (MAX_PPRZ/128) * _in[RADIO_PITCH]; \ _out[RADIO_PITCH] = (MAX_PPRZ/128) * _in[RADIO_PITCH]; \
Bound(_out[RADIO_PITCH], MIN_PPRZ, MAX_PPRZ); \ Bound(_out[RADIO_PITCH], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_YAW] = 0; \ _out[RADIO_YAW] = (MAX_PPRZ/128) * _in[RADIO_YAW]; \
Bound(_out[RADIO_YAW], MIN_PPRZ, MAX_PPRZ); \ Bound(_out[RADIO_YAW], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_THROTTLE] = ((MAX_PPRZ/128) * _in[RADIO_THROTTLE]); \ _out[RADIO_THROTTLE] = ((MAX_PPRZ/128) * _in[RADIO_THROTTLE]); \
Bound(_out[RADIO_THROTTLE], 0, MAX_PPRZ); \ Bound(_out[RADIO_THROTTLE], 0, MAX_PPRZ); \
+9 -6
View File
@@ -88,7 +88,8 @@ type msg = {
msg_class : string; msg_class : string;
fields : (string * Syntax.expression) list; fields : (string * Syntax.expression) list;
on_event : Syntax.expression option; on_event : Syntax.expression option;
send_always : bool send_always : bool;
has_ac_id : bool
} }
(** Representation of a variable *) (** Representation of a variable *)
@@ -230,12 +231,13 @@ let parse_msg = fun msg ->
and msg_class = Xml.attrib msg "class" and msg_class = Xml.attrib msg "class"
and send_always = (try (Xml.attrib msg "send_always") = "true" with _ -> false) in and send_always = (try (Xml.attrib msg "send_always") = "true" with _ -> false) in
let fields = let fields, has_ac_id =
match get_message_type msg_class with match get_message_type msg_class with
"Message" -> "Message" ->
let msg_descr = get_message msg_class msg_name in let msg_descr = get_message msg_class msg_name in
List.map (parse_msg_field msg_descr) (Xml.children msg) (List.map (parse_msg_field msg_descr) (Xml.children msg),
| "Trim" -> [] List.mem_assoc "ac_id" msg_descr.Pprz.fields)
| "Trim" -> ([], false)
| _ -> failwith ("Unknown message class type") in | _ -> failwith ("Unknown message class type") in
let on_event = let on_event =
@@ -245,7 +247,8 @@ let parse_msg = fun msg ->
msg_class = msg_class; msg_class = msg_class;
fields = fields; fields = fields;
on_event = on_event; on_event = on_event;
send_always = send_always send_always = send_always;
has_ac_id = has_ac_id
} }
(** Parse an XML list of variables and set function *) (** Parse an XML list of variables and set function *)
@@ -478,7 +481,7 @@ let execute_action = fun ac_id inputs buttons axis variables message ->
let previous_values = get_previous_values message.msg_name in let previous_values = get_previous_values message.msg_name in
(* FIXME ((value <> previous) && on_event) || send_always ??? *) (* FIXME ((value <> previous) && on_event) || send_always ??? *)
if ( ( (on_event, values) <> previous_values ) || message.send_always ) && on_event then begin if ( ( (on_event, values) <> previous_values ) || message.send_always ) && on_event then begin
let vs = ("ac_id", Pprz.Int ac_id) :: values in let vs = if message.has_ac_id then ("ac_id", Pprz.Int ac_id) :: values else values in
match message.msg_class with match message.msg_class with
"datalink" -> DL.message_send "input2ivy" message.msg_name vs "datalink" -> DL.message_send "input2ivy" message.msg_name vs
| "ground" -> G.message_send "input2ivy" message.msg_name vs | "ground" -> G.message_send "input2ivy" message.msg_name vs