support ether:begin to work with mac placed in flash#398
support ether:begin to work with mac placed in flash#398nagimov wants to merge 4 commits intonjh:masterfrom nagimov:support-mac-from-flash
Conversation
…d mac from flash by default
nuno-silva
left a comment
There was a problem hiding this comment.
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. | |||
src/EtherCard.cpp
Outdated
| copyMac(mymac, macaddr); | ||
| } | ||
| else { | ||
| Serial.println("123456"); |
|
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:beginto work with mac-addresses placed in flash via PROGMEM.Since the signature of existing
EtherCard:beginimplementation expects mac asconst uint8_t* macaddrand 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.