Skip to content

Commit

Permalink
1、【完善】部分注释内容。
Browse files Browse the repository at this point in the history
Signed-off-by: armink <[email protected]>
  • Loading branch information
armink committed Feb 7, 2015
1 parent 659a82f commit 226dd18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion FreeModbus/port/rtt/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 --------------------------------*/
Expand Down
4 changes: 2 additions & 2 deletions FreeModbus/port/user_mb_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ Modbus一共有4种不同的数据类型,所有的Modbus功能都围绕这些
|vMBMasterPortTimersRespondTimeoutEnable |设置定时器按照响应超时时间开始计数|
|vMBMasterPortTimersDisable |失能定时器,定时器将停止计数|
|prvvTIMERExpiredISR |定时器中断服务程序接口,按照默认方式,直接引用`pxMBMasterPortCBTimerExpired`方法即可|

> 注:
1、`usPrescalerValue``usT35TimeOut50us`在文件顶部有定义

2、转换延时时间及响应超时时间在`FreeModbus\modbus\include\mbconfig.h`,用户可以根据自己系统的特点自行设置。

除上面接口方法外,用户需要在文件末尾增加CPU的自带的定时器中断服务程序,将上表中的定时器中断服务程序接口放进去。
Expand Down

0 comments on commit 226dd18

Please sign in to comment.