Rahix / avr-device

Register access crate for AVR microcontrollers
Apache License 2.0
170 stars 66 forks source link

Return the value of `SREG` upon disabling interrupts #89

Closed torrancew closed 2 years ago

torrancew commented 2 years ago

This commit addresses #88 by returning the original value of SREG upon disabling interrupts. This allows critical-section to implement itself for AVR, while not breaking the existing avr-device API.

The alternative of exposing a function to return SREG as part of the API was considered, but it was not clear where best to fit such a function in the structure of the crate, and overall, this approach seemed a bit more elegant.

torrancew commented 2 years ago

Edited the above to fix a minor spelling error

torrancew commented 2 years ago

@Rahix I've updated the commit message and code in line with what you suggested. Let me know if there are any other changes you'd like to see, and I'll get those in ASAP.

torrancew commented 2 years ago

@Rahix Thanks! Do you have a sense of when (roughly speaking) the next release will be ready? It's no rush, I'm simply preparing some PRs for other projects that will depend on this one and would like to (roughly) plan accordingly.

Rahix commented 2 years ago

I was originally waiting on someone who wanted to get their chip support work ready to be merged. But haven't heard back on that in quite some time now, so I think that shouldn't hold up progress here. I'll try to get a release out in the next days. If nothing happens, feel free to nag me again - most probably I will have just lost track ;)

Rahix commented 2 years ago

Done: 0.3.2