raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.25k stars 838 forks source link

pico_flash should depend on hardware_exception #1698

Closed jaguilar closed 1 month ago

jaguilar commented 1 month ago

Hi there, I think pico_flash should depend on hardware_exception? It unconditionally includes hardware_exception, and if I try to compile a file that depends on pico_flash without editing the SDK, I get this compile error:

[build] /home/jaguilar/projects/pico-sdk/src/rp2_common/pico_flash/flash.c:8:10: fatal error: hardware/exception.h: No such file or directory
[build]     8 | #include "hardware/exception.h"
[build]       |          ^~~~~~~~~~~~~~~~~~~~~~

If I add hardware_exception to the dependency list of pico_flash then everything works as expected.

kilograham commented 1 month ago

it doesn't seem like the file actually needs the header on a quick check

jaguilar commented 1 month ago

@kilograham Adjusted the pull request to remove the unneeded includes. Added a compilation test to show the before and after state. I don't know if you prefer to have tests like that in the tree. Let me know if not and I can remove it.

kilograham commented 1 month ago

merged into develop