forked from Archive/PX4-Autopilot
Rely on theoretical value, as the closed-loop test with multimeter suggests this is the most accurate measurement
This commit is contained in:
parent
178b0f7399
commit
07d11583bb
|
@ -751,7 +751,7 @@ registers_get(uint8_t page, uint8_t offset, uint16_t **values, unsigned *num_val
|
|||
*/
|
||||
unsigned counts = adc_measure(ADC_VBATT);
|
||||
if (counts != 0xffff) {
|
||||
unsigned mV = (0 + (counts * 4593)) / 1000;
|
||||
unsigned mV = (166460 + (counts * 45934)) / 10000;
|
||||
unsigned corrected = (mV * r_page_setup[PX4IO_P_SETUP_VBATT_SCALE]) / 10000;
|
||||
|
||||
r_page_status[PX4IO_P_STATUS_VBATT] = corrected;
|
||||
|
|
Loading…
Reference in New Issue