mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 12:48:53 +08:00
boards: new ARK FPV FC (#23830)
* add new payload power switch (RC_MAP_PAY_SW)
This commit is contained in:
@@ -204,6 +204,9 @@ void ADC::update_system_power(hrt_abstime now)
|
||||
# if defined(ADC_SCALED_V5_SENSE) && defined(ADC_SCALED_V3V3_SENSORS_SENSE)
|
||||
cnt += ADC_SCALED_V3V3_SENSORS_COUNT;
|
||||
# endif
|
||||
# if defined(ADC_SCALED_PAYLOAD_SENSE)
|
||||
cnt++;
|
||||
# endif
|
||||
|
||||
for (unsigned i = 0; i < _channel_count; i++) {
|
||||
# if defined(ADC_SCALED_V5_SENSE)
|
||||
@@ -234,6 +237,16 @@ void ADC::update_system_power(hrt_abstime now)
|
||||
}
|
||||
|
||||
# endif
|
||||
# if defined(ADC_SCALED_PAYLOAD_SENSE)
|
||||
|
||||
if (_samples[i].am_channel == ADC_SCALED_PAYLOAD_SENSE) {
|
||||
system_power.voltage_payload_v = _samples[i].am_data * ((ADC_PAYLOAD_V_FULL_SCALE / 3.3f) *
|
||||
(px4_arch_adc_reference_v() /
|
||||
px4_arch_adc_dn_fullcount()));
|
||||
cnt--;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
if (cnt == 0) {
|
||||
break;
|
||||
@@ -285,6 +298,9 @@ void ADC::update_system_power(hrt_abstime now)
|
||||
#ifdef BOARD_GPIO_VDD_5V_CAN1_GPS1_VALID
|
||||
system_power.can1_gps1_5v_valid = read_gpio_value(_5v_can1_gps1_valid_fd);
|
||||
#endif
|
||||
#ifdef BOARD_GPIO_PAYOLOAD_V_VALID
|
||||
system_power.payload_v_valid = BOARD_GPIO_PAYOLOAD_V_VALID;
|
||||
#endif
|
||||
|
||||
system_power.timestamp = hrt_absolute_time();
|
||||
_to_system_power.publish(system_power);
|
||||
|
||||
Reference in New Issue
Block a user