mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-24 02:24:09 +08:00
heater: fix invalid file descriptor
We need to open the device later in the work queue and not in the constructor during task_spawn. There is already a lazy open in place, so just removing this fixes the problem for me.
This commit is contained in:
@@ -64,16 +64,6 @@ Heater::Heater() :
|
||||
ModuleParams(nullptr),
|
||||
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default)
|
||||
{
|
||||
#ifdef HEATER_PX4IO
|
||||
_io_fd = px4_open(IO_HEATER_DEVICE_PATH, O_RDWR);
|
||||
|
||||
if (_io_fd < 0) {
|
||||
PX4_ERR("Unable to open heater device path");
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
_heater_status_pub.advertise();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user