Skip to content

addressing feedback from @jepler #1

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

Merged
merged 3 commits into from
Nov 4, 2020
Merged

addressing feedback from @jepler #1

merged 3 commits into from
Nov 4, 2020

Conversation

siddacious
Copy link
Contributor

heya @jepler, this should address your feedback. I also left some comments on the google doc.

This is going to fail because I hate RST and am tired of futzing with it

@siddacious
Copy link
Contributor Author

@jepler Were you able to test this?

Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

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

I didn't re-test.

One doc change requested, and a general feeling of annoyance with myself about the semantics of send. ugh I'm sorry about that.

:param ~busio.SPI spi: The SPI bus used to communicate with the MCP2515
:param ~digitalio.DigitalInOut cs_pin: SPI bus enable pin
:param int baudrate: The bit rate of the bus in Hz, using a 16Mhz crystal. All devices on the bus must agree on this value. Defaults to 250000.
:param bool loopback: Receive only packets sent from this device, and send only to this device. Requires that `silent` is also set to `False`, but only prevents transmission to other devices. Otherwise the send/receive behavior is normal.
Copy link
Contributor

Choose a reason for hiding this comment

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

please update (requires that silent be True)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

if loopback and not silent:
raise AttributeError("Loopback mode requires silent to be set")
if auto_restart:
raise AttributeError("`auto-restart` is not supported by hardware")
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be useful to emulate this by restarting at any in_waiting(), receive() or send() call? is the checking expensive (I could believe that)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it makes sense to defer implementation until its absence is raised as an issue

# TODO: Timeout
tx_buff = self._get_tx_buffer() # info = addr.
if tx_buff is None:
raise RuntimeError("No transmit buffer available to send")
Copy link
Contributor

Choose a reason for hiding this comment

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

OK this does implement what the core docs say. It's not what core does. sigh. We can let some actual experience inform us as to what is preferable, and then implement it across the various chips, I don't want it to hold things back at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that we should wait and see how things go.

elif self.silent and not self.loopback:
raise AttributeError(
"Hardware does not support setting `matches` in when\
`silent`==`True` and `loopback` == `False`"
Copy link
Contributor

Choose a reason for hiding this comment

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

interesting restriction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think they imagine that if you're in the monitoring mode that you want to "hear" everything?

@siddacious siddacious requested a review from jepler October 19, 2020 21:21
Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

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

I have totally lost the thread here. Things look fine and if anything's not we can revisit later.

@jepler jepler merged commit 0bafa14 into master Nov 4, 2020
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.

2 participants