@@ -38,49 +38,64 @@ using namespace time_literals;
3838
3939void ParachuteChecks::checkAndReport (const Context &context, Report &reporter)
4040{
41- if (!_param_com_parachute.get ()) {
42- return ;
43- }
41+ const int action = _param_com_parachute.get ();
4442
45- reporter.failsafeFlags ().parachute_unhealthy =
46- !context.status ().parachute_system_present ||
47- !context.status ().parachute_system_healthy ;
43+ if (action > 0 ) {
44+ reporter.failsafeFlags ().parachute_unhealthy =
45+ !context.status ().parachute_system_present ||
46+ !context.status ().parachute_system_healthy ;
4847
49- if (!context.status ().parachute_system_present ) {
50- /* EVENT
51- * @description
52- * No MAVLink parachute heartbeat detected. Check connection, power, configuration.
53- *
54- * <profile name="dev">
55- * Enabled by <param>COM_PARACHUTE</param>
56- * </profile>
57- */
58- reporter.healthFailure (NavModes::All, health_component_t ::parachute, events::ID (" check_parachute_missing" ),
59- events::Log::Error, " Parachute system missing" );
48+ // Values >= 2 block arming; value 1 is warning-only
49+ const bool warn_only = (action == 1 );
50+ const events::Log log_level = warn_only ? events::Log::Warning : events::Log::Error;
51+ const NavModes affected_modes = warn_only ? NavModes::None : NavModes::All;
6052
61- if (reporter.mavlink_log_pub ()) {
62- mavlink_log_critical (reporter.mavlink_log_pub (), " Preflight Fail: Parachute system missing" );
63- }
53+ if (!context.status ().parachute_system_present ) {
54+ /* EVENT
55+ * @description
56+ * No MAVLink parachute heartbeat detected. Check connection, power, configuration.
57+ *
58+ * <profile name="dev">
59+ * Configured by <param>COM_PARACHUTE</param>
60+ * </profile>
61+ */
62+ reporter.healthFailure (affected_modes, health_component_t ::parachute, events::ID (" check_parachute_missing" ),
63+ log_level, " Parachute system missing" );
64+
65+ if (reporter.mavlink_log_pub ()) {
66+ if (warn_only) {
67+ mavlink_log_warning (reporter.mavlink_log_pub (), " Parachute system missing" );
68+
69+ } else {
70+ mavlink_log_critical (reporter.mavlink_log_pub (), " Preflight Fail: Parachute system missing" );
71+ }
72+ }
6473
65- } else if (!context.status ().parachute_system_healthy ) {
74+ } else if (!context.status ().parachute_system_healthy ) {
6675
67- /* EVENT
68- * @description
69- * MAVLink parachute system reports unhealthy status.
70- *
71- * <profile name="dev">
72- * Enabled by <param>COM_PARACHUTE</param>
73- * </profile>
74- */
75- reporter.healthFailure (NavModes::All , health_component_t ::parachute, events::ID (" check_parachute_unhealthy" ),
76- events::Log::Error , " Parachute system not ready" );
76+ /* EVENT
77+ * @description
78+ * MAVLink parachute system reports unhealthy status.
79+ *
80+ * <profile name="dev">
81+ * Configured by <param>COM_PARACHUTE</param>
82+ * </profile>
83+ */
84+ reporter.healthFailure (affected_modes , health_component_t ::parachute, events::ID (" check_parachute_unhealthy" ),
85+ log_level , " Parachute system not ready" );
7786
78- if (reporter.mavlink_log_pub ()) {
79- mavlink_log_critical (reporter.mavlink_log_pub (), " Preflight Fail: Parachute system not ready" );
87+ if (reporter.mavlink_log_pub ()) {
88+ if (warn_only) {
89+ mavlink_log_warning (reporter.mavlink_log_pub (), " Parachute system not ready" );
90+
91+ } else {
92+ mavlink_log_critical (reporter.mavlink_log_pub (), " Preflight Fail: Parachute system not ready" );
93+ }
94+ }
8095 }
81- }
8296
83- if (context.status ().parachute_system_present ) {
84- reporter.setIsPresent (health_component_t ::parachute);
97+ if (context.status ().parachute_system_present ) {
98+ reporter.setIsPresent (health_component_t ::parachute);
99+ }
85100 }
86101}
0 commit comments