Skip to content

address issues 139 and 141 #142

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion src/EthernetClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,16 @@ size_t EthernetClient::write(uint8_t b)
size_t EthernetClient::write(const uint8_t *buf, size_t size)
{
if (sockindex >= MAX_SOCK_NUM) return 0;
if (Ethernet.socketSend(sockindex, buf, size)) return size;
//if (Ethernet.socketSend(sockindex, buf, size)) return size;
if(size==0) return 0;
size_t remain = size;
size_t sent = 0;
while(remain > 0) {
sent = Ethernet.socketSend(sockindex, buf+size-remain, remain);
if(sent==0) break;
remain -= sent;
}
if(sent!=0) return size;
setWriteError();
return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions src/utility/w5100.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,12 @@ class W5100Class {
pinMode(ss_pin, OUTPUT);
}
inline static void setSS() {
GPOC = ss_pin_mask;
//GPOC = ss_pin_mask;
digitalWrite(ss_pin, LOW);
}
inline static void resetSS() {
GPOS = ss_pin_mask;
//GPOS = ss_pin_mask;
digitalWrite(ss_pin, HIGH);
}

#elif defined(__SAMD21G18A__)
Expand Down