ArduPlane: use ARRAY_SIZE macro

This commit is contained in:
Lucas De Marchi 2015-07-06 12:30:40 -03:00 committed by Andrew Tridgell
parent 0bc09adc78
commit e97034f8e9
3 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ void Plane::setup()
init_ardupilot();
// initialise the main loop scheduler
scheduler.init(&scheduler_tasks[0], sizeof(scheduler_tasks)/sizeof(scheduler_tasks[0]));
scheduler.init(&scheduler_tasks[0], ARRAY_SIZE(scheduler_tasks));
}
void Plane::loop()

View File

@ -523,7 +523,7 @@ void Plane::start_logging()
*/
void Plane::log_init(void)
{
DataFlash.Init(log_structure, sizeof(log_structure)/sizeof(log_structure[0]));
DataFlash.Init(log_structure, ARRAY_SIZE(log_structure));
if (!DataFlash.CardInserted()) {
gcs_send_text_P(SEVERITY_LOW, PSTR("No dataflash card inserted"));
g.log_bitmask.set(0);

View File

@ -1257,7 +1257,7 @@ void Plane::load_parameters(void)
uint32_t before = micros();
// Load all auto-loaded EEPROM variables
AP_Param::load_all();
AP_Param::convert_old_parameters(&conversion_table[0], sizeof(conversion_table)/sizeof(conversion_table[0]));
AP_Param::convert_old_parameters(&conversion_table[0], ARRAY_SIZE(conversion_table));
cliSerial->printf_P(PSTR("load_all took %luus\n"), micros() - before);
}
}