mirror of https://github.com/ArduPilot/ardupilot
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
|
// command list will be cleared if they do not match
|
||||||
check_eeprom_version();
|
check_eeprom_version();
|
||||||
|
|
||||||
// prevent an easy programming error, this will be optimised out
|
// changes in Content size break the storage
|
||||||
if (sizeof(union Content) != 12) {
|
static_assert(sizeof(union Content) == 12, "AP_Mission: Content must be 12 bytes");
|
||||||
AP_HAL::panic("AP_Mission Content must be 12 bytes");
|
|
||||||
}
|
|
||||||
|
|
||||||
_last_change_time_ms = AP_HAL::millis();
|
_last_change_time_ms = AP_HAL::millis();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue