1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

Merge pull request #9984 from kaspar030/refactor_atmega_libc

cpu/atmega_common: refactor AVR libc code into module
This commit is contained in:
Sebastian Meiling 2019-01-22 08:41:37 +01:00 committed by GitHub
commit 0edf76d362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 16 additions and 2 deletions

View File

@ -31,8 +31,13 @@ void led_init(void);
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,7 +58,10 @@ void board_init(void)
#endif
#endif
#ifdef MODULE_AVR_LIBC_EXTRA
atmega_stdio_init();
#endif
cpu_init();
led_init();
irq_enable();

View File

@ -2,6 +2,6 @@
MODULE = atmega_common
# add a list of subdirectories, that should also be build
DIRS = periph
DIRS = periph avr_libc_extra
include $(RIOTBASE)/Makefile.base

View File

@ -18,7 +18,9 @@ export USEMODULE += periph_common
export USEMODULE += stdio_uart
# include module specific includes
export INCLUDES += -I$(RIOTCPU)/atmega_common/include -isystem$(RIOTCPU)/atmega_common/include/vendor
export INCLUDES += -I$(RIOTCPU)/atmega_common/include \
-isystem$(RIOTCPU)/atmega_common/avr_libc_extra/include \
-isystem$(RIOTCPU)/atmega_common/avr_libc_extra/include/vendor
ifeq ($(LTO),1)
# avr-gcc <4.8.3 has a bug when using LTO which causes a warning to be printed always:
@ -37,3 +39,6 @@ LINKFLAGS += $(LINKFLAGPREFIX)--defsym=__DATA_REGION_LENGTH__=$(RAM_LEN)
LDSCRIPT_COMPAT = $(if $(shell $(TARGET_ARCH)-ld --verbose | grep __TEXT_REGION_LENGTH__),,\
-T$(RIOTCPU)/$(CPU)/ldscripts_compat/avr_2.26.ld)
LINKFLAGS += $(LDSCRIPT_COMPAT)
# avr libc needs some RIOT-specific support code
USEMODULE += avr_libc_extra

View File

@ -0,0 +1 @@
include $(RIOTBASE)/Makefile.base