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:
parent
53af7ebaf5
commit
ca5e196e78
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user