Browse Source

AP_HAL_PX4: Util: fix check for PX4_V4

When building for px4-v2 we have an warning because we are checking for
the value of this undefined macro. Just change both checks to use
"defined()".

../../libraries/AP_HAL_PX4/Util.cpp:115:7: warning: "CONFIG_ARCH_BOARD_PX4FMU_V4" is not defined [-Wundef]
 #elif CONFIG_ARCH_BOARD_PX4FMU_V4
       ^
mission-4.1.18
Lucas De Marchi 9 years ago
parent
commit
293f94b355
  1. 6
      libraries/AP_HAL_PX4/Util.cpp

6
libraries/AP_HAL_PX4/Util.cpp

@ -108,11 +108,11 @@ bool PX4Util::get_system_id(char buf[40])
uint8_t serialid[12]; uint8_t serialid[12];
memset(serialid, 0, sizeof(serialid)); memset(serialid, 0, sizeof(serialid));
get_board_serial(serialid); get_board_serial(serialid);
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 #if defined(CONFIG_ARCH_BOARD_PX4FMU_V1)
const char *board_type = "PX4v1"; const char *board_type = "PX4v1";
#elif CONFIG_ARCH_BOARD_PX4FMU_V2 #elif defined(CONFIG_ARCH_BOARD_PX4FMU_V2)
const char *board_type = "PX4v2"; const char *board_type = "PX4v2";
#elif CONFIG_ARCH_BOARD_PX4FMU_V4 #elif defined(CONFIG_ARCH_BOARD_PX4FMU_V4)
const char *board_type = "PX4v4"; const char *board_type = "PX4v4";
#else #else
const char *board_type = "PX4v?"; const char *board_type = "PX4v?";

Loading…
Cancel
Save