From f9e487ae1d4fbb81b9fa7ea7db2b429d69efc418 Mon Sep 17 00:00:00 2001 From: "Alan C. Assis" Date: Sun, 4 Apr 2021 16:15:35 -0300 Subject: [PATCH] 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 70c9f03fd..2e7fea374 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 943bf9c2f..34366bb73 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 c6a2c0449..ab4a374f9 100644 --- a/include/modbus/mbport.h +++ b/include/modbus/mbport.h @@ -38,6 +38,7 @@ #include #include +#include /**************************************************************************** * Public Types