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

Virtual device #41

Merged
merged 122 commits into from Oct 2, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+3 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

avtka: rework callback to include float value

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
  • Loading branch information...
harryhaaren committed Aug 24, 2017
commit 0c0aa4459fc41a6ba9c2b9495857847c4837a253
View
@@ -92,7 +92,7 @@ avtka_disconnect(struct ctlra_dev_t *base)
}
static void
event_cb(struct avtka_t *avtka, uint32_t item, void *userdata)
event_cb(struct avtka_t *avtka, uint32_t item, float value, void *userdata)
{
struct cavtka_t *dev = (struct cavtka_t *)userdata;
printf("event on item %d\n", item);
@@ -104,14 +104,13 @@ event_cb(struct avtka_t *avtka, uint32_t item, void *userdata)
.type = type,
.button = {
.id = id,
// TODO: value get
.pressed = 1,
.pressed = (value == 1.0),
},
};
switch(type) {
case CTLRA_EVENT_SLIDER:
event.slider.id = id;
event.slider.value = 0.5;
event.slider.value = value;
break;
default:
break;
ProTip! Use n and p to navigate between commits in a pull request.