Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
These changes add the ATtiny84a chip with EEPROM support.
Status
These changes are blocked on attiny84a support in avr-device. Once that PR is merged, a new version is released, and the avr-hal packages rely on that new version, these changes will be ready for proper review.
Risks
I'm not very familiar with this library yet, and my confidence in the correctness of these changes is low. I've only tested these changes with an ATtiny84a - there may be unintentional side effects for other chips.
In one case, I had to include the config attribute
#[cfg(not(feature = "attiny84a"))]
. I assume there's a better option available, perhaps by implementing theprescaler_n
functions for the Attiny84a. I am unsure how to do this - is there some documentation I'm missing?Testing
Locally, I've modified the relevant
Cargo.toml
files to target the relevantavr-hal
version. Then, I was able to successfully read from and write to the EEPROM with theavr_hal_generic
andattiny_hal
libraries. I've included a simplified example below, and the full code can be found here (this code in this repo is very messy - it's a proof of concept which will be fully rewritten).