AP_OSD: replace HAVE_FILESYSTEM_SUPPORT with backend defines

This commit is contained in:
Peter Barker 2023-05-15 11:44:22 +10:00 committed by Peter Barker
parent 5f2bb83401
commit e7e0da9a59
2 changed files with 11 additions and 3 deletions

View File

@ -19,10 +19,13 @@
/* /*
parameter settings for one screen parameter settings for one screen
*/ */
#include "AP_OSD_config.h"
#if OSD_ENABLED
#include "AP_OSD.h" #include "AP_OSD.h"
#include "AP_OSD_Backend.h" #include "AP_OSD_Backend.h"
#if OSD_ENABLED
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#include <AP_HAL/Util.h> #include <AP_HAL/Util.h>
#include <AP_AHRS/AP_AHRS.h> #include <AP_AHRS/AP_AHRS.h>
@ -868,7 +871,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
AP_SUBGROUPINFO(pluscode, "PLUSCODE", 52, AP_OSD_Screen, AP_OSD_Setting), AP_SUBGROUPINFO(pluscode, "PLUSCODE", 52, AP_OSD_Screen, AP_OSD_Setting),
#endif #endif
#if HAVE_FILESYSTEM_SUPPORT #if AP_OSD_CALLSIGN_FROM_SD_ENABLED
// @Param: CALLSIGN_EN // @Param: CALLSIGN_EN
// @DisplayName: CALLSIGN_EN // @DisplayName: CALLSIGN_EN
// @Description: Displays callsign from callsign.txt on microSD card // @Description: Displays callsign from callsign.txt on microSD card
@ -2162,7 +2165,7 @@ void AP_OSD_Screen::draw_pluscode(uint8_t x, uint8_t y)
*/ */
void AP_OSD_Screen::draw_callsign(uint8_t x, uint8_t y) void AP_OSD_Screen::draw_callsign(uint8_t x, uint8_t y)
{ {
#if HAVE_FILESYSTEM_SUPPORT #if AP_OSD_CALLSIGN_FROM_SD_ENABLED
if (!callsign_data.load_attempted) { if (!callsign_data.load_attempted) {
callsign_data.load_attempted = true; callsign_data.load_attempted = true;
FileData *fd = AP::FS().load_file("callsign.txt"); FileData *fd = AP::FS().load_file("callsign.txt");

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <AP_HAL/AP_HAL_Boards.h> #include <AP_HAL/AP_HAL_Boards.h>
#include <AP_Filesystem/AP_Filesystem_config.h>
#ifndef OSD_ENABLED #ifndef OSD_ENABLED
#define OSD_ENABLED 1 #define OSD_ENABLED 1
@ -17,3 +18,7 @@
#ifndef HAL_OSD_SIDEBAR_ENABLE #ifndef HAL_OSD_SIDEBAR_ENABLE
#define HAL_OSD_SIDEBAR_ENABLE 1 #define HAL_OSD_SIDEBAR_ENABLE 1
#endif #endif
#ifndef AP_OSD_CALLSIGN_FROM_SD_ENABLED
#define AP_OSD_CALLSIGN_FROM_SD_ENABLED (AP_FILESYSTEM_POSIX_ENABLED || AP_FILESYSTEM_FATFS_ENABLED)
#endif