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:Luca Burelli <l.burelli@arduino.cc>
Loading
Please sign in to comment