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

wrong indentation or missing bracket? #28

Open
powergt opened this issue Nov 6, 2019 · 1 comment
Open

wrong indentation or missing bracket? #28

powergt opened this issue Nov 6, 2019 · 1 comment

Comments

@powergt
Copy link

powergt commented Nov 6, 2019

in file: EEPROMex.cpp
in function:
void EEPROMClassEx::setMemPool(int base, int memSize) {
//Base can only be adjusted if no addresses have already been issued
if (_nextAvailableaddress == _base)
_base = base;
_nextAvailableaddress=_base; //<- this is outside if conditional statement: is right?

@lilo-chita
Copy link

lilo-chita commented Mar 16, 2022

Looks like missing brackets. If no addresses have already been issued we can change _base and _nextAvailableaddress setting them to the same value. Also without brackets debug check at the end of function is always false and makes no sense.

if (_nextAvailableaddress != _base) 
     Serial.println("Cannot change base, addresses have been issued");

So I assume it should be

if (_nextAvailableaddress == _base) {
    _base = base;
    _nextAvailableaddress=_base;
}

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

No branches or pull requests

2 participants