mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AP_HAL_Linux: adapt Heat_Pwm for Edge
This commit is contained in:
parent
069c98b8a9
commit
79c14a92a9
@ -15,7 +15,10 @@
|
||||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || \
|
||||
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO || \
|
||||
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_EDGE
|
||||
|
||||
#include <cmath>
|
||||
#include <fcntl.h>
|
||||
#include <linux/limits.h>
|
||||
@ -37,7 +40,13 @@ HeatPwm::HeatPwm(uint8_t pwm_num, float Kp, float Ki, uint32_t period_ns) :
|
||||
_Ki(Ki),
|
||||
_period_ns(period_ns)
|
||||
{
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_EDGE
|
||||
_pwm = new PWM_Sysfs(0, pwm_num);
|
||||
hal.gpio->pinMode(26, HAL_GPIO_OUTPUT);
|
||||
hal.gpio->write(26, 1);
|
||||
#else
|
||||
_pwm = new PWM_Sysfs_Bebop(pwm_num);
|
||||
#endif
|
||||
_pwm->init();
|
||||
_pwm->set_period(_period_ns);
|
||||
_pwm->set_duty_cycle(0);
|
||||
|
Loading…
Reference in New Issue
Block a user