Skip to content

Commit

Permalink
jam: properly cleanup libUSB based interaction
Browse files Browse the repository at this point in the history
Also nuke some dead code

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
  • Loading branch information
harryhaaren committed Dec 2, 2017
1 parent 8c97b6c commit 3405db2
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions ctlra/devices/ni_maschine_jam.c
Expand Up @@ -52,8 +52,7 @@ struct ni_maschine_jam_ctlra_t {
uint32_t mask;
};

// WIP: we can use HIDRAW or LibUSB backends
//#define USE_LIBUSB 1
#define USE_LIBUSB 1

static const char *ni_maschine_jam_control_names[] = {
/* Faders / Dials */
Expand Down Expand Up @@ -625,17 +624,6 @@ static void ni_maschine_jam_light_set(struct ctlra_dev_t *base,
uint32_t bright = (light_status >> 24) & 0x7F;
dev->lights[light_id] = bright;

/* FX ON buttons have orange and blue */
#if 0
if(light_id == NI_MASCHINE_JAM_LED_FX_ON_LEFT ||
light_id == NI_MASCHINE_JAM_LED_FX_ON_RIGHT) {
uint32_t r = (light_status >> 16) & 0xFF;
uint32_t b = (light_status >> 0) & 0xFF;
dev->lights[light_id ] = r;
dev->lights[light_id+1] = b;
}
#endif

dev->lights_dirty = 1;
}

Expand Down Expand Up @@ -768,6 +756,9 @@ ni_maschine_jam_disconnect(struct ctlra_dev_t *base)
if(!base->banished)
ni_maschine_jam_light_flush(base, 1);

#ifdef USE_LIBUSB
ctlra_dev_impl_usb_close(base);
#endif
printf("dev disco %p\n", base);
free(dev);
return 0;
Expand Down

0 comments on commit 3405db2

Please sign in to comment.