AP_HAL_VRBRAIN: use ARRAY_SIZE macro

This commit is contained in:
Lucas De Marchi 2015-07-20 16:53:47 -03:00 committed by Randy Mackay
parent 473415a3c2
commit 3f472fb9e1
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ float VRBRAINAnalogSource::read_latest()
float VRBRAINAnalogSource::_pin_scaler(void) float VRBRAINAnalogSource::_pin_scaler(void)
{ {
float scaling = VRBRAIN_VOLTAGE_SCALING; float scaling = VRBRAIN_VOLTAGE_SCALING;
uint8_t num_scalings = sizeof(pin_scaling)/sizeof(pin_scaling[0]); uint8_t num_scalings = ARRAY_SIZE(pin_scaling);
for (uint8_t i=0; i<num_scalings; i++) { for (uint8_t i=0; i<num_scalings; i++) {
if (pin_scaling[i].pin == _pin) { if (pin_scaling[i].pin == _pin) {
scaling = pin_scaling[i].scaling; scaling = pin_scaling[i].scaling;