Skip to content

New mouse peripheral and tests - #94

Draft
kauwua wants to merge 2 commits into
greatscottgadgets:mainfrom
HydraDancer:hydradancer_peripherals
Draft

New mouse peripheral and tests#94
kauwua wants to merge 2 commits into
greatscottgadgets:mainfrom
HydraDancer:hydradancer_peripherals

Conversation

@kauwua

@kauwua kauwua commented Jun 6, 2024

Copy link
Copy Markdown
Contributor

This PR adds a mouse peripheral, along with speedtests and loopback tests.

The tests might need some polishing, but it could be interesting to have some speed tests in the project. The loopback tests might be useless compared to the current test_transfer.

@kauwua
kauwua force-pushed the hydradancer_peripherals branch from 6bf260e to 7484c03 Compare September 6, 2024 19:16

@antoinevg antoinevg left a comment

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 a great contribution, thank you so much.

Just a few minor niggles, if you could address those I'll be happy to merge this!

#
#
"""
Create a basic mouse device with three buttons and two axis

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 comment should probably be changed to fit the device :)

#
#
"""
Create a basic mouse device with three buttons and two axis

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 comment should probably be changed to fit the device :)

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.

Do we need this file? pyusb is included in the package's pyproject.toml dependencies.


if __name__ == "__main__":

count = 1000

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.

Could you set this a bit lower? I've tested on both Cynthion and Hydradancer and a thousand iterations is going to take an awfully long time!

print("End of enumeration")
STOP = datetime.datetime.now()

print(f"Success, enumerated {count} devices, took {STOP-START}")

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.

Could you please output min/max/average for the time? I think that would be a bit more meaningful.

@kauwua

kauwua commented Sep 26, 2024

Copy link
Copy Markdown
Contributor Author

I'm converting this PR to a draft as I won't be able to refactor the code with the comments for at least a month, the loopback tests are not needed anymore (the current stress test is way better), but the speedtests/mouse device need a bit more work

@kauwua
kauwua marked this pull request as draft September 26, 2024 09:44
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