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.
+16 −0
Diff settings

Always

Just for now

Viewing a subset of changes. View all

ctlra: dev feedback set functionality added

This allows applications to make use of the feedback_set() api,
providing a higher-level of abstraction than the individual
LED set APIs.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
  • Loading branch information...
harryhaaren committed Sep 11, 2017
commit 8fdd893d134c7d275466c1cae31b8daf2ec14693
Copy path View file
@@ -202,6 +202,13 @@ void ctlra_dev_light_set(struct ctlra_dev_t *dev, uint32_t light_id,
dev->light_set(dev, light_id, light_status);
}
void ctlra_dev_feedback_set(struct ctlra_dev_t *dev, uint32_t fb_id,
float value)
{
if(dev && dev->feedback_set)
dev->feedback_set(dev, fb_id, value);
}
void ctlra_dev_light_flush(struct ctlra_dev_t *dev, uint32_t force)
{
if(dev && dev->light_flush)
Copy path View file
@@ -320,6 +320,11 @@ void ctlra_dev_light_set(struct ctlra_dev_t *dev,
uint32_t light_id,
uint32_t light_status);
/** Feedback item set: sets the value for a feedback item */
void ctlra_dev_feedback_set(struct ctlra_dev_t *dev,
uint32_t fb_id,
float value);
/** Flush the bytes with the Lights/LEDs info over the cable. The device
* implementation must track which lights are actually dirty, and only
* flush the bytes needed. If *force* is set, force flush everything.
Copy path View file
@@ -64,6 +64,9 @@ typedef int32_t (*ctlra_dev_impl_disconnect)(struct ctlra_dev_t *dev);
typedef void (*ctlra_dev_impl_light_set)(struct ctlra_dev_t *dev,
uint32_t light_id,
uint32_t light_status);
typedef void (*ctlra_dev_impl_feedback_set)(struct ctlra_dev_t *dev,
uint32_t fb_id,
float value);
typedef void (*ctlra_dev_impl_light_flush)(struct ctlra_dev_t *dev,
uint32_t force);
typedef void (*ctlra_dev_impl_usb_read_cb)(struct ctlra_dev_t *dev,
@@ -130,6 +133,7 @@ struct ctlra_dev_t {
/* Function pointers to write feedback to device */
ctlra_dev_impl_light_set light_set;
ctlra_dev_impl_feedback_set feedback_set;
ctlra_dev_impl_grid_light_set grid_light_set;
ctlra_dev_impl_light_flush light_flush;
ctlra_dev_impl_usb_read_cb usb_read_cb;
ProTip! Use n and p to navigate between commits in a pull request.