Skip to content

Commit

Permalink
Merge pull request #14429 from benpicco/core/boot_msg
Browse files Browse the repository at this point in the history
core/init: make boot message configurable
  • Loading branch information
leandrolanzieri committed Jul 28, 2020
2 parents 0b1a793 + 25e67e0 commit 72d6d90
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
21 changes: 21 additions & 0 deletions core/include/kernel_init.h
Expand Up @@ -25,6 +25,27 @@
extern "C" {
#endif

/**
* @defgroup core_init_config Core initialization compile configuration
* @ingroup config
* @{
*/
#ifdef DOXYGEN

/**
* @brief Enable this to disable printing a message on bootup.
*/
#define CONFIG_SKIP_BOOT_MSG

/**
* @brief The message printed by RIOT before calling the main() function, when
* @ref CONFIG_SKIP_BOOT_MSG is not set.
*/
#define CONFIG_BOOT_MSG_STRING

#endif /* DOXYGEN */
/** @} */

/**
* @brief Initializes scheduler and creates main and idle task
*/
Expand Down
8 changes: 7 additions & 1 deletion core/init.c
Expand Up @@ -36,6 +36,10 @@
#include <auto_init.h>
#endif

#ifndef CONFIG_BOOT_MSG_STRING
#define CONFIG_BOOT_MSG_STRING "main(): This is RIOT! (Version: " RIOT_VERSION ")"
#endif

extern int main(void);

static void *main_trampoline(void *arg)
Expand All @@ -46,7 +50,9 @@ static void *main_trampoline(void *arg)
auto_init();
#endif

LOG_INFO("main(): This is RIOT! (Version: " RIOT_VERSION ")\n");
if (!IS_ACTIVE(CONFIG_SKIP_BOOT_MSG)) {
LOG_INFO(CONFIG_BOOT_MSG_STRING "\n");
}

main();

Expand Down

0 comments on commit 72d6d90

Please sign in to comment.