-
Notifications
You must be signed in to change notification settings - Fork 453
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
support ether:begin to work with mac placed in flash #398
Conversation
…d mac from flash by default
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.
Having an optional argument telling whether to read from RAM is a lot more error prone than overloading the method to properly handle it automatically.
That being said, I think this optional bool argument approach is used somewhere else in the code too.
These are my two cents
@@ -128,7 +128,7 @@ class EtherCard : public Ethernet { | |||
* @return <i>uint8_t</i> Firmware version or zero on failure. |
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.
update docs here
src/EtherCard.cpp
Outdated
copyMac(mymac, macaddr); | ||
} | ||
else { | ||
Serial.println("123456"); |
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.
remove debug print
Also, if you're defaulting to |
@nuno-silva Line 359 in 420dd84
Line 380 in 420dd84
You're right regarding examples - many of them place mymac into SRAM apparently:
I'll add another commit updating all the examples. However seeing how many of them (and potentially existing code) are going to get affected, I'm not sure anymore whether this PR should be merged 👎 |
@nagimov tell you what: I'll implement it as I suggested when I get a chance (maybe tomorrow) and then you can test it for me :) |
fixed by #406 |
This is a replacement to PR #397 supporting
EtherCard:begin
to work with mac-addresses placed in flash via PROGMEM.Since the signature of existing
EtherCard:begin
implementation expects mac asconst uint8_t* macaddr
and captures PROGMEM arrays, I think it is easier to supply an extra bool rather than reimplement it withconst __FlashStringHelper*
.EtherCard/src/EtherCard.h
Lines 130 to 131 in 420dd84
I surely could be missing an obvious better way to do this.
Tested on nano v3 with old bootloader.