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

Jam improvements, USB fixes and 7 segment AVTKA support #66

Merged
merged 14 commits into from Dec 4, 2017

Conversation

Projects
None yet
2 participants
@harryhaaren
Contributor

harryhaaren commented Dec 2, 2017

Jam improvements, USB fixes and 7 segment AVTKA support

harryhaaren added some commits Nov 10, 2017

jam: fix touch depart value on touchstrips
Previously, the value would always jump to 0 as the touch-depart
event message was interpreted as a value message.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: fix feedback sizes for button and slider
This removes "garbage" stuff that was being drawn by eg:
device_test as it was reading off the end of an array and
representing it as AVTKA widgets..

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: properly cleanup libUSB based interaction
Also nuke some dead code

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: various fixes, working on reducing complexity
Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: remove linux specific /dev/hidraw code
This commit removes #ifdef-ed code out of the driver, relying on
libUSB to perform all communication. Testing shows that with the
refactored USB code no events are dropped, so there's no reason
to not switch to it.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: reworking led support, making progress
Still hacky code and an issue with writing both grid and touchstrips
during the same function.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: clean up led write routines as working stable
Note that stable means that it is consistently performing the writes
in a performant way, without drops of event messages.

The colour table index still needs to be accessed to fix the colour-id
lookups.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: memset all lights to off before quitting
Also usleep to allow the usb transactions to retire.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
usb: on closing, wait a bit for inflight writes
This gives the USB subsystem / kernel / device a chance to
turn off some LEDs before we terminate the USB connection,
(and in doing so cancel any outstanding events..).

Use the inflight write count to skip out of waiting if it
isn't required.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
ctlra: fix return if invalid result in virtual dev
This commit fixes a possible segfault if a controller
is virtualized, and the device returns NULL instead of
a valid device_t from its connect() function.

Previously a NULL pointer + offset would be passed to the
application accept_dev_func(), which would often result
in a segfault. Returning early before the app dev accept
call handles this.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
ctlra/avtka/x1: add 7 segment display support
Relates to feature request #18

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
usb: remove debug print from async write path
Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
jam: remove usleep() from disconnect
During debugging, a usleep() was added to allow USB writes
progress to the device. This has since been fixed in the USB
sub-system, to wait for a specific amount of time or until any
outstanding writes have completed (whichever happens first),
see commit 859ea9a for details.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
@foolswood

Looks tidier, nice.

Show outdated Hide outdated ctlra/usb.c Outdated
usb: remove unnecessary BSD_SOURCE define
Thanks @foolswood for noticing!

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>

@harryhaaren harryhaaren merged commit cfa723e into master Dec 4, 2017

3 checks passed

Codacy/PR Quality Review Good work! A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment