freemodbus: add extern c block into common header for cpp

* Original commit: espressif/esp-idf@b1fe4c4cc6
This commit is contained in:
Alex Lisitsyn
2020-04-17 17:56:50 +08:00
committed by aleks
parent 7cb1e34dd6
commit 2ce5c0cb95
4 changed files with 26 additions and 1 deletions

View File

@@ -18,6 +18,10 @@
#include "driver/uart.h" // for UART types
#ifdef __cplusplus
extern "C" {
#endif
#define MB_CONTROLLER_STACK_SIZE (CONFIG_FMB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller
#define MB_CONTROLLER_PRIORITY (CONFIG_FMB_SERIAL_TASK_PRIO - 1) // priority of MB controller task
@@ -135,4 +139,8 @@ typedef esp_err_t (*iface_destroy)(void); /*!< Interface method
typedef esp_err_t (*iface_setup)(void*); /*!< Interface method setup */
typedef esp_err_t (*iface_start)(void); /*!< Interface method start */
#ifdef __cplusplus
}
#endif
#endif // _MB_IFACE_COMMON_H

View File

@@ -21,6 +21,10 @@
#include "soc/soc.h" // for BITN definitions
#include "esp_modbus_common.h" // for common types
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \brief Modbus descriptor table parameter type defines.
*/
@@ -238,4 +242,8 @@ esp_err_t mbc_master_get_parameter(uint16_t cid, char* name, uint8_t* value, uin
*/
esp_err_t mbc_master_set_parameter(uint16_t cid, char* name, uint8_t* value, uint8_t *type);
#ifdef __cplusplus
}
#endif
#endif // _ESP_MB_MASTER_INTERFACE_H

View File

@@ -24,6 +24,10 @@
#include "freertos/event_groups.h" // for event groups
#include "esp_modbus_common.h" // for common types
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Parameter access event information type
*/
@@ -120,4 +124,8 @@ esp_err_t mbc_slave_get_param_info(mb_param_info_t* reg_info, uint32_t timeout);
*/
esp_err_t mbc_slave_set_descriptor(mb_register_area_descriptor_t descr_data);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
// mbcontroller.h
// mbcontroller common header
// mbcontroller - common Modbus controller header file
#ifndef _MODBUS_CONTROLLER_COMMON
#define _MODBUS_CONTROLLER_COMMON
@@ -28,5 +28,6 @@
#include "esp_modbus_master.h"
#include "esp_modbus_slave.h"
#endif