diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 61e926ea..5b6417d9 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -59,7 +59,7 @@ static uint64_t supported_samplerates[] = { static struct sr_samplerates samplerates = { SR_KHZ(200), SR_MHZ(200), - 0, + SR_HZ(0), supported_samplerates, }; diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 2f32b2cd..fb6dd7f2 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -64,9 +64,9 @@ static int capabilities[] = { }; static struct sr_samplerates samplerates = { - 1, + SR_HZ(1), SR_GHZ(1), - 1, + SR_HZ(1), NULL, }; diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index 3c2be11d..18e28cff 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -47,9 +47,9 @@ static int capabilities[] = { }; static uint64_t supported_samplerates[] = { - 100, - 200, - 500, + SR_HZ(100), + SR_HZ(200), + SR_HZ(500), SR_KHZ(1), SR_KHZ(2), SR_KHZ(5), @@ -71,9 +71,9 @@ static uint64_t supported_samplerates[] = { }; static struct sr_samplerates samplerates = { - 100, + SR_HZ(100), SR_MHZ(200), - 0, + SR_HZ(0), supported_samplerates, }; diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index 8f8f5cb2..51379d93 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -92,10 +92,10 @@ static int capabilities[] = { }; static struct sr_samplerates samplerates = { - 10, + SR_HZ(10), SR_MHZ(200), - 1, - 0, + SR_HZ(1), + NULL, }; /* List of struct sr_serial_device_instance */ diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 23ba69a9..e4356d9e 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -89,7 +89,7 @@ static uint64_t supported_samplerates[] = { static struct sr_samplerates samplerates = { SR_KHZ(200), SR_MHZ(24), - 0, + SR_HZ(0), supported_samplerates, }; diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index e9b599b8..e18d4db6 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -88,8 +88,8 @@ static libusb_context *usb_context = NULL; * that high. */ static uint64_t supported_samplerates[] = { - 100, - 500, + SR_HZ(100), + SR_HZ(500), SR_KHZ(1), SR_KHZ(5), SR_KHZ(25), @@ -110,7 +110,9 @@ static uint64_t supported_samplerates[] = { }; static struct sr_samplerates samplerates = { - 0, 0, 0, + SR_HZ(0), + SR_HZ(0), + SR_HZ(0), supported_samplerates, }; diff --git a/sigrok.h b/sigrok.h index 946c5470..db747075 100644 --- a/sigrok.h +++ b/sigrok.h @@ -59,6 +59,7 @@ extern "C" { #define SR_MAX_PROBENAME_LEN 32 /* Handy little macros */ +#define SR_HZ(n) (n) #define SR_KHZ(n) ((n) * 1000) #define SR_MHZ(n) ((n) * 1000000) #define SR_GHZ(n) ((n) * 1000000000)