Skip to content
Commit 5992afae authored by Martí Bolívar's avatar Martí Bolívar Committed by Carles Cufi
Browse files

samples: can: devicetree cleanups



Replace DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL with DEVICE_DT_GET on the
chosen node itself.

This is causing a build error in CI for the waveshare_open103z board
because it disables CAN by default in favor of USB. Throw in an
overlay reversing that decision for the sake of this sample to keep
things building. (Though the build previously succeeded, the
device_get_binding() call would simply have failed.)

Replace the LED access with GPIO_DT_SPEC_GET_OR. This changes the
semantics slightly so that the simulated LED implemented via printk()
is run if either the node is missing or the pin cannot be configured,
instead of just running when the node is missing. An unready LED port
when the node is defined still returns early from main.

Signed-off-by: default avatarMartí Bolívar <marti.bolivar@nordicsemi.no>
parent bb46d8b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment