From 36204e5daea71ea936730b7e0cc6f6f163195650 Mon Sep 17 00:00:00 2001 From: Vinicius Juvinski Date: Tue, 7 Jul 2020 16:26:54 -0300 Subject: [PATCH] AP_HAL_Linux: Fix PWM FS to follow the Kernel's 4.X instead 3.9 Checking the ToneAlarm under AP_HAL_Linux(BBBMINI is using that) I realize was using old kernek 3.9 device tree, so I updated to 4.X - this will affect only BBBMINI and Blue boards. --- libraries/AP_HAL_Linux/ToneAlarm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_Linux/ToneAlarm.cpp b/libraries/AP_HAL_Linux/ToneAlarm.cpp index fcc26ddf4d..a897eb4921 100644 --- a/libraries/AP_HAL_Linux/ToneAlarm.cpp +++ b/libraries/AP_HAL_Linux/ToneAlarm.cpp @@ -20,9 +20,9 @@ ToneAlarm::ToneAlarm() #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BLUE || \ CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF || \ CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI - period_fd = open("/sys/devices/ocp.3/pwm_test_P8_36.12/period",O_WRONLY|O_CLOEXEC); - duty_fd = open("/sys/devices/ocp.3/pwm_test_P8_36.12/duty",O_WRONLY|O_CLOEXEC); - run_fd = open("/sys/devices/ocp.3/pwm_test_P8_36.12/run",O_WRONLY|O_CLOEXEC); + period_fd = open("/sys/class/pwm/pwmchip0/pwm0/period",O_WRONLY|O_CLOEXEC); + duty_fd = open("/sys/class/pwm/pwmchip0/pwm0/duty_cycle",O_WRONLY|O_CLOEXEC); + run_fd = open("/sys/class/pwm/pwmchip0/pwm0/enable",O_WRONLY|O_CLOEXEC); #endif }