mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_Mission: Use a static assert to check content size
This commit is contained in:
parent
a2002180ee
commit
db6d8c9c43
@ -41,10 +41,8 @@ void AP_Mission::init()
|
||||
// command list will be cleared if they do not match
|
||||
check_eeprom_version();
|
||||
|
||||
// prevent an easy programming error, this will be optimised out
|
||||
if (sizeof(union Content) != 12) {
|
||||
AP_HAL::panic("AP_Mission Content must be 12 bytes");
|
||||
}
|
||||
// changes in Content size break the storage
|
||||
static_assert(sizeof(union Content) == 12, "AP_Mission: Content must be 12 bytes");
|
||||
|
||||
_last_change_time_ms = AP_HAL::millis();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user