Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2111 Added a hook to user_init in core_esp8266_main.c to be able to do ver… #2136

Closed
wants to merge 2 commits into from

Conversation

tuxedo0801
Copy link
Contributor

@tuxedo0801
Copy link
Contributor Author

No idea why this fails in ci check... works great on my 2.2.0 installation here.

@igrr
Copy link
Member

igrr commented Jun 13, 2016

You call early_init but it's not defined anywhere, right? So linker legitimately complains. It works in your installation because you actually have early_init function in your sketch, I suppose. Now try opening and compiling one of the examples...

@tuxedo0801
Copy link
Contributor Author

indeed, but early_init should be optional and not mandatory :-(

How can this be done? (sorry, I'm more an java than an c expert)

@tuxedo0801
Copy link
Contributor Author

tuxedo0801 commented Aug 30, 2016

This should be easy for an C expert I guess?!

I understand why this error happens on travis-ci, and I understand why it works in my sketch.

But I have no idea how I can tell the compiler that there "might" be a function called "early_init".

In my lib I use function-pointers to have this kind of feature. But I have to give the function pointer first to my lib so that it can execute the function.

As this early_init() is happening BEFORE the sketch, function pointers aren't the solution.

I'm a bit lost. As I said: I'm more a java expert than a c expert :-(

@igrr igrr closed this Oct 15, 2017
d-a-v added a commit to d-a-v/Arduino that referenced this pull request Nov 30, 2018
earlephilhower pushed a commit that referenced this pull request Dec 4, 2018
* weak hook early_setup() #2111 #2133 #2136

* rename to early_init (more "c" vs early_setup which is more "c++arduino")

* example

* improve earlyWiFi example, slightly change AddrList interface, move WiFi sketches into WiFi examples

* fix CI

* fix local CI runner

* fix local CI runner

* rename early_init() to preinit()

* + static ESP8266WiFiClass::preinit_wifi_off()

* update early disable wifi example

* example update

* IPv6 example update

* Update ESP8266WiFiGeneric.h

camelCase for static method name

* Update ESP8266WiFiGeneric.cpp

camelCase for static method name

* Update EarlyDisableWiFi.ino

Expand comment, fix static method name

* Update core_esp8266_main.cpp

Expanded comment.

* Update core_esp8266_main.cpp

Expanded comment

* Update EarlyDisableWiFi.ino

Expanded comment
@d-a-v
Copy link
Collaborator

d-a-v commented Dec 4, 2018

@tuxedo0801 (two years after)

But I have no idea how I can tell the compiler that there "might" be a function called "early_init".

We can do that with the "weak " gcc extension in function declaration.
#5395 took care of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants