From 226dd1892a95e7edbccfd6a13458d6d813385642 Mon Sep 17 00:00:00 2001 From: armink Date: Sat, 7 Feb 2015 13:15:05 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E5=AE=8C=E5=96=84=E3=80=91?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=B3=A8=E9=87=8A=E5=86=85=E5=AE=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- FreeModbus/port/rtt/port.c | 2 +- FreeModbus/port/user_mb_app.c | 4 ++-- README.md | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/FreeModbus/port/rtt/port.c b/FreeModbus/port/rtt/port.c index f74e4f3..d01c5c9 100644 --- a/FreeModbus/port/rtt/port.c +++ b/FreeModbus/port/rtt/port.c @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * File: $Id: portevent.c,v 1.60 2015/02/01 9:18:05 Armink $ + * File: $Id: port.c,v 1.60 2015/02/01 9:18:05 Armink $ */ /* ----------------------- System includes --------------------------------*/ diff --git a/FreeModbus/port/user_mb_app.c b/FreeModbus/port/user_mb_app.c index e6fdede..8da7376 100644 --- a/FreeModbus/port/user_mb_app.c +++ b/FreeModbus/port/user_mb_app.c @@ -260,8 +260,8 @@ eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT us if ((usAddress >= DISCRETE_INPUT_START) && (usAddress + usNDiscrete <= DISCRETE_INPUT_START + DISCRETE_INPUT_NDISCRETES)) { - iRegIndex = (USHORT) (usAddress - usDiscreteInputStart) / 8; //每个寄存器存8个 - iRegBitIndex = (USHORT) (usAddress - usDiscreteInputStart) % 8; //相对于寄存器内部的位地址 + iRegIndex = (USHORT) (usAddress - usDiscreteInputStart) / 8; + iRegBitIndex = (USHORT) (usAddress - usDiscreteInputStart) % 8; while (iNReg > 0) { diff --git a/README.md b/README.md index a1b8589..21b3ba2 100644 --- a/README.md +++ b/README.md @@ -124,8 +124,11 @@ Modbus涓鍏辨湁4绉嶄笉鍚岀殑鏁版嵁绫诲瀷锛屾墍鏈夌殑Modbus鍔熻兘閮藉洿缁曡繖浜 |vMBMasterPortTimersRespondTimeoutEnable |璁剧疆瀹氭椂鍣ㄦ寜鐓у搷搴旇秴鏃舵椂闂村紑濮嬭鏁皘 |vMBMasterPortTimersDisable |澶辫兘瀹氭椂鍣紝瀹氭椂鍣ㄥ皢鍋滄璁℃暟| |prvvTIMERExpiredISR |瀹氭椂鍣ㄤ腑鏂湇鍔$▼搴忔帴鍙o紝鎸夌収榛樿鏂瑰紡锛岀洿鎺ュ紩鐢╜pxMBMasterPortCBTimerExpired`鏂规硶鍗冲彲| + > 娉細 + 1銆乣usPrescalerValue`鍙奰usT35TimeOut50us`鍦ㄦ枃浠堕《閮ㄦ湁瀹氫箟 + 2銆佽浆鎹㈠欢鏃舵椂闂村強鍝嶅簲瓒呮椂鏃堕棿鍦╜FreeModbus\modbus\include\mbconfig.h`锛岀敤鎴峰彲浠ユ牴鎹嚜宸辩郴缁熺殑鐗圭偣鑷璁剧疆銆 闄や笂闈㈡帴鍙f柟娉曞锛岀敤鎴烽渶瑕佸湪鏂囦欢鏈熬澧炲姞CPU鐨勮嚜甯︾殑瀹氭椂鍣ㄤ腑鏂湇鍔$▼搴忥紝灏嗕笂琛ㄤ腑鐨勫畾鏃跺櫒涓柇鏈嶅姟绋嬪簭鎺ュ彛鏀捐繘鍘汇