SITL: correct MegaSquirt simulation

This commit is contained in:
Peter Barker 2023-06-27 00:03:04 +10:00 committed by Andrew Tridgell
parent 3f730a8a94
commit 2f710a4689

View File

@ -20,6 +20,7 @@
#include <SITL/SITL.h> #include <SITL/SITL.h>
#include <AP_HAL/utility/sparse-endian.h> #include <AP_HAL/utility/sparse-endian.h>
#include <stdio.h> #include <stdio.h>
#include "SIM_EFI_MegaSquirt.h"
using namespace SITL; using namespace SITL;
@ -37,7 +38,7 @@ static uint32_t CRC32_MS(const uint8_t *buf, uint32_t len)
void EFI_MegaSquirt::update() void EFI_MegaSquirt::update()
{ {
auto sitl = AP::sitl(); auto sitl = AP::sitl();
if (!sitl || sitl->efi_type == SIM::EFI_TYPE_NONE) { if (!sitl || sitl->efi_type != SIM::EFI_TYPE_MS) {
return; return;
} }
float rpm = sitl->state.rpm[0]; float rpm = sitl->state.rpm[0];