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

Support new PAC (0.5) #7

Merged
merged 1 commit into from
Aug 12, 2023
Merged

Conversation

nilclass
Copy link
Contributor

@nilclass nilclass commented Aug 4, 2023

One small change, needed to work with the latest PAC.

I haven't checked yet if this is backwards compatible though, so the >= 0.2.0 part of the dependency may not be correct anymore.

@korken89
Copy link
Owner

korken89 commented Aug 5, 2023

Hi, thanks for the PR!
This is unfortunately not compatible with older PACs, could you change it to something that is compatible?

Thanks!

@nilclass
Copy link
Contributor Author

nilclass commented Aug 6, 2023

Thanks for taking a look!

This is unfortunately not compatible with older PACs, could you change it to something that is compatible?

I don't think so. The reason for this change is updates of the SVD tooling (in this PR and this PR and probably others).

From what I can tell, the older version of the tooling did not differentiate between setting a bit, and clearing a bit by writing one (both were done with set_bit). The newer version does make that distinction, with set_bit vs clear_bit_by_one.
Since the older version does not support clear_bit_by_one and the newer version no longer supports set_bit I don't see how this code could be made compatible with both.

@korken89
Copy link
Owner

korken89 commented Aug 6, 2023

Hi,

You can use raw bit manipulation instead of the interface. :)

@nilclass
Copy link
Contributor Author

nilclass commented Aug 6, 2023

Sure, that would be possible :) It sort of defeats the purpose of using the PAC though.

Do you see any harm in dropping support for the older PAC versions?
To me it seems a reasonable thing to do (in a minor release), given that existing rp2040-monotonic releases continue to work with the old PAC versions.

Of course it's up to you, if you think raw bit-fiddling is the way to go, I'll make that change :)

My goal is simply to have a rp2040-monotonic version that works with the latest rp2040-hal (which depends on the 0.5 pac).

@korken89
Copy link
Owner

korken89 commented Aug 8, 2023

Desperate times, desperate measures. We go with manual bit fixing.
Else I need to do a full major release which I do not want to do. :)

Use `bit(true)` instead of `set_bit`, since `set_bit` was renamed to
`clear_bit_by_one` for write-clear registers.
@nilclass
Copy link
Contributor Author

nilclass commented Aug 8, 2023

It turned out to be as easy as bit(true) 😄 I'm pretty sure that works with older versions too. Not sure why I did not realize it before

Copy link
Owner

@korken89 korken89 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@korken89 korken89 merged commit 2be839c into korken89:master Aug 12, 2023
4 checks passed
@nilclass nilclass deleted the support-pac-0-5 branch August 12, 2023 17:58
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.

None yet

2 participants