diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index b9c4c2f61d..9af46fa84a 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -14,7 +14,9 @@ #include #include +#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #include +#endif #if HAL_CPU_CLASS < HAL_CPU_CLASS_75 && defined(APM_BUILD_DIRECTORY) diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index 8b220bc90f..8af4035fe5 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -1061,6 +1061,7 @@ void DataFlash_Class::Log_Write_Camera(const AP_AHRS &ahrs, const AP_GPS &gps, c // Write ESC status messages void DataFlash_Class::Log_Write_ESC(void) { +#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 static int _esc_status_sub = -1; struct esc_status_s esc_status; @@ -1095,4 +1096,5 @@ void DataFlash_Class::Log_Write_ESC(void) } } } +#endif // CONFIG_HAL_BOARD }