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:
parent
1bd781e7b5
commit
565014a1ec
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue