Skip to content
Commit 187a8ad0 authored by Luca Burelli's avatar Luca Burelli Committed by Benjamin Cabé
Browse files

samples: fade_led: fix build error when PWM is not enabled



Some boards may define LEDs but disable them by default due to conflicts
with other peripherals. In this case, the new sample code introduced in
a5fd92b0 ("samples: fade_led: use all available LEDs") fails to build
with a missing symbol error.

Fix this by checking if the PWM device (the parent of the LED alias) is
enabled before using it. This implicitly discards invalid aliases.

Signed-off-by: default avatarLuca Burelli <l.burelli@arduino.cc>
parent ac018793
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment