1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/atmega_common: Move stdio_init() to cpu_init()

Moving atmega_stdio_init() to cpu_init() just before periph_init() guarantees
that stdio is available to allow DEBUG() in periph_init(). This also helps to
unify the boot up process of ATmega boards and de-duplicates the stdio init from
board_init().
This commit is contained in:
Marian Buschsieweke 2019-04-10 10:18:43 +02:00
parent 53af7ebaf5
commit ca5e196e78
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
3 changed files with 4 additions and 8 deletions

View File

@ -34,10 +34,6 @@ void board_init(void)
atmega_set_prescaler(CPU_ATMEGA_CLK_SCALE_INIT);
#ifdef MODULE_AVR_LIBC_EXTRA
atmega_stdio_init();
#endif
cpu_init();
led_init();
irq_enable();

View File

@ -58,10 +58,6 @@ void board_init(void)
#endif
#endif
#ifdef MODULE_AVR_LIBC_EXTRA
atmega_stdio_init();
#endif
cpu_init();
led_init();
irq_enable();

View File

@ -105,6 +105,10 @@ void cpu_init(void)
wdt_reset(); /* should not be nececessary as done in bootloader */
wdt_disable(); /* but when used without bootloader this is needed */
/* Initialize stdio before periph_init() to allow use of DEBUG() there */
#ifdef MODULE_AVR_LIBC_EXTRA
atmega_stdio_init();
#endif
/* Initialize peripherals for which modules are included in the makefile.*/
/* spi_init */
/* rtc_init */