From a3593d7d07ec2cdf6b4b54de63b0f51636d23b35 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 22 Apr 2021 04:53:58 -0700 Subject: [PATCH] analog_battery:Use inttytpes --- src/modules/battery_status/analog_battery.cpp | 7 ++++--- src/modules/battery_status/analog_battery.h | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/modules/battery_status/analog_battery.cpp b/src/modules/battery_status/analog_battery.cpp index dc649217b4..51b4fbd3f7 100644 --- a/src/modules/battery_status/analog_battery.cpp +++ b/src/modules/battery_status/analog_battery.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2019-2020 PX4 Development Team. All rights reserved. + * Copyright (c) 2019-2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -119,6 +119,7 @@ int AnalogBattery::get_current_channel() } } + void AnalogBattery::updateParams() { @@ -127,8 +128,8 @@ AnalogBattery::updateParams() &_analog_params.v_div, _first_parameter_update); migrateParam(_analog_param_handles.a_per_v_old, _analog_param_handles.a_per_v, &_analog_params.a_per_v_old, &_analog_params.a_per_v, _first_parameter_update); - migrateParam(_analog_param_handles.adc_channel_old, _analog_param_handles.v_channel, - &_analog_params.adc_channel_old, &_analog_params.v_channel, _first_parameter_update); + migrateParam(_analog_param_handles.adc_channel_old, _analog_param_handles.v_channel, + &_analog_params.adc_channel_old, &_analog_params.v_channel, _first_parameter_update); } else { param_get(_analog_param_handles.v_div, &_analog_params.v_div); diff --git a/src/modules/battery_status/analog_battery.h b/src/modules/battery_status/analog_battery.h index ce42b103b5..ddfc8e72a8 100644 --- a/src/modules/battery_status/analog_battery.h +++ b/src/modules/battery_status/analog_battery.h @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2019-2020 PX4 Development Team. All rights reserved. + * Copyright (c) 2019-2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -88,12 +88,12 @@ protected: float v_offs_cur; float v_div; float a_per_v; - int v_channel; - int i_channel; + int32_t v_channel; + int32_t i_channel; float v_div_old; float a_per_v_old; - int adc_channel_old; + int32_t adc_channel_old; } _analog_params; virtual void updateParams() override;