diff --git a/examples/c-examples/xtensa-esp32/Makefile b/examples/c-examples/xtensa-esp32/Makefile index 6d0e035..9eb2cf5 100644 --- a/examples/c-examples/xtensa-esp32/Makefile +++ b/examples/c-examples/xtensa-esp32/Makefile @@ -14,8 +14,6 @@ LD = $(TOOLCHAIN)ld OC = $(TOOLCHAIN)objcopy OS = $(TOOLCHAIN)size -# Linker script location. -LDSCRIPT = ./ld/esp32.ld # Set C/LD/AS flags. CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(CFLAGS_PLATFORM) $(COPT) # (Allow access to the same memory location w/ different data widths.) @@ -24,7 +22,7 @@ CFLAGS += -fdata-sections -ffunction-sections CFLAGS += -Os -g # Link with martos LDFLAGS += -L../../../c-library/xtensa-esp32/target/xtensa-esp32-none-elf/release/ -lxtensa_esp32_static_lib -LDFLAGS += -nostdlib -T$(LDSCRIPT) -Wl,-Map=$@.map -Wl,--cref -Wl,--gc-sections +LDFLAGS += -nostdlib -Wl,-Map=$@.map -Wl,--cref -Wl,--gc-sections LDFLAGS += $(LDFLAGS_PLATFORM) LDFLAGS += -lm -lc -lgcc -Wl,--allow-multiple-definition ASFLAGS += -c -O0 -Wall -fmessage-length=0 diff --git a/examples/c-examples/xtensa-esp32/src/main.c b/examples/c-examples/xtensa-esp32/src/main.c index 4e1c3cf..65d84b5 100644 --- a/examples/c-examples/xtensa-esp32/src/main.c +++ b/examples/c-examples/xtensa-esp32/src/main.c @@ -2,9 +2,9 @@ #include extern unsigned int _sbss, _ebss, _sidata, _sdata, _edata; - extern void add_task(void (*setup_fn)(), void (*loop_fn)(), bool (*stop_condition_fn)()); extern void start_task_manager(); +extern void init_system(); int counter = 0; @@ -24,6 +24,7 @@ bool stop_condition_fn() { } int main( void ) { + init_system(); add_task(setup_fn, loop_fn, stop_condition_fn); start_task_manager();