Skip to content

Conversation

@jepler
Copy link

@jepler jepler commented Mar 7, 2021

I compile-tested this with some single-device and some multi-device configurations, both A,B,C and `"A, B, C" styles and the calculated number matched the original number in each case.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Nice simplification!

Instead of counting words in make, which is slightly awful, notice that
possible_devices is local to external_flash.c, so we can declare the array
with an automatic bound, and then get the count as the element-count
(MP_ARRAY_SIZE) of the array.

Since EXTERNAL_FLASH_DEVICE_COUNT is no longer a global macro, switch
a few sites to using EXTERNAL_FLASH_DEVICES in `#if` checks instead.
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Well, that is a lot easier than torturing yourself with string manipulation in makefiles 😄

@jepler jepler merged commit 16f82b9 into adafruit:main Mar 8, 2021
@jepler jepler deleted the count-flash-devices branch November 3, 2021 21:09
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