Commit Graph

62 Commits

Author SHA1 Message Date
Uwe Hermann da0918aae0 ASIX: Small consistency fixes. 2011-04-25 00:21:40 +02:00
Uwe Hermann e519ba8645 Hardware drivers: Use names for struct entries. 2011-04-19 00:18:06 +02:00
Uwe Hermann 12ad53f5a6 ASIX Sigma: Improve error handling a bit. 2011-04-16 18:08:18 +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 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 82957b65b1 ASIX Sigma: Fix firmware loading bug.
When no firmware file is found, return the right error code so sigrok
doesn't continue running with no firmware loaded.

Thanks Martin Stensgård <mastensg@ping.uio.no> for the patch!
2011-03-25 13:44:16 +01:00
Uwe Hermann c91404191e Add SR_HZ macro for consistency. 2011-03-03 20:24:24 +01:00
Uwe Hermann 59df0c77e2 Add SR_ prefix to the KHZ/MHZ/GHZ macros. 2011-03-03 20:24:24 +01:00
Uwe Hermann 54ac5277c5 Constify some more 'char *' parameters. 2011-02-20 21:16:26 +01:00
Uwe Hermann 6f1be0a2d4 Add sr_ prefix to session_{add,remove}. 2011-02-20 21:16:22 +01:00
Uwe Hermann 60679b18e6 Add sr_ prefix to 'struct samplerates'. 2011-02-08 22:28:01 +01:00
Uwe Hermann 8a2efef2d5 Add sr_ prefix to session related API functions. 2011-02-08 22:28:00 +01:00
Uwe Hermann 1afe89897c Add sr_ prefix for 'struct probe'. 2011-02-08 22:27:58 +01:00
Uwe Hermann 3bbd9849e9 Fix warnings: g_fopen() needs <glib/gstdio.h>. 2011-02-06 02:14:57 +01:00
Uwe Hermann 868d8cefec Use glib's g_fopen() instead of fopen(). 2011-02-05 20:03:17 +01:00
Uwe Hermann 45fdfa307d MinGW: Use "b" in all fopen() calls.
This is required for proper operation on Windows/MinGW, and doesn't
affect other OSes, most POSIX systems simply ignore the "b".
2011-02-04 23:52:16 +01:00
Uwe Hermann 0f33365007 Revert FIRMWARE_DIR / DECODERS_DIR method for now.
There were several issues with the other method, revert for now.
2011-02-04 20:38:20 +01:00
Uwe Hermann 22b0238344 Fix build when no libusb-LA is compiled.
Until now the build would break if the user doesn't enable at least one
of the libusb1.0-based LAs. I.e., you could not compile only OLS, or
only the demo driver.
2011-02-02 10:25:52 +01:00
Uwe Hermann 5a2326a71b SR_ prefix for all public enums. 2011-01-30 18:32:59 +01:00
Uwe Hermann 5c2d46d1db Prefix device structs with sr_. 2011-01-30 18:32:58 +01:00
Uwe Hermann 9f8274a544 Add a field for the full name of a device.
Also, show this long/full name in 'sigrok-cli -V'.
2011-01-30 18:32:58 +01:00
Uwe Hermann b9c735a275 Prefix datafeed structs with sr_. 2011-01-30 18:32:57 +01:00
Uwe Hermann d32d961d17 get_sr_device_instance() -> sr_get_device_instance(). 2011-01-30 18:32:56 +01:00
Uwe Hermann a00ba01228 Change all sigrok_ prefixes to sr_. 2011-01-30 18:32:55 +01:00
Uwe Hermann e46b8fb154 Change SIGROK_ prefix to SR_. 2011-01-30 18:32:53 +01:00
Uwe Hermann 5819184b22 Remove duplicate FIRMWARE_DIR includes.
We use AC_DEFINE_UNQUOTED in configure.ac now to put the FIRMWARE_DIR #define
in the config.h file, which is included where we need the #define.
2011-01-21 21:14:37 +01:00
Håvard Espeland 94ba4bd689 Sigma: Update set_configuration to reflect API. 2011-01-18 23:12:57 +01:00
Håvard Espeland 7c70c53843 Sigma: Set default samplerate to 200 KHz. 2011-01-18 22:39:46 +01:00
Håvard Espeland 5b5ea7c6d2 Sigma: Only send trigger packet if enabled.
The Sigma hardware emits a default trigger event.
2011-01-18 22:24:23 +01:00
Håvard Espeland abda62ced8 Sigma: Never send empty packets. 2011-01-18 22:17:43 +01:00
Håvard Espeland 88c51afe87 Sigma: Support for decoding partial chunks.
Samples are stored in chunks and the last samples do not fill up
a complete chunk. This patch adds support for decoding partial
chunks.
2011-01-16 17:05:14 +01:00
Håvard Espeland 98b8cbc17e Sigma: Limit number of edge triggers to 1.
Actually, Sigma supports 2 rising/falling triggers,
but they are ORed and the current trigger syntax
does not permit ORed triggers.
2011-01-15 20:01:00 +01:00
Håvard Espeland 31facdd3c5 Sigma: Download samples from partial chunks. 2011-01-15 19:20:31 +01:00
Håvard Espeland 9996570987 Sigma: Move sigma state to device specific struct
Thanks to Daniel Ribeiro for contributing this patch. Some
modifications were done.

Not tested on multiple Sigmas, because of lack of hardware.
2011-01-15 17:04:21 +01:00
Uwe Hermann c2bd92ec08 Slightly more consistent #include-guard naming. 2011-01-15 14:48:21 +01:00
Håvard Espeland 9be9893eed Sigma: Check state in hw_closedev
If the device is closed without previously running hw_openedev
the driver crashes (happens in cleanup). This patch checks
if the device has been opened.
2011-01-15 14:13:23 +01:00
Daniel Ribeiro c2616fb9fa update plugins and cli to use new DF_HEADER 2011-01-10 15:12:38 -02:00
Bert Vermeulen 4c046c6bcc change all DF_LOGIC* to a single DF_LOGIC type
The datafeed packet has a new field 'unitsize' to denote the number of
bytes per sample in the payload.
2011-01-09 06:32:38 +01:00
Uwe Hermann 7c17ac6cc4 Only build hardware drivers if they're enabled. 2011-01-08 20:58:43 +01:00
Uwe Hermann 340f6e7aea Fix out-of-tree build.
Use libtool "noinst" local helper libs and use one Makefile.am per
subdir, which is the usual/preferred method. These helper libraries are
purely local and will not be installed.

This also fixes out-of-tree builds of sigrok, i.e. building in a
directory other than the sigrok source directory, e.g.

 $ cd /home/user
 $ git clone ...sigrok
 $ cd sigrok
 $ ./autogen.sh
 $ mkdir /tmp/foo
 $ cd /tmp/foo
 $ /home/user/sigrok/configure
 $ make
 $ make install

This will place all build results (.o files, .la files, etc) in the
local build directory (/tmp/foo) instead of the source directory
(/home/user/sigrok in this example). The installation directory is
selected via the --prefix configure option (/usr/local per default).
2011-01-08 03:32:25 +01:00
Håvard Espeland bdfc7a8974 Sigma: Small cleanups. 2010-05-03 22:01:03 +02:00
Håvard Espeland 36b1c8e61b Sigma: Use software trigger to pinpoint exact sample. 2010-05-03 21:32:03 +02:00
Håvard Espeland 6aac77375b Sigma: Add state machine for tracking Sigma status. 2010-05-03 19:04:10 +02:00
Håvard Espeland a42aec7f6e Sigma: Merge storage of rise/fall triggers. 2010-05-03 15:06:43 +02:00
Håvard Espeland 4ae1f45136 Sigma: Minor cleanups. 2010-05-02 21:59:14 +02:00
Håvard Espeland 11fc8d9d93 Sigma: Set capture ratio correctly. 2010-05-02 21:59:14 +02:00
Håvard Espeland c53d793f03 Sigma: 50 MHZ falling/rising edge trigger support.
Falling/rising edge and value/mask triggers can be combined, e.g.:
  --triggers 1=0,2=r,3=1,4=1
2010-05-02 16:32:24 +02:00
Håvard Espeland f758d0744d Sigma: Fix simple trigger LUT calculation. 2010-05-02 13:00:41 +02:00
Håvard Espeland ee492173a1 Sigma: Value/mask trigger support in 50 MHz mode. 2010-05-01 23:16:27 +02:00
Håvard Espeland eec5275e2f Sigma: Small cleanups. 2010-05-01 23:16:18 +02:00