This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DeviceTree Macro: #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)

Hello,

I am trying to get familiar with the DeviceTree macros and started experimenting ...

So, in the light controller example main.c I replaced this macro

#define ADC_DEVICE_NAME DT_LABEL(DT_INST(0, nordic_nrf_saadc))

with this one

#define ADC_DEVICE_NAME DT_LABEL(DT_NODELABEL(adc0))

and added this in the  .overlay file

adc0: adc@4000E000 {
               compatible = "nordic,nrf-saadc"
               label = "ADC_0";
};

I am now getting this build error,

C:/Zypher/v1.3.0/zephyr/include/devicetree.h:169:36: error: 'DT_N_NODELABEL_adc0_P_label' undeclared (first use in this function); did you mean 'DT_N_NODELABEL_sram0_image'?

What am I doing wrong?

Thank you.

Kind regards

Related