diff --git a/libraries/AP_Airspeed/AP_Airspeed_ND210.cpp b/libraries/AP_Airspeed/AP_Airspeed_ND210.cpp index 0ef6740da737b..27e816a011159 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_ND210.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed_ND210.cpp @@ -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); diff --git a/libraries/AP_Airspeed/AP_Airspeed_ND210.h b/libraries/AP_Airspeed/AP_Airspeed_ND210.h index ee527f12d4d68..d236729d3c600 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_ND210.h +++ b/libraries/AP_Airspeed/AP_Airspeed_ND210.h @@ -14,11 +14,7 @@ */ #pragma once -#include - -#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 diff --git a/libraries/AP_Airspeed/AP_Airspeed_config.h b/libraries/AP_Airspeed/AP_Airspeed_config.h index f12db5cb16c4e..6a648652204ac 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_config.h +++ b/libraries/AP_Airspeed/AP_Airspeed_config.h @@ -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 \ No newline at end of file