Skip to content

Commit

Permalink
AP_Airspeed: ND210 pressure value type bugfix uint->int
Browse files Browse the repository at this point in the history
& some fixes after rebase
  • Loading branch information
zzaurak committed Jun 24, 2024
1 parent 5ca019d commit b6cb9bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_Airspeed/AP_Airspeed_ND210.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void AP_Airspeed_ND210::_timer()
return;
}

uint16_t P = (((uint16_t)val[0]) << 8) | val[1];
int16_t P = (((int16_t)val[0]) << 8) | val[1];
float diff_pressure_h20 = (float(P) / ND210_SCALE_PRESSURE_ND210) * _selected_pressure_range;
// GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "ND210 Raw Pressure = 0x%02X", P);

Expand Down
6 changes: 1 addition & 5 deletions libraries/AP_Airspeed/AP_Airspeed_ND210.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
*/
#pragma once

#include <AP_HAL/AP_HAL_Boards.h>

#ifndef AP_AIRSPEED_ND210_ENABLED
#define AP_AIRSPEED_ND210_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
#endif
#include "AP_Airspeed_config.h"

#if AP_AIRSPEED_ND210_ENABLED

Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_Airspeed/AP_Airspeed_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@
#ifndef AP_AIRSPEED_EXTERNAL_ENABLED
#define AP_AIRSPEED_EXTERNAL_ENABLED AP_AIRSPEED_ENABLED && HAL_EXTERNAL_AHRS_ENABLED
#endif

#ifndef AP_AIRSPEED_ND210_ENABLED
#define AP_AIRSPEED_ND210_ENABLED AP_AIRSPEED_ENABLED
#endif

0 comments on commit b6cb9bc

Please sign in to comment.