Skip to content

Add more configuration symbols and simplify the build script - #264

Merged
jessebraham merged 1 commit into
esp-rs:mainfrom
jessebraham:feature/cfg
Nov 17, 2022
Merged

Add more configuration symbols and simplify the build script#264
jessebraham merged 1 commit into
esp-rs:mainfrom
jessebraham:feature/cfg

Conversation

@jessebraham

Copy link
Copy Markdown
Member

I've added a number of new symbols here to hopefully make our code a bit easier to reason about. I've also changed our approach in the build script, where each chip just defines all of its symbols now. I think this will be easier to maintain.

I was careful when changing the #[cfg]s but it's always possible I've made a mistake, so @MabezDev @bjoernQ please double check my work if you could! I've also consolidated the DmaPeripheral enums, and again while I've already checked this please review it.

Not sure how many more symbols we can pull out right now, but if I've missed anything let me know!

Sha = 7,
#[cfg(any(esp32c3, esp32s3))]
Adc = 8,
#[cfg(esp32s3)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure this way of defining DmaPeripheral will work fine in future - e.g. on C6 9 is PARLIO while on S3 it's RMT - not much of a problem now but no idea how these IDs will look like for future chips

@jessebraham jessebraham Nov 17, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Okay, well at least the existing chips can share a definition I think. If we need to re-introduce a #[cfg] and one or more DmaPeripherals enums in the future we can do so.

Comment thread esp-hal-common/build.rs Outdated

@bjoernQ bjoernQ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jessebraham
jessebraham merged commit d913535 into esp-rs:main Nov 17, 2022
@jessebraham
jessebraham deleted the feature/cfg branch November 17, 2022 15:42
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