]> sigrok.org Git - libsigrok.git/blobdiff - hardware/openbench-logic-sniffer/ols.c
sr: adjust copyright year
[libsigrok.git] / hardware / openbench-logic-sniffer / ols.c
index 1b7970e31ed18f3ec3eff9cfbefa89642dd2a0e5..d71c025123cc6446a3b1918a3dd55404a7a03922 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the sigrok project.
  *
- * Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
+ * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -359,7 +359,7 @@ static int hw_init(const char *deviceinfo)
        final_devcnt = 0;
 
        if (deviceinfo)
-               ports = g_slist_append(NULL, strdup(deviceinfo));
+               ports = g_slist_append(NULL, g_strdup(deviceinfo));
        else
                /* No specific device given, so scan all serial ports. */
                ports = list_serial_ports();
@@ -415,10 +415,10 @@ static int hw_init(const char *deviceinfo)
                        send_shortcommand(fd, CMD_ID);
                        fds[devcnt].fd = fd;
                        fds[devcnt].events = G_IO_IN;
-                       device_names[devcnt] = strdup(l->data);
+                       device_names[devcnt] = g_strdup(l->data);
                        devcnt++;
                }
-               free(l->data);
+               g_free(l->data);
        }
 
        /* 2ms isn't enough for reliable transfer with pl2303, let's try 10 */
@@ -465,8 +465,8 @@ static int hw_init(const char *deviceinfo)
                        serial_restore_params(fds[i].fd, serial_params[i]);
                        serial_close(fds[i].fd);
                }
-               free(serial_params[i]);
-               free(device_names[i]);
+               g_free(serial_params[i]);
+               g_free(device_names[i]);
        }
 
        g_free(serial_params);
@@ -614,11 +614,11 @@ static int set_configuration_samplerate(struct sr_device_instance *sdi,
         * from the requested.
         */
        ols->cur_samplerate = CLOCK_RATE / (ols->cur_samplerate_divider + 1);
-       if(ols->flag_reg & FLAG_DEMUX)
+       if (ols->flag_reg & FLAG_DEMUX)
                ols->cur_samplerate *= 2;
-       if(ols->cur_samplerate != samplerate)
-               sr_warn("ols: can't match samplerate %" PRIu64 ", using %" PRIu64, 
-                       samplerate, ols->cur_samplerate);
+       if (ols->cur_samplerate != samplerate)
+               sr_err("ols: can't match samplerate %" PRIu64 ", using %"
+                      PRIu64, samplerate, ols->cur_samplerate);
 
        return SR_OK;
 }
@@ -650,7 +650,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
                if (*tmp_u64 < MIN_NUM_SAMPLES)
                        return SR_ERR;
                if (*tmp_u64 > ols->max_samples)
-                       sr_warn("ols: sample limit exceeds hw max");
+                       sr_err("ols: sample limit exceeds hw max");
                ols->limit_samples = *tmp_u64;
                sr_info("ols: sample limit %" PRIu64, ols->limit_samples);
                ret = SR_OK;
@@ -1002,7 +1002,6 @@ static int hw_start_acquisition(int device_index, gpointer session_data)
        gettimeofday(&header->starttime, NULL);
        header->samplerate = ols->cur_samplerate;
        header->num_logic_probes = NUM_PROBES;
-       header->num_analog_probes = 0;
        sr_session_bus(session_data, packet);
 
        g_free(header);
@@ -1022,7 +1021,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
        sr_session_bus(session_device_id, &packet);
 }
 
-struct sr_device_plugin ols_plugin_info = {
+SR_PRIV struct sr_device_plugin ols_plugin_info = {
        .name = "ols",
        .longname = "Openbench Logic Sniffer",
        .api_version = 1,