I have a sample program, threads, that I have working on the dongle, however, when I try and build it for the DK, it fails. The program has the following statements in it:
#define LED0_NODE DT_ALIAS(led0)
#define LED1_RED_NODE DT_ALIAS(led1_red)
#define LED1_GREEN_NODE DT_ALIAS(led1_green)
#define LED1_BLUE_NODE DT_ALIAS(led1_blue)
...
static const struct led led0 = {
.spec = GPIO_DT_SPEC_GET_OR(LED0_NODE, gpios, {0}),
.num = 0,
};
static const struct led led1_red = {
.spec = GPIO_DT_SPEC_GET_OR(LED1_RED_NODE, gpios, {0}),
.num = 1,
};
static const struct led led1_green = {
.spec = GPIO_DT_SPEC_GET_OR(LED1_GREEN_NODE, gpios, {0}),
.num = 2,
};
static const struct led led1_blue = {
.spec = GPIO_DT_SPEC_GET_OR(LED1_BLUE_NODE, gpios, {0}),
.num = 3,
};
#if !DT_NODE_HAS_STATUS(LED0_NODE, okay)
#error "Unsupported board: led0 devicetree alias is not defined"
#endif
I have no idea where LED0_NODE is defined; the string does not appear in any of my application directories. But clearly is defined somewhere because the build process finds it when I build it for the dongle but doesn't when I build for the DK.
I assume this is some kind of hardware abstraction but I don't understand how it works; can anyone of you help?