]> sigrok.org Git - libsigrok.git/blobdiff - hardware/asix-sigma/asix-sigma.c
Rename SR_HWOPT_* and SR_HWCAP_* to SR_CONF_*
[libsigrok.git] / hardware / asix-sigma / asix-sigma.c
index 8ff2e159101a79386603f6e7c1a1a83895c3ccb7..828121ae121bb6614aaa813904e79ce15e462f06 100644 (file)
@@ -77,11 +77,11 @@ static const struct sr_samplerates samplerates = {
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_CAPTURE_RATIO,
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_CAPTURE_RATIO,
 
-       SR_HWCAP_LIMIT_MSEC,
+       SR_CONF_LIMIT_MSEC,
        0,
 };
 
@@ -671,7 +671,7 @@ static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
        }
 
        devc->cur_samplerate = samplerate;
-       devc->period_ps = 1000000000000 / samplerate;
+       devc->period_ps = 1000000000000ULL / samplerate;
        devc->samples_per_event = 16 / devc->num_probes;
        devc->state.state = SIGMA_IDLE;
 
@@ -796,12 +796,6 @@ static int hw_info_get(int info_id, const void **data,
        case SR_DI_HWCAPS:
                *data = hwcaps;
                break;
-       case SR_DI_NUM_PROBES:
-               *data = GINT_TO_POINTER(NUM_PROBES);
-               break;
-       case SR_DI_PROBE_NAMES:
-               *data = probe_names;
-               break;
        case SR_DI_SAMPLERATES:
                *data = &samplerates;
                break;
@@ -830,15 +824,15 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
 
        devc = sdi->priv;
 
-       if (hwcap == SR_HWCAP_SAMPLERATE) {
+       if (hwcap == SR_CONF_SAMPLERATE) {
                ret = set_samplerate(sdi, *(const uint64_t *)value);
-       } else if (hwcap == SR_HWCAP_LIMIT_MSEC) {
+       } else if (hwcap == SR_CONF_LIMIT_MSEC) {
                devc->limit_msec = *(const uint64_t *)value;
                if (devc->limit_msec > 0)
                        ret = SR_OK;
                else
                        ret = SR_ERR;
-       } else if (hwcap == SR_HWCAP_CAPTURE_RATIO) {
+       } else if (hwcap == SR_CONF_CAPTURE_RATIO) {
                devc->capture_ratio = *(const uint64_t *)value;
                if (devc->capture_ratio < 0 || devc->capture_ratio > 100)
                        ret = SR_ERR;
@@ -1277,7 +1271,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        struct dev_context *devc;
        struct sr_datafeed_packet *packet;
        struct sr_datafeed_header *header;
-       struct sr_datafeed_meta_logic meta;
        struct clockselect_50 clockselect;
        int frac, triggerpin, ret;
        uint8_t triggerselect = 0;
@@ -1388,13 +1381,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header->starttime, NULL);
        sr_session_send(devc->session_dev_id, packet);
 
-       /* Send metadata about the SR_DF_LOGIC packets to come. */
-       packet->type = SR_DF_META_LOGIC;
-       packet->payload = &meta;
-       meta.samplerate = devc->cur_samplerate;
-       meta.num_probes = devc->num_probes;
-       sr_session_send(devc->session_dev_id, packet);
-
        /* Add capture source. */
        sr_source_add(0, G_IO_IN, 10, receive_data, (void *)sdi);