mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -04:00
AP_IOMCU: support forcing heater to enabled with a feature bit
This commit is contained in:
parent
9fd4298377
commit
2f1c38e13a
@ -44,6 +44,10 @@ enum ioevents {
|
|||||||
// an error
|
// an error
|
||||||
#define IOMCU_MAX_REPEATED_FAILURES 20
|
#define IOMCU_MAX_REPEATED_FAILURES 20
|
||||||
|
|
||||||
|
#ifndef AP_IOMCU_FORCE_ENABLE_HEATER
|
||||||
|
#define AP_IOMCU_FORCE_ENABLE_HEATER 0
|
||||||
|
#endif
|
||||||
|
|
||||||
AP_IOMCU::AP_IOMCU(AP_HAL::UARTDriver &_uart) :
|
AP_IOMCU::AP_IOMCU(AP_HAL::UARTDriver &_uart) :
|
||||||
uart(_uart)
|
uart(_uart)
|
||||||
{
|
{
|
||||||
@ -142,6 +146,14 @@ void AP_IOMCU::thread_main(void)
|
|||||||
event_failed(mask);
|
event_failed(mask);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if AP_IOMCU_FORCE_ENABLE_HEATER
|
||||||
|
if (!modify_register(PAGE_SETUP, PAGE_REG_SETUP_FEATURES, 0,
|
||||||
|
P_SETUP_FEATURES_HEATER)) {
|
||||||
|
event_failed(mask);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
mask &= ~EVENT_MASK(IOEVENT_INIT);
|
mask &= ~EVENT_MASK(IOEVENT_INIT);
|
||||||
|
|
||||||
|
@ -536,6 +536,9 @@ bool AP_IOMCU_FW::handle_code_write()
|
|||||||
} else {
|
} else {
|
||||||
palSetLine(HAL_GPIO_PIN_SBUS_OUT_EN);
|
palSetLine(HAL_GPIO_PIN_SBUS_OUT_EN);
|
||||||
}
|
}
|
||||||
|
if (reg_setup.features & P_SETUP_FEATURES_HEATER) {
|
||||||
|
has_heater = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAGE_REG_SETUP_HEATER_DUTY_CYCLE:
|
case PAGE_REG_SETUP_HEATER_DUTY_CYCLE:
|
||||||
|
@ -66,6 +66,7 @@ enum iopage {
|
|||||||
#define P_SETUP_FEATURES_ADC_RSSI 8
|
#define P_SETUP_FEATURES_ADC_RSSI 8
|
||||||
#define P_SETUP_FEATURES_ONESHOT 16
|
#define P_SETUP_FEATURES_ONESHOT 16
|
||||||
#define P_SETUP_FEATURES_BRUSHED 32
|
#define P_SETUP_FEATURES_BRUSHED 32
|
||||||
|
#define P_SETUP_FEATURES_HEATER 64
|
||||||
|
|
||||||
#define PAGE_REG_SETUP_ARMING 1
|
#define PAGE_REG_SETUP_ARMING 1
|
||||||
#define P_SETUP_ARMING_IO_ARM_OK (1<<0)
|
#define P_SETUP_ARMING_IO_ARM_OK (1<<0)
|
||||||
|
Loading…
Reference in New Issue
Block a user