Commit Graph

36 Commits

Author SHA1 Message Date
Uwe Hermann 5edc02c77c Add missing "ULL" suffixes.
These numbers are larger than 32bit, mark them as ULL to avoid compile
failures on 32bit systems.
2013-01-20 20:39:18 +01:00
Petteri Aimonen 8c012adbc1 Add support for fs and ps to sr_parse_period.
These time units are used in VCD files.
2012-11-20 21:02:14 +02:00
Uwe Hermann a885ce3ee9 Various subsystems: Use message logging helpers. 2012-11-11 18:14:17 +01:00
Uwe Hermann 393fb9cb18 Doxygen: Add @file items for the relevant files.
These short descriptions are shown in the "Files" section of the
Doxygen output.
2012-10-22 11:56:18 +02:00
Uwe Hermann 6b2d8d3e5c Doxygen: TODO cleanup, use @todo where needed.
Turn TODOs which should be user-visible into @todo so that Doxygen
shows them in the function docs, and also on the special "Todo List" page.

Those TODOs that should not be in the Doxygen docs are moved out of the
/** */ comment blocks.

Also fix some comments/items, and remove some obsolete ones.
2012-10-22 11:56:18 +02:00
Uwe Hermann 9c5332d291 Doxygen: Fix a bunch of warnings and outdated docs. 2012-10-22 11:56:18 +02:00
Uwe Hermann 7b870c38e3 Doxygen: Initial groups and topic short descriptions. 2012-10-22 11:56:18 +02:00
Bert Vermeulen 17ff11240e don't accept numbers as probe identifiers in trigger string
Only the probe name, as supplied by the device driver, is accepted.
2012-10-14 14:59:07 +02:00
Joel Holdsworth 4cc9aea15b sr: Refactored sr_samplerate_string into a more general function: sr_si_string_u64 2012-09-03 13:53:09 +02:00
Bert Vermeulen 31fc1fbce3 sr: fix sr_parse_triggerstring() to use probe numbers starting from 0 2012-08-03 11:28:59 +02:00
Bert Vermeulen 92ae798483 sr: convert sr_parse_triggerstring() to use sdi 2012-08-03 11:27:31 +02:00
Bert Vermeulen 45c59c8bdd sr: moved sigrok.h so libsigrok/libsigrok.h
All frontends will have to include <libsigrok/libsigrok.h> from now on.
This header includes proto.h and version.h, both installed from the
distribution into $INCLUDE/libsigrok/ as well.

The only dynamically changed header is now version.h, which has both
libsigrok and libtool compile-time versions in it.
2012-07-05 01:17:28 +02:00
Joel Holdsworth b7f578bef5 sr: Made the dev_info_get return value const 2012-05-31 19:51:10 +01:00
Bert Vermeulen 79afc8cac4 sr: add voltage parser and prettyprinter 2012-05-30 23:56:12 +02:00
Bert Vermeulen 76f4c61086 sr: add period parser 2012-05-30 23:56:12 +02:00
Bert Vermeulen 993526f824 sr: don't use deprecated glib functions
As of the recent glib 2.32 release, these produce deprecation warnings
at compile time.
2012-04-23 15:31:41 +02:00
Uwe Hermann 0aeb0ccd55 sr: sr_err() et. al. don't need trailing \n. 2012-04-10 23:25:57 +02:00
Uwe Hermann bf978d3553 sr: sr_parse_triggerstring docs/improvements.
Also fix smaller typos and cosmetics.
2012-04-10 23:25:56 +02:00
Uwe Hermann c09f0b578c sr/cli/gtk/qt/: s/plugin/driver/. 2012-02-28 23:52:30 +01:00
Uwe Hermann c69e35a714 sr: sr_samplerate_string: Allow 3.15Hz etc. as output.
This is required for some hardware, e.g. ChronoVu LA8, where
33.333333 MHz or 2.439024 MHz are valid samplerates. This is because the
hardware takes a sampleperiod (in nanoseconds) as input, not a
samplerate (in Hz).
2012-02-27 22:27:33 +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 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 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 b7f09cf86d libsigrok: Fix #includes.
In the lib, we should only #include "sigrok.h" or "sigrok-internal.h",
but not the (possibly installed and thus different/older versions) via
<sigrok.h> or <sigrok-internal.h>.

Frontends should of course use <sigrok.h> and <sigrok-internal.h>.
2011-12-28 23:07:08 +01:00
Uwe Hermann a0ecd83bc6 Make more variables/functions static and non-global.
The 'GSList *devices' from device.c was actually really global (i.e.,
listed in sigrok.h), which is now fixed.
2011-12-28 22:55:21 +01:00
Bert Vermeulen f64c14141b fix CLI size string specification
accept "hz" as optional qualifier but nothing else
properly return an error instead of quietly returning zero size
2011-11-27 19:33:07 +01:00
Gareth McMullin 4d436e71ba Changed SR_T_NULL to SR_T_BOOL and adjusted RLE option. 2011-11-19 13:41:41 +13:00
Uwe Hermann a562c3a2e5 libsigrok: Use sr_err() et al instead of printf. 2011-11-17 23:47:45 +01: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 59df0c77e2 Add SR_ prefix to the KHZ/MHZ/GHZ macros. 2011-03-03 20:24:24 +01:00
Uwe Hermann dfcc0bf9d3 strutil.c: Fix typo, add some (API) docs/comments. 2011-02-08 22:28:03 +01:00
Uwe Hermann 1afe89897c Add sr_ prefix for 'struct probe'. 2011-02-08 22:27:58 +01:00
Bert Vermeulen 40f5ddac01 move samplerate/period printers and parsers into libsigrok 2011-01-31 22:29:40 +01:00
Renamed from output/common.c (Browse further)