This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new f9e487a  modbus: Fix compilation issue and advice users about termios
f9e487a is described below

commit f9e487ae1d4fbb81b9fa7ea7db2b429d69efc418
Author: Alan C. Assis <[email protected]>
AuthorDate: Sun Apr 4 16:15:35 2021 -0300

    modbus: Fix compilation issue and advice users about termios
---
 examples/modbus/modbus_main.c         | 4 ++++
 examples/modbusmaster/mbmaster_main.c | 4 ++++
 include/modbus/mbport.h               | 1 +
 3 files changed, 9 insertions(+)

diff --git a/examples/modbus/modbus_main.c b/examples/modbus/modbus_main.c
index 70c9f03..2e7fea3 100644
--- a/examples/modbus/modbus_main.c
+++ b/examples/modbus/modbus_main.c
@@ -76,6 +76,10 @@
  ****************************************************************************/
 /* Configuration ************************************************************/
 
+#ifndef CONFIG_SERIAL_TERMIOS
+#  error "CONFIG_SERIAL_TERMIOS is needed by modbus example"
+#endif
+
 #ifndef CONFIG_EXAMPLES_MODBUS_PORT
 #  define CONFIG_EXAMPLES_MODBUS_PORT 0
 #endif
diff --git a/examples/modbusmaster/mbmaster_main.c 
b/examples/modbusmaster/mbmaster_main.c
index 943bf9c..34366bb 100644
--- a/examples/modbusmaster/mbmaster_main.c
+++ b/examples/modbusmaster/mbmaster_main.c
@@ -50,6 +50,10 @@
 
 /* modbus master port */
 
+#ifndef CONFIG_SERIAL_TERMIOS
+#  error "CONFIG_SERIAL_TERMIOS is needed by modbus example"
+#endif
+
 #ifdef CONFIG_EXAMPLES_MODBUSMASTER_PORT
 #  define MBMASTER_PORT CONFIG_EXAMPLES_MODBUSMASTER_PORT
 #else
diff --git a/include/modbus/mbport.h b/include/modbus/mbport.h
index c6a2c04..ab4a374 100644
--- a/include/modbus/mbport.h
+++ b/include/modbus/mbport.h
@@ -38,6 +38,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
+#include <termios.h>
 
 /****************************************************************************
  * Public Types

Reply via email to