Skip to content

Commit

Permalink
[modules] qnh: configurable QNH_BARO_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Oct 11, 2014
1 parent f944800 commit af4f5b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion conf/modules/qnh.xml
Expand Up @@ -2,7 +2,11 @@

<module name="altitude">
<doc>
<description>Altitude</description>
<description>
QNH Altitude.
Barometric pressure adjusted to sea level, when set on an aircraft's altimeter, will cause the altimeter to read altitude above mean sea level within a certain defined region.
</description>
<define name="QNH_BARO_ID" value="id" description="ABI sender ID of the baro sensor, default is any baro (ABI_BROADCAST)"/>
</doc>
<header>
<file name="qnh.h"/>
Expand Down
6 changes: 5 additions & 1 deletion sw/airborne/modules/altitude/qnh.c
Expand Up @@ -26,6 +26,10 @@
#include "subsystems/sensors/baro.h"
#include "generated/airframe.h"

#ifndef QNH_BARO_ID
#define QNH_BARO_ID ABI_BROADCAST
#endif

struct qnh_struct qnh;
abi_event qnh_baro_event = {0, 0, 0};

Expand Down Expand Up @@ -64,7 +68,7 @@ void init_qnh(void) {
qnh.baro_counter = 0;
qnh.amsl_gps = 0;
qnh.baro_pressure = 0;
AbiBindMsgBARO_ABS(0, &qnh_baro_event, &received_abs_baro_for_qnh);
AbiBindMsgBARO_ABS(QNH_BARO_ID, &qnh_baro_event, &received_abs_baro_for_qnh);
}

void compute_qnh(void)
Expand Down

0 comments on commit af4f5b4

Please sign in to comment.