mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core/init: add early_init()
Add a function to initialize LEDs and UART in early boot.
This commit is contained in:
parent
441b69964c
commit
092b235845
@ -56,6 +56,15 @@ void kernel_init(void);
|
|||||||
*/
|
*/
|
||||||
void board_init(void);
|
void board_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize debug LEDs and stdio
|
||||||
|
*/
|
||||||
|
#ifdef MODULE_CORE_INIT
|
||||||
|
void early_init(void);
|
||||||
|
#else
|
||||||
|
static inline void early_init(void) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "periph/pm.h"
|
#include "periph/pm.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
#include "stdio_base.h"
|
||||||
|
|
||||||
#define ENABLE_DEBUG 0
|
#define ENABLE_DEBUG 0
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
@ -102,3 +103,14 @@ void kernel_init(void)
|
|||||||
|
|
||||||
cpu_switch_context_exit();
|
cpu_switch_context_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void early_init(void)
|
||||||
|
{
|
||||||
|
/* initialize leds */
|
||||||
|
if (IS_USED(MODULE_PERIPH_INIT_LEDS)) {
|
||||||
|
extern void led_init(void);
|
||||||
|
led_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
stdio_init();
|
||||||
|
}
|
||||||
|
@ -58,11 +58,6 @@
|
|||||||
void periph_init(void)
|
void periph_init(void)
|
||||||
{
|
{
|
||||||
#ifdef MODULE_PERIPH_INIT
|
#ifdef MODULE_PERIPH_INIT
|
||||||
/* initialize leds */
|
|
||||||
if (IS_USED(MODULE_PERIPH_INIT_LEDS)) {
|
|
||||||
extern void led_init(void);
|
|
||||||
led_init();
|
|
||||||
}
|
|
||||||
/* initialize buttonss */
|
/* initialize buttonss */
|
||||||
if (IS_USED(MODULE_PERIPH_INIT_BUTTONS)) {
|
if (IS_USED(MODULE_PERIPH_INIT_BUTTONS)) {
|
||||||
extern void button_init(void);
|
extern void button_init(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user