Commit Graph

118 Commits

Author SHA1 Message Date
Bert Vermeulen d27e406e13 sr: new output format 'float', just floating point values
Also outputs FRAME-BEGIN and FRAME-END, if present in the stream.
2012-06-19 02:05:28 +02:00
Bert Vermeulen cdea754ae5 sr: remove unused code 2012-06-19 02:04:18 +02:00
Uwe Hermann 054e670906 sr: out: Use uint8_t (not char) for buffers. 2012-03-31 11:33:43 +02:00
Uwe Hermann 2e7cb0040a cli: Fix -V/-h output a bit.
Options and their defaults should not be documented there, but rather in
the manpage or such.
2012-03-21 23:20:09 +01:00
Uwe Hermann 8ec95d2282 sr/srd: Small fixes, constifications, doc updates. 2012-03-21 23:20:09 +01:00
Uwe Hermann c09f0b578c sr/cli/gtk/qt/: s/plugin/driver/. 2012-02-28 23:52:30 +01:00
Bert Vermeulen 2285cf9bc5 sr: code cleanup 2012-02-28 17:47:02 +01:00
Uwe Hermann 5097b0d091 sr/cli/gtk/qt: s/get_dev_info/dev_info_get/. 2012-02-18 11:41:21 +01:00
Uwe Hermann bb7ef79377 sr/cli/gtk/qt: s/device/dev/ in many places.
Also, a few s/instance/inst/ occurences.
2012-02-17 23:47:00 +01:00
Uwe Hermann 44dae53925 sr: Random cosmetics, fix/amend Doxygen comments. 2012-02-17 22:40:51 +01:00
Uwe Hermann 7b48d6e104 sr: Prefix log messages with subsystem string. 2012-02-17 22:40:51 +01:00
Bert Vermeulen c73d2ea421 sr: adjust copyright year 2012-02-13 14:31:51 +01:00
Bert Vermeulen 031685005b sr: rename all sr_device_* functions to sr_dev_* 2012-02-13 14:00:47 +01:00
Uwe Hermann 133a37bfba Use g_try_malloc/g_free/g_strdup consistently.
Avoid plain malloc()/free() in sr/srd, especially in the API calls.
Also avoid g_malloc*() in favor of g_try_malloc*().

Use g_strdup() instead of strdup() so that we can use g_free()
consistently everywhere.

Exceptions: Stuff that is allocated via other libs (not using glib),
should also be properly free'd using the respective free-ing function
(instead of g_free()). Examples: Stuff allocated by libusb, libftdi, etc.

Also, use sr_err() instead of sr_warn() for actual errors. sr_warn() is
meant for non-fatal/uncritical warnings.
2012-02-11 22:34:16 +01:00
Uwe Hermann 7c1d391c8b sr: input/output: Mark more symbols with SR_PRIV. 2012-02-05 15:05:13 +01:00
Uwe Hermann 0f8522bf74 Project-wide consistent naming for #include guards.
Document the naming scheme in HACKING.
2012-02-05 15:05:13 +01:00
Uwe Hermann 1a081ca67d sr: Mark API functions with SR_API/SR_PRIV.
Use SR_API to mark public API symbols, and SR_PRIV for private symbols.

Variables and functions marked 'static' are private already and don't
need SR_PRIV. However, functions which are not static (because they need
to be used in other libsigrok-internal files) but are also not meant to
be part of the public libsigrok API, must use SR_PRIV.

This uses the 'visibility' feature of gcc (requires gcc >= 4.0).

Details: http://gcc.gnu.org/wiki/Visibility
2012-02-02 00:03:17 +01:00
Uwe Hermann 66410a8617 sr: g_free()/g_string_free() can handle NULL input. 2012-01-19 00:32:02 +01:00
Uwe Hermann 0da5b6a9f5 sr: Remove useless filename prefixes. 2012-01-03 20:01:02 +01:00
Uwe Hermann cd315a80d8 sr/srd: Fix left-over #includes.
The libs themselves should use #include "sigrok.h" etc., while the
frontends must use #include <sigrok.h> and so on.
2012-01-03 19:56:01 +01:00
Uwe Hermann db8ae7b941 sr/srd: Remove/fix non-applicable autotools stuff. 2011-12-30 11:14:24 +01:00
Uwe Hermann cb93f8a927 Other method to avoid "unused var" compiler warnings.
The '(void)varname' method is nicer than 'varname = varname' and also
prevents warnings when compiling sigrok with clang instead of gcc.
2011-11-24 22:57:48 +01:00
Uwe Hermann 719c5a934c Fix some compiler warnings. 2011-11-15 21:05:40 +01:00
Uwe Hermann 548b08e55c Drop unneeded skeleton files.
They're not too useful as they mostly consist of a list of function names,
and that list is already available in the respective struct. The wiki
API docs and the code in the various hardware/output drivers serve as
useful examples already, no need for additional files.
2011-05-05 13:06:12 +02:00
Uwe Hermann 02604ed6de Initial support for CSV as output format. 2011-04-27 00:25:57 +02:00
Uwe Hermann b53738baf7 Replace g_malloc{0,} with g_try_malloc{0,}.
The g_malloc()/g_malloc0() versions exit/segfault if not enough memory
is available, which is not a good thing in libsigrok.

Instead, we use the g_try_malloc()/g_try_malloc0() variants, which
return NULL if not enough memory is available, so that the caller can
handle the error properly.
2011-04-16 18:08:15 +02:00
Uwe Hermann 50959ddcdc gnuplot output: Optimize by only storing changes.
Only output new lines in gnuplot output if there have been changes in
the samples (similar to what VCD does). As long as the first and last
sample are output, the resulting plot looks OK.

This reduces the size of the output file from roughly 200MB to just 60KB
in one specific test setup (depends on the number of probes and on the
signal, of course). The time and CPU load required to generate the gnuplot
output and the resulting plot (PNG or other) is also drastically reduced
from multiple minutes to roughly 30 seconds (again, depends on various
things).

Thanks Ken Mobley of ChronoVu for the report.
2011-04-15 21:49:22 +02:00
Uwe Hermann b08024a836 libsigrok: Introduce sr_dbg/sr_info/sr_warn/sr_err.
We should use these (internal) functions in libsigrok exclusively from
now on, i.e. no more use of glib's g_debug() etc.

These functions are only for libsigrok, the frontends use whatever
logging mechanism is suitable there.
2011-04-14 10:11:08 +02:00
Uwe Hermann 8c48f17944 Add chronovu-la8 output file format. 2011-04-10 23:59:38 +02:00
Uwe Hermann 20ebd1fe1d gnuplot output: More error checks. 2011-04-10 23:03:34 +02:00
Uwe Hermann cdb3573ceb input/output formats: s/extension/id/.
The struct entry 'extension' is not really a (filename) extension, but
rather a unique ID used for input or output formats, e.g. in the sigrok
CLI or GUI interface. Thus, rename it accordingly.
2011-04-10 23:03:34 +02:00
Uwe Hermann 819184ee68 Binary output: Add more error checks. 2011-04-10 23:03:33 +02:00
Uwe Hermann d494a4aa9d input/output formats: Explicit struct member names.
This makes it immediately clear what an entry is supposed to be, no
need to look it up in some header file.
2011-04-10 23:03:33 +02:00
Uwe Hermann 847c21bc65 Hook up output/text directory with autotools.
This is needed for 'make distcheck' to work.

Also, add missing text.h to the list of source files.
2011-04-03 20:15:12 +02:00
Bert Vermeulen 4487177c79 output_ols: disabled cursors don't really need to be listed 2011-04-03 06:18:05 +02:00
Uwe Hermann 120b259ea8 Drop obsolete vcd_header. 2011-03-03 20:24:25 +01:00
Uwe Hermann d078d2e5f3 Make some more items 'static'. 2011-03-03 20:24:25 +01:00
Uwe Hermann 59df0c77e2 Add SR_ prefix to the KHZ/MHZ/GHZ macros. 2011-03-03 20:24:24 +01:00
Uwe Hermann 9688b443f6 Add SR_ prefix for MAX_NUM_PROBES/MAX_PROBENAME_LEN. 2011-02-20 21:16:26 +01:00
Uwe Hermann 54ac5277c5 Constify some more 'char *' parameters. 2011-02-20 21:16:26 +01:00
Uwe Hermann 809c5f2011 Add sr_ prefix for analog stuff some structs. 2011-02-20 21:16:24 +01:00
Uwe Hermann 77b454421a Disable analog bits/gnuplot output for now. 2011-02-20 21:16:20 +01:00
Bert Vermeulen 305bde4d42 implement version 1.3 of the OLS output format, now streaming 2011-02-12 06:18:16 +01:00
Uwe Hermann 2bf4aca64a Add sr_ prefix for device related API functions. 2011-02-08 22:28:02 +01:00
Uwe Hermann 1afe89897c Add sr_ prefix for 'struct probe'. 2011-02-08 22:27:58 +01:00
Bert Vermeulen 6e738600eb output_ols: now fully compliant with spec 2011-02-01 06:13:32 +01:00
Bert Vermeulen 3a28509817 don't just assume a device has a samplerate setting 2011-02-01 02:33:54 +01:00
Bert Vermeulen 40f5ddac01 move samplerate/period printers and parsers into libsigrok 2011-01-31 22:29:40 +01:00
Uwe Hermann 5a2326a71b SR_ prefix for all public enums. 2011-01-30 18:32:59 +01:00
Uwe Hermann a00ba01228 Change all sigrok_ prefixes to sr_. 2011-01-30 18:32:55 +01:00