]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/zeroplus.c
Add SR_ prefix to the KHZ/MHZ/GHZ macros.
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
index d55122a26e5e0ad504876d64683008bcc504c316..e9b599b839fc0c316e4061232cdafc216a97a203 100644 (file)
@@ -25,6 +25,7 @@
 #include <glib.h>
 #include <libusb.h>
 #include <sigrok.h>
+#include <sigrok-internal.h>
 #include "analyzer.h"
 
 #define USB_VENDOR                     0x0c12
@@ -89,22 +90,22 @@ static libusb_context *usb_context = NULL;
 static uint64_t supported_samplerates[] = {
        100,
        500,
-       KHZ(1),
-       KHZ(5),
-       KHZ(25),
-       KHZ(50),
-       KHZ(100),
-       KHZ(200),
-       KHZ(400),
-       KHZ(800),
-       MHZ(1),
-       MHZ(10),
-       MHZ(25),
-       MHZ(50),
-       MHZ(80),
-       MHZ(100),
-       MHZ(150),
-       MHZ(200),
+       SR_KHZ(1),
+       SR_KHZ(5),
+       SR_KHZ(25),
+       SR_KHZ(50),
+       SR_KHZ(100),
+       SR_KHZ(200),
+       SR_KHZ(400),
+       SR_KHZ(800),
+       SR_MHZ(1),
+       SR_MHZ(10),
+       SR_MHZ(25),
+       SR_MHZ(50),
+       SR_MHZ(80),
+       SR_MHZ(100),
+       SR_MHZ(150),
+       SR_MHZ(200),
        0,
 };
 
@@ -273,7 +274,7 @@ static int configure_probes(GSList *probes)
  * API callbacks
  */
 
-static int hw_init(char *deviceinfo)
+static int hw_init(const char *deviceinfo)
 {
        struct sr_device_instance *sdi;
        struct libusb_device_descriptor des;
@@ -444,10 +445,10 @@ static int *hw_get_capabilities(void)
 static int set_configuration_samplerate(uint64_t samplerate)
 {
        g_message("%s(%" PRIu64 ")", __FUNCTION__, samplerate);
-       if (samplerate > MHZ(1))
-               analyzer_set_freq(samplerate / MHZ(1), FREQ_SCALE_MHZ);
-       else if (samplerate > KHZ(1))
-               analyzer_set_freq(samplerate / KHZ(1), FREQ_SCALE_KHZ);
+       if (samplerate > SR_MHZ(1))
+               analyzer_set_freq(samplerate / SR_MHZ(1), FREQ_SCALE_MHZ);
+       else if (samplerate > SR_KHZ(1))
+               analyzer_set_freq(samplerate / SR_KHZ(1), FREQ_SCALE_KHZ);
        else
                analyzer_set_freq(samplerate, FREQ_SCALE_HZ);