From 4e4590de89bc1524f6b7e7c35744325f9dc2e27b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 26 May 2015 09:42:21 +0300 Subject: [PATCH] sdk_patch_1.1.0: Add fix for force-requiring user_rf_pre_init(). SDK 1.1.0 introduced backward incompatible change of requiring user to define user_rf_pre_init(). Of course, this could have been easily avoided by providing default empty implementation in the library, what this patch does. --- Makefile | 6 +++++- empty_user_rf_pre_init.c | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 empty_user_rf_pre_init.c diff --git a/Makefile b/Makefile index 4289c21..dc7d0ba 100644 --- a/Makefile +++ b/Makefile @@ -63,10 +63,14 @@ libcirom: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libcirom.a sdk_patch: .sdk_patch_$(VENDOR_SDK) -.sdk_patch_1.1.0: +.sdk_patch_1.1.0: empty_user_rf_pre_init.o patch -N -f -d $(VENDOR_SDK_DIR_1.1.0) -p1 < c_types-c99.patch + $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar r $(VENDOR_SDK_DIR_1.1.0)/lib/libmain.a empty_user_rf_pre_init.o @touch $@ +empty_user_rf_pre_init.o: empty_user_rf_pre_init.c $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc + $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc -O2 -c $< + .sdk_patch_1.0.1: libnet80211.zip esp_iot_sdk_v1.0.1/.dir $(UNZIP) $< mv libnet80211.a $(VENDOR_SDK_DIR_1.0.1)/lib/ diff --git a/empty_user_rf_pre_init.c b/empty_user_rf_pre_init.c new file mode 100644 index 0000000..60394c3 --- /dev/null +++ b/empty_user_rf_pre_init.c @@ -0,0 +1,5 @@ +// Provide default empty implementation of user_rf_pre_init +// to maintain compatibility with older SDK versions. +void user_rf_pre_init(void) +{ +}