From fb50ec2a1dd80f8af79c1e8c8755fc80b19e1672 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 1 Aug 2019 15:14:11 +1000 Subject: [PATCH] AP_Notify: convert to use AP_Filesystem --- libraries/AP_Notify/ToneAlarm.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libraries/AP_Notify/ToneAlarm.cpp b/libraries/AP_Notify/ToneAlarm.cpp index 0211d13e3e..768e60d833 100644 --- a/libraries/AP_Notify/ToneAlarm.cpp +++ b/libraries/AP_Notify/ToneAlarm.cpp @@ -26,11 +26,7 @@ #include -#if HAL_OS_POSIX_IO -#include -#include -#include -#endif +#include extern const AP_HAL::HAL& hal; @@ -119,13 +115,13 @@ bool AP_ToneAlarm::init() _cont_tone_playing = -1; hal.scheduler->register_timer_process(FUNCTOR_BIND(this, &AP_ToneAlarm::_timer_task, void)); -#if (HAL_OS_POSIX_IO || HAL_OS_FATFS_IO) && CONFIG_HAL_BOARD != HAL_BOARD_LINUX +#if HAVE_FILESYSTEM_SUPPORT && CONFIG_HAL_BOARD != HAL_BOARD_LINUX // if we don't have a SDcard then play a failure tone instead of // normal startup tone. This gives the user a chance to fix it // before they try to arm. We don't do this on Linux as Linux // flight controllers don't usually have removable storage struct stat st; - if (stat(HAL_BOARD_STORAGE_DIRECTORY, &st) != 0) { + if (AP::FS().stat(HAL_BOARD_STORAGE_DIRECTORY, &st) != 0) { play_tone(AP_NOTIFY_TONE_NO_SDCARD); return true; }