Add SR_HZ macro for consistency.

This commit is contained in:
Uwe Hermann 2011-02-22 18:05:16 +01:00
parent 59df0c77e2
commit c91404191e
7 changed files with 18 additions and 15 deletions

View File

@ -59,7 +59,7 @@ static uint64_t supported_samplerates[] = {
static struct sr_samplerates samplerates = { static struct sr_samplerates samplerates = {
SR_KHZ(200), SR_KHZ(200),
SR_MHZ(200), SR_MHZ(200),
0, SR_HZ(0),
supported_samplerates, supported_samplerates,
}; };

View File

@ -64,9 +64,9 @@ static int capabilities[] = {
}; };
static struct sr_samplerates samplerates = { static struct sr_samplerates samplerates = {
1, SR_HZ(1),
SR_GHZ(1), SR_GHZ(1),
1, SR_HZ(1),
NULL, NULL,
}; };

View File

@ -47,9 +47,9 @@ static int capabilities[] = {
}; };
static uint64_t supported_samplerates[] = { static uint64_t supported_samplerates[] = {
100, SR_HZ(100),
200, SR_HZ(200),
500, SR_HZ(500),
SR_KHZ(1), SR_KHZ(1),
SR_KHZ(2), SR_KHZ(2),
SR_KHZ(5), SR_KHZ(5),
@ -71,9 +71,9 @@ static uint64_t supported_samplerates[] = {
}; };
static struct sr_samplerates samplerates = { static struct sr_samplerates samplerates = {
100, SR_HZ(100),
SR_MHZ(200), SR_MHZ(200),
0, SR_HZ(0),
supported_samplerates, supported_samplerates,
}; };

View File

@ -92,10 +92,10 @@ static int capabilities[] = {
}; };
static struct sr_samplerates samplerates = { static struct sr_samplerates samplerates = {
10, SR_HZ(10),
SR_MHZ(200), SR_MHZ(200),
1, SR_HZ(1),
0, NULL,
}; };
/* List of struct sr_serial_device_instance */ /* List of struct sr_serial_device_instance */

View File

@ -89,7 +89,7 @@ static uint64_t supported_samplerates[] = {
static struct sr_samplerates samplerates = { static struct sr_samplerates samplerates = {
SR_KHZ(200), SR_KHZ(200),
SR_MHZ(24), SR_MHZ(24),
0, SR_HZ(0),
supported_samplerates, supported_samplerates,
}; };

View File

@ -88,8 +88,8 @@ static libusb_context *usb_context = NULL;
* that high. * that high.
*/ */
static uint64_t supported_samplerates[] = { static uint64_t supported_samplerates[] = {
100, SR_HZ(100),
500, SR_HZ(500),
SR_KHZ(1), SR_KHZ(1),
SR_KHZ(5), SR_KHZ(5),
SR_KHZ(25), SR_KHZ(25),
@ -110,7 +110,9 @@ static uint64_t supported_samplerates[] = {
}; };
static struct sr_samplerates samplerates = { static struct sr_samplerates samplerates = {
0, 0, 0, SR_HZ(0),
SR_HZ(0),
SR_HZ(0),
supported_samplerates, supported_samplerates,
}; };

View File

@ -59,6 +59,7 @@ extern "C" {
#define SR_MAX_PROBENAME_LEN 32 #define SR_MAX_PROBENAME_LEN 32
/* Handy little macros */ /* Handy little macros */
#define SR_HZ(n) (n)
#define SR_KHZ(n) ((n) * 1000) #define SR_KHZ(n) ((n) * 1000)
#define SR_MHZ(n) ((n) * 1000000) #define SR_MHZ(n) ((n) * 1000000)
#define SR_GHZ(n) ((n) * 1000000000) #define SR_GHZ(n) ((n) * 1000000000)