X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=hardware%2Fchronovu-la8%2Fchronovu-la8.c;h=18357827dadd1b919e6fac69ff0b621fc30fc405;hb=c37d2b1ba12b62d63590509879bf58adf842896d;hp=20ffec9d02ce4438e7d666f6894b0b1b2668bfee;hpb=cb93f8a927e6fb2cb1d89176766c5c9c398db5c3;p=libsigrok.git diff --git a/hardware/chronovu-la8/chronovu-la8.c b/hardware/chronovu-la8/chronovu-la8.c index 20ffec9d..18357827 100644 --- a/hardware/chronovu-la8/chronovu-la8.c +++ b/hardware/chronovu-la8/chronovu-la8.c @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include "sigrok.h" +#include "sigrok-internal.h" #define USB_VENDOR_ID 0x0403 #define USB_PRODUCT_ID 0x6001 @@ -41,6 +41,18 @@ static GSList *device_instances = NULL; +static const char *probe_names[NUM_PROBES + 1] = { + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + NULL, +}; + struct la8 { /** FTDI device context (used by libftdi). */ struct ftdi_context *ftdic; @@ -684,11 +696,17 @@ static void hw_cleanup(void) sr_warn("la8: %s: sdi was NULL, continuing", __func__); continue; } +#if 0 + /* + * Fixes a segfault as it's free()d elsewhere already. + * TODO: Document who is supposed to free this, and when. + */ if (sdi->priv != NULL) free(sdi->priv); else sr_warn("la8: %s: sdi->priv was NULL, nothing " "to do", __func__); +#endif sr_device_instance_free(sdi); /* Returns void. */ } g_slist_free(device_instances); /* Returns void. */ @@ -720,6 +738,9 @@ static void *hw_get_device_info(int device_index, int device_info_id) case SR_DI_NUM_PROBES: info = GINT_TO_POINTER(NUM_PROBES); break; + case SR_DI_PROBE_NAMES: + info = probe_names; + break; case SR_DI_SAMPLERATES: fill_supported_samplerates_if_needed(); info = &samplerates;