From: Uwe Hermann Date: Sat, 28 Jan 2012 18:23:09 +0000 (+0100) Subject: sr: Drop analog left-overs from sigrok.h. X-Git-Tag: libsigrok-0.1.0~167 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a4cfb10f7fcb5dd5c7df403bff0787bb6b1c1949;p=libsigrok.git sr: Drop analog left-overs from sigrok.h. For now, there's no analog/scope support in sigrok yet (will be added later), so remove any such items from the public API (sigrok.h). Having '#if defined(HAVE_LA_ALSA)' in sigrok.h is a bug anyway, the API must not have anything device-dependent in general, and sigrok.h specifically must not have any #ifdefs for specific hardware. --- diff --git a/hardware/alsa/alsa.c b/hardware/alsa/alsa.c index 527a7e5d..7a5189c0 100644 --- a/hardware/alsa/alsa.c +++ b/hardware/alsa/alsa.c @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Note: This driver doesn't compile, analog support in sigrok is WIP. */ + #include "config.h" /* Must come before sigrok.h */ #include #include @@ -30,6 +32,17 @@ #define SAMPLE_WIDTH 16 #define AUDIO_DEV "plughw:0,0" +struct sr_analog_probe { + uint8_t att; + uint8_t res; /* Needs to be a power of 2, FIXME */ + uint16_t val; /* Max hardware ADC width is 16bits */ +}; + +struct sr_analog_sample { + uint8_t num_probes; /* Max hardware probes is 256 */ + struct sr_analog_probe probes[]; +}; + static int capabilities[] = { SR_HWCAP_SAMPLERATE, SR_HWCAP_LIMIT_SAMPLES, diff --git a/sigrok.h.in b/sigrok.h.in index 437a32b5..8622eb4b 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -118,19 +118,6 @@ struct sr_datafeed_logic { void *data; }; -#if defined(HAVE_LA_ALSA) -struct sr_analog_probe { - uint8_t att; - uint8_t res; /* Needs to be a power of 2, FIXME */ - uint16_t val; /* Max hardware ADC width is 16bits */ -}; - -struct sr_analog_sample { - uint8_t num_probes; /* Max hardware probes is 256 */ - struct sr_analog_probe probes[]; -}; -#endif - struct sr_input { struct sr_input_format *format; char *param;