Skip to content

extmod/lwip-include: Factor common lwIP config into lwipopts_common.h. #16647

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

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

dpgeorge
Copy link
Member

@dpgeorge dpgeorge commented Jan 25, 2025

Summary

This lwIP configuration file has options that are common to all ports, and the ports are updated to use this file. This change is a no-op, the lwIP configuration remains the same for the four ports using this common file.

This reduces code duplication, keeps the ports in sync, and makes it easier to update the configuration for all ports at once.

Testing

For each port built a board with lwIP enabled: RPI_PICO_W, PYBD_SF6, TEENSY41, ARDUINO_PORTENTA_C33. Built both before and after the commit in this PR. Then compared the binary firmware. The only things that changed in the binary were (1) the git commit hash in the version string; (2) the ordering of some of the pins in the machine.Pin.board dict (for some reason the order of these are not deterministic). So I could conclude that the lwIP config changes are a no-op.

Edit: also built an stm32 board with PPP enabled and it builds.

@dpgeorge dpgeorge added ports Relates to multiple ports, or a new/proposed port extmod Relates to extmod/ directory in source labels Jan 25, 2025
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.58%. Comparing base (22353e9) to head (abb13b1).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #16647   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files         167      167           
  Lines       21590    21590           
=======================================
  Hits        21285    21285           
  Misses        305      305           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge dpgeorge requested a review from projectgus January 28, 2025 01:04
Copy link
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay for standardisation! Change LGTM.

This lwIP configuration file has options that are common to all ports, and
the ports are updated to use this file.  This change is a no-op, the lwIP
configuration remains the same for the four ports using this common file.

This reduces code duplication, keeps the ports in sync, and makes it easier
to update the configuration for all ports at once.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the extmod-lwip-common-lwipopts branch from 1071061 to abb13b1 Compare January 29, 2025 01:36
@dpgeorge dpgeorge merged commit abb13b1 into micropython:master Jan 29, 2025
61 checks passed
@dpgeorge dpgeorge deleted the extmod-lwip-common-lwipopts branch January 29, 2025 01:38
@tpwrules
Copy link
Contributor

tpwrules commented Feb 7, 2025

Is lwipopts.h in the same directory of the new common file necessary anymore?

@dpgeorge
Copy link
Member Author

dpgeorge commented Feb 7, 2025

Is lwipopts.h in the same directory of the new common file necessary anymore?

Probably not needed anymore. That was there originally as a full lwIP configuration for ports if they wanted to use it, but none ever did, the ports all needed their own custom configuration (there are also arch/ files that can similarly be removed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extmod Relates to extmod/ directory in source ports Relates to multiple ports, or a new/proposed port
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants