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

support ether:begin to work with mac placed in flash #398

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/EtherCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,22 @@ uint16_t EtherCard::delaycnt = 0; //request gateway ARP lookup

uint8_t EtherCard::begin (const uint16_t size,
const uint8_t* macaddr,
uint8_t csPin) {
uint8_t csPin,
bool macFromRam) {
using_dhcp = false;
#if ETHERCARD_STASH
Stash::initMap();
#endif
copyMac(mymac, macaddr);
if (macFromRam) {
copyMac(mymac, macaddr);
}
else {
Serial.println("123456");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debug print

for (uint8_t k = 0; k < ETH_LEN; k++) {
uint8_t c = pgm_read_byte(macaddr+k);
mymac[k] = c;
}
}
return initialize(size, mymac, csPin);
}

Expand Down
2 changes: 1 addition & 1 deletion src/EtherCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class EtherCard : public Ethernet {
* @return <i>uint8_t</i> Firmware version or zero on failure.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update docs here

*/
static uint8_t begin (const uint16_t size, const uint8_t* macaddr,
uint8_t csPin = SS);
uint8_t csPin = SS, bool macFromRam =false);

/** @brief Configure network interface with static IP
* @param my_ip IP address (4 bytes). 0 for no change.
Expand Down