Skip to content

wrong offset address in _write_socket() #43

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

Closed
bjnhur opened this issue Aug 10, 2021 · 3 comments
Closed

wrong offset address in _write_socket() #43

bjnhur opened this issue Aug 10, 2021 · 3 comments

Comments

@bjnhur
Copy link
Contributor

bjnhur commented Aug 10, 2021

current code

base = self._ch_base_msb << 8
cntl_byte = (sock << 5) + 0x0C
return self.write(base + sock * CH_SIZE + address, cntl_byte, data)

I think, don't need to add base , sock * CH_SIZE like _read_socket() function. It's enough to use offset.

My suggestion is

 cntl_byte = (sock << 5) + 0x0C
 return self.write(address, cntl_byte, data)

in W5500 datasheet,
image

@brentru
Copy link
Member

brentru commented Aug 10, 2021

@bjnhur I think you're correct as well, would you mind opening a PR? I can test this on the W5500 ethernet wing to verify.

@bjnhur
Copy link
Contributor Author

bjnhur commented Aug 11, 2021

@bjnhur I think you're correct as well, would you mind opening a PR? I can test this on the W5500 ethernet wing to verify.

Good. I also added this commit in current PR #42

@anecdata
Copy link
Member

anecdata commented Mar 2, 2022

Closing, fixed by #42.

@anecdata anecdata closed this as completed Mar 2, 2022
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

3 participants