From f134a1df3495cca4523eb6b53ab6f2ead715b705 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 9 Nov 2023 14:56:36 +1100 Subject: [PATCH] AP_HAL_SITL: add simulator Hirth EFI --- libraries/AP_HAL_SITL/SITL_State_common.cpp | 9 +++++++++ libraries/AP_HAL_SITL/SITL_State_common.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/libraries/AP_HAL_SITL/SITL_State_common.cpp b/libraries/AP_HAL_SITL/SITL_State_common.cpp index 10b2103fb0..260a9b28da 100644 --- a/libraries/AP_HAL_SITL/SITL_State_common.cpp +++ b/libraries/AP_HAL_SITL/SITL_State_common.cpp @@ -251,6 +251,12 @@ SITL::SerialDevice *SITL_State_Common::create_serial_sim(const char *name, const } efi_ms = new SITL::EFI_MegaSquirt(); return efi_ms; + } else if (streq(name, "hirth")) { + if (efi_hirth != nullptr) { + AP_HAL::panic("Only one hirth at a time"); + } + efi_hirth = new SITL::EFI_Hirth(); + return efi_hirth; } else if (streq(name, "VectorNav")) { if (vectornav != nullptr) { AP_HAL::panic("Only one VectorNav at a time"); @@ -372,6 +378,9 @@ void SITL_State_Common::sim_update(void) if (efi_ms != nullptr) { efi_ms->update(); } + if (efi_hirth != nullptr) { + efi_hirth->update(); + } if (frsky_d != nullptr) { frsky_d->update(); diff --git a/libraries/AP_HAL_SITL/SITL_State_common.h b/libraries/AP_HAL_SITL/SITL_State_common.h index bed95fd9ce..e7b82c2c91 100644 --- a/libraries/AP_HAL_SITL/SITL_State_common.h +++ b/libraries/AP_HAL_SITL/SITL_State_common.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -212,6 +213,9 @@ public: // simulated EFI MegaSquirt device: SITL::EFI_MegaSquirt *efi_ms; + // simulated EFI MegaSquirt device: + SITL::EFI_Hirth *efi_hirth; + // output socket for flightgear viewing SocketAPM fg_socket{true};