AP_ADC: fixed APM1 HIL_SENSORS Ch6() return
This commit is contained in:
parent
a69c9ff674
commit
5667f5d817
@ -60,7 +60,10 @@ uint32_t AP_ADC_HIL::Ch6(const uint8_t *channel_numbers, float *result)
|
|||||||
for (uint8_t i=0; i<6; i++) {
|
for (uint8_t i=0; i<6; i++) {
|
||||||
result[i] = Ch(channel_numbers[i]);
|
result[i] = Ch(channel_numbers[i]);
|
||||||
}
|
}
|
||||||
return ((hal.scheduler->millis() - last_hil_time)*2)/5;
|
uint32_t now = hal.scheduler->micros();
|
||||||
|
uint32_t ret = now - _last_ch6_time;
|
||||||
|
_last_ch6_time = now;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set one channel value
|
// Set one channel value
|
||||||
|
@ -56,8 +56,8 @@ private:
|
|||||||
// The raw adc array
|
// The raw adc array
|
||||||
uint16_t adcValue[8];
|
uint16_t adcValue[8];
|
||||||
|
|
||||||
// the time in milliseconds when we last got a HIL update
|
// the time in microseconds when Ch6 was last requested
|
||||||
uint32_t last_hil_time;
|
uint32_t _last_ch6_time;
|
||||||
|
|
||||||
///
|
///
|
||||||
// sensor constants
|
// sensor constants
|
||||||
|
Loading…
Reference in New Issue
Block a user