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