boot: introduce MCUBOOT_CPU_IDLE() for support low power single thread
Introduced MCUBOOT_CPU_IDLE() macro. If a port supports single thread or is bare-metal then might be need to switch to idle mode explicitly form MCUboot code. The call allows to enable lower power consumption while waiting for incoming transmission in serial recovery etc. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
d5e9902352
commit
142b339667
|
@ -152,4 +152,11 @@
|
|||
#define NUM_ECC_BYTES (256 / 8)
|
||||
#endif /* ENC_IMG */
|
||||
|
||||
/*
|
||||
* No direct idle call implemented
|
||||
*/
|
||||
#define MCUBOOT_CPU_IDLE() \
|
||||
do { \
|
||||
} while (0)
|
||||
|
||||
#endif /* MCUBOOT_CONFIG_H */
|
||||
|
|
|
@ -79,5 +79,11 @@
|
|||
do { \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* No direct idle call implemented
|
||||
*/
|
||||
#define MCUBOOT_CPU_IDLE() \
|
||||
do { \
|
||||
} while (0)
|
||||
|
||||
#endif /* __MCUBOOT_CONFIG_H__ */
|
||||
|
|
|
@ -101,4 +101,11 @@
|
|||
#define MCUBOOT_WATCHDOG_FEED() do {} while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* No direct idle call implemented
|
||||
*/
|
||||
#define MCUBOOT_CPU_IDLE() \
|
||||
do { \
|
||||
} while (0)
|
||||
|
||||
#endif /* __MCUBOOT_CONFIG_H__ */
|
||||
|
|
|
@ -205,4 +205,9 @@
|
|||
|
||||
#endif /* CONFIG_BOOT_WATCHDOG_FEED */
|
||||
|
||||
#define MCUBOOT_CPU_IDLE() \
|
||||
if (!IS_ENABLED(CONFIG_MULTITHREADING)) { \
|
||||
k_cpu_idle(); \
|
||||
}
|
||||
|
||||
#endif /* __MCUBOOT_CONFIG_H__ */
|
||||
|
|
|
@ -146,4 +146,14 @@
|
|||
* do { do watchdog feeding here! } while (0)
|
||||
*/
|
||||
|
||||
/* If a OS ports support single thread mode or is bare-metal then:
|
||||
* This macro implements call that switches CPU to an idle state, from which
|
||||
* the CPU may be woken up by, for example, UART transmission event.
|
||||
*
|
||||
* Otherwise this macro should be no-op.
|
||||
*/
|
||||
#define MCUBOOT_CPU_IDLE() \
|
||||
do { \
|
||||
} while (0)
|
||||
|
||||
#endif /* __MCUBOOT_CONFIG_H__ */
|
||||
|
|
Loading…
Reference in New Issue