APM_Control: use ARRAY_SIZE

This commit is contained in:
Lucas De Marchi 2015-07-17 13:43:22 -03:00 committed by Randy Mackay
parent fb2eb262e7
commit 4a595bd797

View File

@ -125,8 +125,8 @@ void AP_AutoTune::start(void)
restore = current;
uint8_t level = aparm.autotune_level;
if (level > sizeof(tuning_table)/sizeof(tuning_table[0])) {
level = sizeof(tuning_table)/sizeof(tuning_table[0]);
if (level > ARRAY_SIZE(tuning_table)) {
level = ARRAY_SIZE(tuning_table);
}
if (level < 1) {
level = 1;