From 9213eef56ce4ff34c25dfd4b126d43169789e4db Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 14 Dec 2023 10:20:16 +1100 Subject: [PATCH] AP_Generator: add ASSERT_STORAGE_SIZE macro saves havin gto name the dummy variable yourself --- libraries/AP_Generator/AP_Generator_RichenPower.cpp | 2 ++ libraries/AP_Generator/AP_Generator_RichenPower.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.cpp b/libraries/AP_Generator/AP_Generator_RichenPower.cpp index 530f8192b3..cbfc2fcdeb 100644 --- a/libraries/AP_Generator/AP_Generator_RichenPower.cpp +++ b/libraries/AP_Generator/AP_Generator_RichenPower.cpp @@ -30,6 +30,8 @@ extern const AP_HAL::HAL& hal; // init method; configure communications with the generator void AP_Generator_RichenPower::init() { + ASSERT_STORAGE_SIZE(RichenPacket, 70); + const AP_SerialManager &serial_manager = AP::serialmanager(); uart = serial_manager.find_serial(AP_SerialManager::SerialProtocol_Generator, 0); diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.h b/libraries/AP_Generator/AP_Generator_RichenPower.h index c5999c0ed6..bd9bfc25d9 100644 --- a/libraries/AP_Generator/AP_Generator_RichenPower.h +++ b/libraries/AP_Generator/AP_Generator_RichenPower.h @@ -153,7 +153,6 @@ private: uint8_t footermagic1; uint8_t footermagic2; }; - assert_storage_size _assert_storage_size_RichenPacket UNUSED_PRIVATE_MEMBER; union RichenUnion { uint8_t parse_buffer[70];