瀏覽代碼

Update portserial_m.c

add macro to aviod compile error with:
rt_pin_mode(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_MODE_OUTPUT);
shauew 6 年之前
父節點
當前提交
eea0b9ebf2
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      components/net/freemodbus/port/portserial_m.c

+ 2 - 0
components/net/freemodbus/port/portserial_m.c

@@ -57,7 +57,9 @@ BOOL xMBMasterPortSerialInit(UCHAR ucPORT, ULONG ulBaudRate, UCHAR ucDataBits,
      * set 485 mode receive and transmit control IO
      * @note MODBUS_MASTER_RT_CONTROL_PIN_INDEX need be defined by user
      */
+#if defined(RT_MODBUS_MASTER_USE_CONTROL_PIN)
     rt_pin_mode(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_MODE_OUTPUT);
+#endif
 
     /* set serial name */
     if (ucPORT == 1) {