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

Netdev2 #523

Closed
wants to merge 51 commits into from
Closed

Netdev2 #523

wants to merge 51 commits into from

Conversation

scottfeldman
Copy link
Contributor

This PR adds a network device driver model called netdev. There is a companion PR for TinyGo to update the "net" package here #tinygo-org/tinygo#3452. This PR is for the netdev interface definitions, netdev drivers (wifinina, rtl8720dn, espat) and examples.

See netdev documentation here: netdev/README.md.

Testing results are here.

Espat driver is ported to netdev but untested. I'm waiting on some hardware (on order) to test. I didn't want to hold up the PR for espat; will submit updates when I get the hardware.

Thanks to the TinyGo dev community with all the help and suggestions.

@scottfeldman
Copy link
Contributor Author

Hmmm...when I run "make test" locally, it passes. When the build runs it, it fails because of this in netdev/netdev.go:

//go:linkname Use net.useNetdev
func Use(netdev Netdever)

Not sure how to fix this, or work around it.

@scottfeldman
Copy link
Contributor Author

Smoke tests are failing because net/netdev is not available in the test version of tinygo.

bxparks and others added 2 commits March 3, 2023 09:43
I also verified my interpretation of the DS3231 datasheet and my implementation
of this formula by placing a DS3231 chip in the freezer section of my
refrigerator for an hour or two, then reading the temperature. I got -16C,
which is close enough to the -18C that the freezer was set to.
Changes based on feedback from Ben and Patricio:

0) Move netdever interface to "drivers" package
1) Mirror netdever interface with same in drivers repo
2) Use go:linkname to link to net.useNetdev()
3) Use native Go types in netdever interface
4) Add Netlinker interface to "drivers" package
5) Update documentation, add new README-net.md file
@scottfeldman
Copy link
Contributor Author

Build is broken due to dependency with tinygo repo: new constants were added to src/syscall.

bxparks and others added 24 commits March 20, 2023 22:59
The current code interprets the 'century' flag as the year 2100. However the
DS3231 hardware does not incorporate this flag in its leap year calculation, so
will incorrectly consider the year 2100 as a leap year and increment from
2100-02-28 to 2100-02-29 instead of the correct 2100-03-01.

The 'century' bit is not useful for anything as far as I can tell. But instead
of removing the code that uses the 'century' bit, I thought it would be less
intrusive to just document the current behavior.
Changes based on feedback from Ben and Patricio:

0) Move netdever interface to "drivers" package
1) Mirror netdever interface with same in drivers repo
2) Use go:linkname to link to net.useNetdev()
3) Use native Go types in netdever interface
4) Add Netlinker interface to "drivers" package
5) Update documentation, add new README-net.md file
@scottfeldman scottfeldman mentioned this pull request Mar 28, 2023
@scottfeldman
Copy link
Contributor Author

I screwed up the git rebase and messed up my repo tree so closing this PR and replacing with #537.

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

Successfully merging this pull request may close these issues.

3 participants