Cosmetics.
This commit is contained in:
parent
aa0b6b208e
commit
484760d1a8
|
@ -25,6 +25,7 @@ int sigrok_init(void)
|
||||||
return load_hwplugins();
|
return load_hwplugins();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: Should return int to be able to report back error codes. */
|
||||||
void sigrok_cleanup(void)
|
void sigrok_cleanup(void)
|
||||||
{
|
{
|
||||||
device_close_all();
|
device_close_all();
|
||||||
|
|
|
@ -49,7 +49,7 @@ int datastore_destroy(struct datastore *ds)
|
||||||
|
|
||||||
if (!ds)
|
if (!ds)
|
||||||
return SIGROK_ERR;
|
return SIGROK_ERR;
|
||||||
|
|
||||||
for (chunk = ds->chunklist; chunk; chunk = chunk->next)
|
for (chunk = ds->chunklist; chunk; chunk = chunk->next)
|
||||||
g_free(chunk->data);
|
g_free(chunk->data);
|
||||||
g_slist_free(ds->chunklist);
|
g_slist_free(ds->chunklist);
|
||||||
|
|
|
@ -62,7 +62,6 @@ extern struct device_plugin asix_sigma_plugin_info;
|
||||||
extern struct device_plugin link_mso19_plugin_info;
|
extern struct device_plugin link_mso19_plugin_info;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* TODO: No linked list needed, this can be a simple array. */
|
/* TODO: No linked list needed, this can be a simple array. */
|
||||||
int load_hwplugins(void)
|
int load_hwplugins(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,7 @@ char *sigrok_samplerate_string(uint64_t samplerate)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
o = malloc(30 + 1); /* Enough for a uint64_t as string + " GHz". */
|
o = malloc(30 + 1); /* Enough for a uint64_t as string + " GHz". */
|
||||||
if (o == NULL)
|
if (!o)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (samplerate >= GHZ(1))
|
if (samplerate >= GHZ(1))
|
||||||
|
@ -59,7 +59,6 @@ char *sigrok_samplerate_string(uint64_t samplerate)
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a numeric samplerate value to the "natural" string representation
|
* Convert a numeric samplerate value to the "natural" string representation
|
||||||
* of its period.
|
* of its period.
|
||||||
|
@ -76,7 +75,7 @@ char *sigrok_period_string(uint64_t frequency)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
o = malloc(30 + 1); /* Enough for a uint64_t as string + " ms". */
|
o = malloc(30 + 1); /* Enough for a uint64_t as string + " ms". */
|
||||||
if (o == NULL)
|
if (!o)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (frequency >= GHZ(1))
|
if (frequency >= GHZ(1))
|
||||||
|
@ -96,4 +95,3 @@ char *sigrok_period_string(uint64_t frequency)
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
15
sigrok.h
15
sigrok.h
|
@ -27,7 +27,6 @@
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <libusb.h>
|
#include <libusb.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Status/error codes returned by libsigrok functions.
|
* Status/error codes returned by libsigrok functions.
|
||||||
*
|
*
|
||||||
|
@ -54,7 +53,6 @@
|
||||||
#define MAX_NUM_PROBES 64
|
#define MAX_NUM_PROBES 64
|
||||||
#define MAX_PROBENAME_LEN 32
|
#define MAX_PROBENAME_LEN 32
|
||||||
|
|
||||||
|
|
||||||
/* Handy little macros */
|
/* Handy little macros */
|
||||||
#define KHZ(n) ((n) * 1000)
|
#define KHZ(n) ((n) * 1000)
|
||||||
#define MHZ(n) ((n) * 1000000)
|
#define MHZ(n) ((n) * 1000000)
|
||||||
|
@ -70,10 +68,8 @@
|
||||||
#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
|
#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef int (*receive_data_callback) (int fd, int revents, void *user_data);
|
typedef int (*receive_data_callback) (int fd, int revents, void *user_data);
|
||||||
|
|
||||||
|
|
||||||
/* Data types used by hardware plugins for set_configuration() */
|
/* Data types used by hardware plugins for set_configuration() */
|
||||||
enum {
|
enum {
|
||||||
T_UINT64,
|
T_UINT64,
|
||||||
|
@ -91,8 +87,6 @@ struct protocol {
|
||||||
int stackindex;
|
int stackindex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* datafeed_packet.type values */
|
/* datafeed_packet.type values */
|
||||||
enum {
|
enum {
|
||||||
DF_HEADER,
|
DF_HEADER,
|
||||||
|
@ -119,8 +113,6 @@ struct datafeed_header {
|
||||||
int num_logic_probes;
|
int num_logic_probes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct input {
|
struct input {
|
||||||
struct input_format *format;
|
struct input_format *format;
|
||||||
char *param;
|
char *param;
|
||||||
|
@ -135,8 +127,6 @@ struct input_format {
|
||||||
int (*loadfile) (struct input *in, const char *filename);
|
int (*loadfile) (struct input *in, const char *filename);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct output {
|
struct output {
|
||||||
struct output_format *format;
|
struct output_format *format;
|
||||||
struct device *device;
|
struct device *device;
|
||||||
|
@ -155,7 +145,6 @@ struct output_format {
|
||||||
uint64_t *length_out);
|
uint64_t *length_out);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct analyzer {
|
struct analyzer {
|
||||||
char *name;
|
char *name;
|
||||||
char *filename;
|
char *filename;
|
||||||
|
@ -165,7 +154,6 @@ struct analyzer {
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Size of a chunk in units */
|
/* Size of a chunk in units */
|
||||||
#define DATASTORE_CHUNKSIZE 512000
|
#define DATASTORE_CHUNKSIZE 512000
|
||||||
|
|
||||||
|
@ -176,7 +164,6 @@ struct datastore {
|
||||||
GSList *chunklist;
|
GSList *chunklist;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This represents a generic device connected to the system.
|
* This represents a generic device connected to the system.
|
||||||
* For device-specific information, ask the plugin. The plugin_index refers
|
* For device-specific information, ask the plugin. The plugin_index refers
|
||||||
|
@ -209,7 +196,6 @@ struct probe {
|
||||||
|
|
||||||
extern GSList *devices;
|
extern GSList *devices;
|
||||||
|
|
||||||
|
|
||||||
/* Hardware plugin capabilities */
|
/* Hardware plugin capabilities */
|
||||||
enum {
|
enum {
|
||||||
HWCAP_DUMMY, /* Used to terminate lists */
|
HWCAP_DUMMY, /* Used to terminate lists */
|
||||||
|
@ -235,7 +221,6 @@ struct hwcap_option {
|
||||||
char *shortname;
|
char *shortname;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct sigrok_device_instance {
|
struct sigrok_device_instance {
|
||||||
int index;
|
int index;
|
||||||
int status;
|
int status;
|
||||||
|
|
Loading…
Reference in New Issue