serial: make LCR, modbus, SCPI over serial depend on generic serial comm

Add guards around the implementation of ES51919 chip support for LCR, as
well as modbus and SCPI over serial. To accept when the source files get
compiled in the absence of their dependencies, end up with an empty
implementation in that case.

This approach can simplify build rules when several optional external
dependencies result in differing sets of supported communication means.
This commit is contained in:
Gerhard Sittig 2018-12-27 14:29:00 +01:00 committed by Uwe Hermann
parent 1ac8c2181b
commit 48b7c34629
3 changed files with 12 additions and 0 deletions

View File

@ -27,6 +27,8 @@
#define LOG_PREFIX "es51919"
#ifdef HAVE_SERIAL_COMM
struct dev_buffer {
/** Total size of the buffer. */
size_t size;
@ -854,3 +856,5 @@ SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi)
return SR_OK;
}
#endif

View File

@ -26,6 +26,8 @@
#define LOG_PREFIX "modbus_serial"
#ifdef HAVE_SERIAL_COMM
#define BUFFER_SIZE 1024
struct modbus_serial_rtu {
@ -207,3 +209,5 @@ SR_PRIV const struct sr_modbus_dev_inst modbus_serial_rtu_dev = {
.close = modbus_serial_rtu_close,
.free = modbus_serial_rtu_free,
};
#endif

View File

@ -28,6 +28,8 @@
#define LOG_PREFIX "scpi_serial"
#ifdef HAVE_SERIAL_COMM
struct scpi_serial {
struct sr_serial_dev_inst *serial;
gboolean got_newline;
@ -214,3 +216,5 @@ SR_PRIV const struct sr_scpi_dev_inst scpi_serial_dev = {
.close = scpi_serial_close,
.free = scpi_serial_free,
};
#endif