From 9632659e635768024db8f14f76c9e0adb6619107 Mon Sep 17 00:00:00 2001 From: Peter van der Perk Date: Sun, 2 Jun 2024 11:19:59 +0200 Subject: [PATCH] rgbled_pwm: Change linker so we can make board specific override for led functionality --- platforms/nuttx/src/px4/nxp/imxrt/led_pwm/led_pwm.cpp | 3 ++- src/drivers/lights/rgbled_pwm/CMakeLists.txt | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platforms/nuttx/src/px4/nxp/imxrt/led_pwm/led_pwm.cpp b/platforms/nuttx/src/px4/nxp/imxrt/led_pwm/led_pwm.cpp index ddee5aa8ca0d..ea69d43dc892 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/led_pwm/led_pwm.cpp +++ b/platforms/nuttx/src/px4/nxp/imxrt/led_pwm/led_pwm.cpp @@ -61,6 +61,7 @@ #include #include "hardware/imxrt_tmr.h" +#ifndef BOARD_HAS_CUSTOM_LED_PWM int led_pwm_servo_set(unsigned channel, uint8_t cvalue) { return 0; @@ -68,8 +69,8 @@ int led_pwm_servo_set(unsigned channel, uint8_t cvalue) int led_pwm_servo_init(void) { return 0; - } +#endif #if 0 && defined(BOARD_HAS_LED_PWM) || defined(BOARD_HAS_UI_LED_PWM) diff --git a/src/drivers/lights/rgbled_pwm/CMakeLists.txt b/src/drivers/lights/rgbled_pwm/CMakeLists.txt index 2001cdc4921d..6fc41d0301bd 100644 --- a/src/drivers/lights/rgbled_pwm/CMakeLists.txt +++ b/src/drivers/lights/rgbled_pwm/CMakeLists.txt @@ -41,3 +41,8 @@ px4_add_module( arch_io_pins arch_led_pwm ) + +target_link_libraries(drivers__rgbled_pwm + PRIVATE + drivers_board # Allows board to override PWM functions +)