mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
analog_battery:Use inttytpes
This commit is contained in:
committed by
Julian Oes
parent
9c87766021
commit
a3593d7d07
@@ -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<float>(_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<int>(_analog_param_handles.adc_channel_old, _analog_param_handles.v_channel,
|
||||
&_analog_params.adc_channel_old, &_analog_params.v_channel, _first_parameter_update);
|
||||
migrateParam<int32_t>(_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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user