samples: stm32: Set device busy in the blinky sample

This sample turn on/off the LED every two seconds and then sleeps. When
the LED is on we don't want the system putting it down when goes to
sleep. So, just setting this device as busy.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-05-06 22:16:10 -07:00 committed by Anas Nashif
commit 565014a1ec

View file

@ -21,6 +21,9 @@ void main(void)
__ASSERT_NO_MSG(device_is_ready(led.port));
/* Don't let the system power off / low power this device */
device_busy_set(led.port);
while (true) {
gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
gpio_pin_set(led.port, led.pin, (int)led_is_on);