1、【完善】部分注释内容。

Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
armink 2015-02-07 13:15:05 +08:00
parent 659a82f327
commit 226dd1892a
3 changed files with 6 additions and 3 deletions

View File

@ -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 --------------------------------*/

View File

@ -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)
{

View File

@ -124,8 +124,11 @@ Modbus一共有4种不同的数据类型所有的Modbus功能都围绕这些
|vMBMasterPortTimersRespondTimeoutEnable |设置定时器按照响应超时时间开始计数|
|vMBMasterPortTimersDisable |失能定时器,定时器将停止计数|
|prvvTIMERExpiredISR |定时器中断服务程序接口,按照默认方式,直接引用`pxMBMasterPortCBTimerExpired`方法即可|
> 注:
1、`usPrescalerValue`及`usT35TimeOut50us`在文件顶部有定义
2、转换延时时间及响应超时时间在`FreeModbus\modbus\include\mbconfig.h`,用户可以根据自己系统的特点自行设置。
除上面接口方法外用户需要在文件末尾增加CPU的自带的定时器中断服务程序将上表中的定时器中断服务程序接口放进去。