-
Notifications
You must be signed in to change notification settings - Fork 34
Add Mock Support for EEPROM #174
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9df75db
Don't define ostream& operator() if already defined by Apple (#171)
c512f28
Only include EEPROM if board supports it.
d82c1cf
Merge branch 'master' into tdd
524d352
Add EEPROM_SIZE to mega boards.
8ed2732
Move `EEPROM_SIZE` macro to `misc/default.yml`.
fadc743
Use E2END to calculate EEPROM_SIZE.
0ee5170
EEPROM is tested by uno and due so we don't need to add mega2560 (one…
4605207
Simplify reference to EEPROM library.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ unittest: | |
platforms: | ||
- uno | ||
- due | ||
- mega2560 | ||
|
||
compile: | ||
platforms: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be more appropriate to conditionally set this variable based on the board being used, which can be done in the default configuration here:
https://github.com/Arduino-CI/arduino_ci/blob/master/misc/default.yml#L102
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can certainly try that. By way of background, where did those files come from? Why does EEPROM_SIZE exist in over 40 of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied them from the Arduino project itself,
arduino-1.8.5/hardware/tools/avr/avr/include/avr
to get things to compile... some hand-edits were made. I have very little information on how/why Arduino structures these files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's avr-libc:
https://www.nongnu.org/avr-libc/
Nothing Arduino-specific. This is just the standard open source AVR toolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there are a lot of different AVR microcontrollers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really love to find a way to avoid packaging all of these files in this repo but I'm at a loss for how to do so (while enabling a non-AVR compiler to supply all the
#define
statements some alternate way).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But why isn't it defined for Mega2560? That microcontroller has EPROM in it. I was hoping that the macro would be a reliable way to determine whether the feature is present. Instead it seems that it has
__EEPROM_REG_LOCATIONS__
but not the size.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files are mostly out of the way and don't bother me much; I just find myself expecting more of them than I should given my limited knowledge!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that, while the megaAVR EEPROM library uses
EEPROM_SIZE
, the AVR EEPROM library usesE2END
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now. The macros are artifacts of the implementation, not a way of giving information to clients of the library, and different implementations will have different macros. That makes sense and is reasonable.
Further investigation shows that E2END exists in 230 files and many times is (0x0). Perhaps it is a more reliable macro to use.