DT_ALIAS issue

i have these aliases setup in the .dts file.

aliases {
        red_led         = &led0;
        grn_led         = &led1;
        blu_led         = &led2;
//      led3            = &led3;
//      watchdog0       = &wdt0;
//      mcuboot-led0    = &led0;
//      bootloader-led0 = &led0;
      sw0             = &button0;
//      sw1             = &button1;
//      sw2             = &button2;
//      sw3             = &button3;
//      mcuboot-button0 = &button0;
        red_pwm         = &pwm_led0;
        grn_pwm         = &pwm_led1;
        blu_pwm         = &pwm_led2;
    };
};
so why is this ok
#define SW0_BUTTON           DT_ALIAS(sw0)
#if !DT_NODE_HAS_STATUS(SW0_BUTTON, okay)
#error "Unsupported board: sw0 devicetree alias is not defined"
#endif
 
but this fails compilation with the error "Unsupported board: pwm_led devicetree alias is not defined" ?
#define PWM_RED_LED        DT_ALIAS(red_pwm)
#if !DT_NODE_HAS_STATUS(PWM_RED_LED, okay)
#error "Unsupported board: pwm_led devicetree alias is not defined"
#endif


Parents Reply Children
No Data
Related