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

Fix tools/build_all_headers.py to cope with chip-specific headers #2292

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lurch
Copy link
Contributor

@lurch lurch commented Feb 18, 2025

Fixes #2220

With SORT_HEADERS_BY_DIRECTORY = True it shows you which directory the include files came from (which is the same behaviour as previous versions of this script) with the #if PICO_RP2040 and #if PICO_RP2350 headers at the very end

// rp2_common/hardware_pio/include
#include "hardware/pio.h"
#include "hardware/pio_instructions.h"

// rp2_common/hardware_pll/include
#include "hardware/pll.h"

// rp2_common/hardware_powman/include
#include "hardware/powman.h"

// rp2_common/hardware_pwm/include
#include "hardware/pwm.h"

// rp2_common/hardware_rcp/include
#include "hardware/rcp.h"

// rp2_common/hardware_resets/include
#include "hardware/resets.h"
...
// rp2xxx/hardware_structs/include
...
#include "hardware/structs/io_bank0.h"
#include "hardware/structs/io_qspi.h"
#include "hardware/structs/iobank0.h"
#include "hardware/structs/ioqspi.h"
#include "hardware/structs/mpu.h"
#include "hardware/structs/nvic.h"
#include "hardware/structs/pads_bank0.h"
#include "hardware/structs/pads_qspi.h"
#include "hardware/structs/padsbank0.h"
#include "hardware/structs/pio.h"
#include "hardware/structs/pll.h"

but with SORT_HEADERS_BY_DIRECTORY = False it just outputs a "flattened" list (which more closely matches the big list of header files in https://github.com/raspberrypi/pico-sdk/blob/develop/test/kitchen_sink/kitchen_sink.c ) with the #if PICO_RP2040 and #if PICO_RP2350 headers intermingled with everything else

#include "hardware/pio.h"
#include "hardware/pio_instructions.h"
#include "hardware/platform_defs.h"
#include "hardware/pll.h"
#include "hardware/powman.h"
#include "hardware/pwm.h"
#include "hardware/rcp.h"
#include "hardware/resets.h"
...
#include "hardware/structs/io_bank0.h"
#include "hardware/structs/io_qspi.h"
#include "hardware/structs/iobank0.h"
#include "hardware/structs/ioqspi.h"
#if PICO_RP2040
#include "hardware/structs/m0plus.h"
#endif
#if PICO_RP2350
#include "hardware/structs/m33.h"
#include "hardware/structs/m33_eppb.h"
#endif
#include "hardware/structs/mpu.h"
#include "hardware/structs/nvic.h"
#if PICO_RP2350
#include "hardware/structs/otp.h"
#endif
#include "hardware/structs/pads_bank0.h"
#include "hardware/structs/pads_qspi.h"
#include "hardware/structs/padsbank0.h"
#include "hardware/structs/pio.h"
#include "hardware/structs/pll.h"

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.

2 participants