mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-03 08:20:35 +08:00
Update adc.cpp
This commit is contained in:
committed by
Lorenz Meier
parent
9833ef13fb
commit
69d0a78c54
@@ -350,12 +350,14 @@ ADC::update_system_power(hrt_abstime now)
|
||||
system_power.voltage5V_v = 0;
|
||||
|
||||
#if defined(ADC_5V_RAIL_SENSE)
|
||||
|
||||
for (unsigned i = 0; i < _channel_count; i++) {
|
||||
if (_samples[i].am_channel == ADC_5V_RAIL_SENSE) {
|
||||
// it is 2:1 scaled
|
||||
system_power.voltage5V_v = _samples[i].am_data * (6.6f / 4096);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Note once the board_config.h provides BOARD_ADC_USB_CONNECTED,
|
||||
|
||||
Reference in New Issue
Block a user