Skip to content

Commit

Permalink
boot/boot_serial: call idle for reducing power in single thread
Browse files Browse the repository at this point in the history
Sine zephyr zephyrproject-rtos/zephyr#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>
  • Loading branch information
nvlsianpu committed Jun 17, 2021
1 parent 142b339 commit aea38eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions boot/boot_serial/src/boot_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aea38eb

Please sign in to comment.