boot/boot_serial: call idle for reducing power in single thread

Sine zephyr https://github.com/zephyrproject-rtos/zephyr/pull/34279
was merged there is no silent idle thread created automatically while
CONFIG_MULTITHREADING=n. Since that any single thread application
needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE)
by itself for entering idle mode, which allows for reduction
power consumption.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
Andrzej Puzdrowski 2021-06-11 12:28:59 +02:00
parent 142b339667
commit aea38eb03a
1 changed files with 1 additions and 0 deletions

View File

@ -613,6 +613,7 @@ boot_serial_start(const struct boot_uart_funcs *f)
off = 0;
while (1) {
MCUBOOT_CPU_IDLE();
rc = f->read(in_buf + off, sizeof(in_buf) - off, &full_line);
if (rc <= 0 && !full_line) {
continue;