earlephilhower / arduino-pico

Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
GNU Lesser General Public License v2.1
2.03k stars 422 forks source link

Is there a easy way to override the __wrap_cyw43_cb_tcpip_* functions #1748

Closed morio closed 1 year ago

morio commented 1 year ago

In the file https://github.com/earlephilhower/arduino-pico/blob/master/cores/rp2040/cyw43_wrappers.cpp I need to override wrap_cyw43_cb_process_ethernet, wrap_cyw43_cb_set_link_up, and __wrap_cyw43_cb_set_link_down.

Was this setup so it could easily overridden? Or is the easiest way just to comment them out and write the functions with _wrap prefix in my own code base (which I did to get my code working)?

Also how does the _wrap prefix work? Doing a search I can't anywhere that __wrap_cyw43_cb_process_ethernet is called. Though I do see places where cyw43_cb_process_ethernet is called.

morio commented 1 year ago

Okay some further investigation I figured it out. The file lib/platform_wrap.txt has the list of functions that get wrapped. Removing the three I needed from that text file solved the problem.