mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 14:23:34 +08:00
heater: px4io: Add support for heaters on IO MCU
This commit is contained in:
committed by
Lorenz Meier
parent
653fef56de
commit
8e8497ff77
@@ -65,6 +65,7 @@
|
||||
#include <drivers/drv_pwm_output.h>
|
||||
#include <drivers/drv_sbus.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <drivers/drv_io_heater.h>
|
||||
#include <drivers/drv_mixer.h>
|
||||
|
||||
#include <rc/dsm.h>
|
||||
@@ -2931,6 +2932,20 @@ PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
||||
|
||||
break;
|
||||
|
||||
case PX4IO_HEATER_CONTROL:
|
||||
if (arg == (unsigned long)HEATER_MODE_DISABLED) {
|
||||
io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_THERMAL, PX4IO_THERMAL_IGNORE);
|
||||
|
||||
} else if (arg == 1) {
|
||||
io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_THERMAL, PX4IO_THERMAL_FULL);
|
||||
|
||||
} else {
|
||||
io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_THERMAL, PX4IO_THERMAL_OFF);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
/* see if the parent class can make any use of it */
|
||||
ret = CDev::ioctl(filep, cmd, arg);
|
||||
|
||||
Reference in New Issue
Block a user