led0 works even if disabled. and doesnt appear in the GUI when enabled.

Hello, 
while writing a simple uart application, I noticed something peculiar in my code.
I add led toggaling so I'd know if the code runs or not.
I forgot that I disabled led0 node earlier due to pin conflict with PWM (both on pin 13).
nevertheless, the led toggling still worked.
when I tried setting the led0 to okay, it worked as well.
here is how I set the toggling:

static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
.
.
.

if (!device_is_ready(led0.port)) {
printk("GPIO device is not ready\n");
return 1;
}
.
.
.
.
int ret = gpio_pin_configure_dt(&led0, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
return 1;
}

My questions are:

1. How could it be that I was able to work with ledo although it was disabled.
2. Why both led0 and PWM are configured by default to pin 13 of port 0? was it intended to be like that? 

Thanks in advance,

-Shlomo

Related