Skip to content

Misc - #395

Merged
dwalton76 merged 6 commits into
ev3dev:developfrom
dwalton76:misc
Oct 4, 2017
Merged

Misc#395
dwalton76 merged 6 commits into
ev3dev:developfrom
dwalton76:misc

Conversation

@dwalton76

Copy link
Copy Markdown
Collaborator

No squashing when we merge this PR, will leave these as individual commits. The commit that adds the asserts in the motor class will catch issues like #393

@dwalton76

Copy link
Copy Markdown
Collaborator Author

The fix for #390 is also in here

@WasabiFan

Copy link
Copy Markdown
Member

Can you add the issue numbers to the individual commit messages (or, even better, fixes annotations)?

@dwalton76

Copy link
Copy Markdown
Collaborator Author

Hmmm CI is not happy about fake-sys....will dig some this evening after work

Comment thread ev3dev/motor.py Outdated
# We use poll() to monitor the state of the motor so we can react when
# the state changes but if you have never read the file, poll() won't
# block. Read 'state' once so that poll() will block.
self.state

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is only necessary if you are not calling poll in a loop, otherwise the loop does exactly the same thing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Seems worth keeping though, it is only one read and if the user does their own thing with POLLPRI they won't get tripped up on this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The user will still have to read once themselves so that they know the initial state

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, I just realized that polling the state attribute will only work on EV3 (and EVB since they share hardware drivers), but it won't work on any other platform (BrickPi, BrickPi3, PiStorms).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

will back this part out

Any ideas on how to get poll() working on BrickPi, etc?

@ddemidov

ddemidov commented Oct 4, 2017

Copy link
Copy Markdown
Member

Hmmm CI is not happy about fake-sys....will dig some this evening after work

For this to work board_info_dir needs to be configurable, and not a hard-coded path here:
https://github.com/rhempel/ev3dev-lang-python/blob/aab7a1cd6b21851ed3aa46e4f1ce00feed22d717/ev3dev/__init__.py#L43-L51

Similar to what is done inside Device:
https://github.com/rhempel/ev3dev-lang-python/blob/aab7a1cd6b21851ed3aa46e4f1ce00feed22d717/ev3dev/__init__.py#L123-L128

Then tests may change the root to point to fake-sys as it is done here:
https://github.com/rhempel/ev3dev-lang-python/blob/aab7a1cd6b21851ed3aa46e4f1ce00feed22d717/tests/api_tests.py#L16

@dwalton76

Copy link
Copy Markdown
Collaborator Author

@ddemidov any idea what is causing the CI

The command "eval git submodule update --init --recursive " failed. Retrying, 2 of 3.

failure?

@WasabiFan

Copy link
Copy Markdown
Member

@dwalton76 I think the submodule in this repo currently points to a fork of fake-sys instead of the original. Not sure why.

@dwalton76

Copy link
Copy Markdown
Collaborator Author

@WasabiFan I reverted my fake-sys change and will tackle it via a different PR. Our fake-sys is pointing at https://github.com/rhempel/ev3dev-lang-fake-sys/tree/master which is a fork of https://github.com/ddemidov/ev3dev-lang-fake-sys, we want Denis's.

@dwalton76
dwalton76 merged commit 7a96951 into ev3dev:develop Oct 4, 2017
@dwalton76
dwalton76 deleted the misc branch October 4, 2017 23:45
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.

5 participants