mirror of https://github.com/ArduPilot/ardupilot
AP_HAL_VRBRAIN: use ARRAY_SIZE macro
This commit is contained in:
parent
473415a3c2
commit
3f472fb9e1
|
@ -108,7 +108,7 @@ float VRBRAINAnalogSource::read_latest()
|
|||
float VRBRAINAnalogSource::_pin_scaler(void)
|
||||
{
|
||||
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++) {
|
||||
if (pin_scaling[i].pin == _pin) {
|
||||
scaling = pin_scaling[i].scaling;
|
||||
|
|
Loading…
Reference in New Issue