Merged
Conversation
nseidle
reviewed
Nov 14, 2023
src/SparkFun_External_EEPROM.cpp
Outdated
|
|
||
| return true; | ||
| } | ||
| bool ExternalEEPROM::begin(uint8_t WP = LED_BUILTIN, uint8_t deviceAddress, TwoWire &wirePort) |
Member
There was a problem hiding this comment.
Please move the WP setting the the end: deviceAddress, wirePort, WP
nseidle
reviewed
Nov 14, 2023
src/SparkFun_External_EEPROM.cpp
Outdated
| delayMicroseconds(100); // This shortens the amount of time waiting between writes but hammers the I2C bus | ||
|
|
||
| // Check if we are using Write Protection then disable WP for write access | ||
| if(settings.usingWP) digitalWrite(settings.wpPin, LOW); |
Member
There was a problem hiding this comment.
We use the built-in Arduino formatter style. Please remove whitespace: usingWP) digitalWrite...
nseidle
reviewed
Nov 14, 2023
src/SparkFun_External_EEPROM.cpp
Outdated
|
|
||
| result = settings.i2cPort->endTransmission(); // Send stop condition | ||
| // Enable Write Protection if we are using WP | ||
| if(settings.usingWP) digitalWrite(settings.wpPin, HIGH); |
nseidle
reviewed
Nov 14, 2023
src/SparkFun_External_EEPROM.h
Outdated
| uint8_t writeTime_ms; | ||
| bool pollForWriteComplete; | ||
| uint8_t addressSize_bytes; | ||
| bool usingWP; |
Member
There was a problem hiding this comment.
Rather than use a bool, I recommend setting the wpPin default to 255 and then test against it: if(settings.wpPin != 255) digitalWrite(...
Member
There was a problem hiding this comment.
If a user sets the pin to something other than 255, WP control is enabled.
Member
|
This is a fine addition! Thanks. Please see my comments. |
Contributor
Author
|
Sure, It is my pleasure 🌹 |
giminotron5
commented
Mar 2, 2024
Contributor
Author
giminotron5
left a comment
There was a problem hiding this comment.
The code has been modified.
Member
|
Excellent, thanks! Merging. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added write protection pin control to the code.