Skip to content
Snippets Groups Projects
Unverified Commit 0edf76d3 authored by Sebastian Meiling's avatar Sebastian Meiling Committed by GitHub
Browse files

Merge pull request #9984 from kaspar030/refactor_atmega_libc

cpu/atmega_common: refactor AVR libc code into module
parents e22e5820 73135250
No related branches found
No related tags found
No related merge requests found
Showing
with 16 additions and 2 deletions
...@@ -31,8 +31,13 @@ void led_init(void); ...@@ -31,8 +31,13 @@ void led_init(void);
void board_init(void) void board_init(void)
{ {
atmega_set_prescaler(CPU_ATMEGA_CLK_SCALE_INIT); atmega_set_prescaler(CPU_ATMEGA_CLK_SCALE_INIT);
#ifdef MODULE_AVR_LIBC_EXTRA
atmega_stdio_init(); atmega_stdio_init();
#endif
cpu_init(); cpu_init();
led_init(); led_init();
irq_enable(); irq_enable();
......
...@@ -58,7 +58,10 @@ void board_init(void) ...@@ -58,7 +58,10 @@ void board_init(void)
#endif #endif
#endif #endif
#ifdef MODULE_AVR_LIBC_EXTRA
atmega_stdio_init(); atmega_stdio_init();
#endif
cpu_init(); cpu_init();
led_init(); led_init();
irq_enable(); irq_enable();
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
MODULE = atmega_common MODULE = atmega_common
# add a list of subdirectories, that should also be build # add a list of subdirectories, that should also be build
DIRS = periph DIRS = periph avr_libc_extra
include $(RIOTBASE)/Makefile.base include $(RIOTBASE)/Makefile.base
...@@ -18,7 +18,9 @@ export USEMODULE += periph_common ...@@ -18,7 +18,9 @@ export USEMODULE += periph_common
export USEMODULE += stdio_uart export USEMODULE += stdio_uart
# include module specific includes # 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) ifeq ($(LTO),1)
# avr-gcc <4.8.3 has a bug when using LTO which causes a warning to be printed always: # 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) ...@@ -37,3 +39,6 @@ LINKFLAGS += $(LINKFLAGPREFIX)--defsym=__DATA_REGION_LENGTH__=$(RAM_LEN)
LDSCRIPT_COMPAT = $(if $(shell $(TARGET_ARCH)-ld --verbose | grep __TEXT_REGION_LENGTH__),,\ LDSCRIPT_COMPAT = $(if $(shell $(TARGET_ARCH)-ld --verbose | grep __TEXT_REGION_LENGTH__),,\
-T$(RIOTCPU)/$(CPU)/ldscripts_compat/avr_2.26.ld) -T$(RIOTCPU)/$(CPU)/ldscripts_compat/avr_2.26.ld)
LINKFLAGS += $(LDSCRIPT_COMPAT) LINKFLAGS += $(LDSCRIPT_COMPAT)
# avr libc needs some RIOT-specific support code
USEMODULE += avr_libc_extra
include $(RIOTBASE)/Makefile.base
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment