cpu/esp8266: fix compilation problems if module esp_wifi is not used #10980
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR fixes a minor compilation problem caused by the changes in PR #10862. The problem occurs only if module
esp_sdk
oresp_sw_timer
is used without moduleesp_wifi
.Background
If one of the modules
esp_sdk
,esp_sw_timer
oresp_wifi
is enabled, the Espressif SDK must be used. The SDK has to be linked against its own version of thelwIP
library, which requires a lot of resources. However, since this version oflwIP
is unusable with RIOT, a dummylwIP
was introduced in PR #10862 which overrides alllwIP
functions called during system initialization with dummy functions. These dummy functions have no real functionality and leave thelwIP
of the SDK uninitialized so that it does not consume any resources.The dummy
lwIP
function approach works as long as moduleesp_wifi
is enabled. However, if only moduleesp_sdk
oresp_sw_timer
is used, a number of multiple definition errors occur during linking.Solution
This PR defines an initialization function of the dummy
lwIP
which is called during system start independent on whether module moduleesp_wifi
is used or not.Initially, I planned to provide this fix as part of PR #9917. However, since the changes in this PR fix a compilation problem and PR #9917 is still not reviewed, I provide them as aseparate PR.
Testing procedure
Compile
test/periph_time
with moduleesp_sw_timer
. Compilation should succeed with the PR but should fail without the PR.Issues/PRs references
Compilation problem was introduced with PR #10862.