Skip to content

Commit

Permalink
Fix for coexistance of baro with BLE
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jun 17, 2018
1 parent 6a69aff commit 849479a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion software/firmware/source/SoftRF/BaroHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ static float prev_pressure_altitude = 0;
static float Baro_VS[VS_AVERAGING_FACTOR];
static int avg_ndx = 0;

/* 4 baro sensor readings per second */
#define isTimeToBaro() ((millis() - BaroTimeMarker) > (1000 / VS_AVERAGING_FACTOR))

static bool bmp180_probe()
{
return bmp180.begin();
Expand Down Expand Up @@ -186,7 +189,7 @@ void Baro_setup()

void Baro_loop()
{
if (baro_chip) {
if (baro_chip && isTimeToBaro()) {

/* Draft of pressure altitude and vertical speed calculation */
ThisAircraft.pressure_altitude = baro_chip->altitude(1013.25);
Expand Down

0 comments on commit 849479a

Please sign in to comment.