mirror of
https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git
synced 2024-09-01 08:09:25 +08:00
1、【完善】部分注释内容。
Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
parent
659a82f327
commit
226dd1892a
@ -16,7 +16,7 @@
|
|||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* 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 --------------------------------*/
|
/* ----------------------- System includes --------------------------------*/
|
||||||
|
@ -260,8 +260,8 @@ eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT us
|
|||||||
if ((usAddress >= DISCRETE_INPUT_START)
|
if ((usAddress >= DISCRETE_INPUT_START)
|
||||||
&& (usAddress + usNDiscrete <= DISCRETE_INPUT_START + DISCRETE_INPUT_NDISCRETES))
|
&& (usAddress + usNDiscrete <= DISCRETE_INPUT_START + DISCRETE_INPUT_NDISCRETES))
|
||||||
{
|
{
|
||||||
iRegIndex = (USHORT) (usAddress - usDiscreteInputStart) / 8; //ÿ<><C3BF><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>8<EFBFBD><38>
|
iRegIndex = (USHORT) (usAddress - usDiscreteInputStart) / 8;
|
||||||
iRegBitIndex = (USHORT) (usAddress - usDiscreteInputStart) % 8; //<2F><><EFBFBD><EFBFBD><EFBFBD>ڼĴ<DABC><C4B4><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>λ<EFBFBD><CEBB>ַ
|
iRegBitIndex = (USHORT) (usAddress - usDiscreteInputStart) % 8;
|
||||||
|
|
||||||
while (iNReg > 0)
|
while (iNReg > 0)
|
||||||
{
|
{
|
||||||
|
@ -124,8 +124,11 @@ Modbus一共有4种不同的数据类型,所有的Modbus功能都围绕这些
|
|||||||
|vMBMasterPortTimersRespondTimeoutEnable |设置定时器按照响应超时时间开始计数|
|
|vMBMasterPortTimersRespondTimeoutEnable |设置定时器按照响应超时时间开始计数|
|
||||||
|vMBMasterPortTimersDisable |失能定时器,定时器将停止计数|
|
|vMBMasterPortTimersDisable |失能定时器,定时器将停止计数|
|
||||||
|prvvTIMERExpiredISR |定时器中断服务程序接口,按照默认方式,直接引用`pxMBMasterPortCBTimerExpired`方法即可|
|
|prvvTIMERExpiredISR |定时器中断服务程序接口,按照默认方式,直接引用`pxMBMasterPortCBTimerExpired`方法即可|
|
||||||
|
|
||||||
> 注:
|
> 注:
|
||||||
|
|
||||||
1、`usPrescalerValue`及`usT35TimeOut50us`在文件顶部有定义
|
1、`usPrescalerValue`及`usT35TimeOut50us`在文件顶部有定义
|
||||||
|
|
||||||
2、转换延时时间及响应超时时间在`FreeModbus\modbus\include\mbconfig.h`,用户可以根据自己系统的特点自行设置。
|
2、转换延时时间及响应超时时间在`FreeModbus\modbus\include\mbconfig.h`,用户可以根据自己系统的特点自行设置。
|
||||||
|
|
||||||
除上面接口方法外,用户需要在文件末尾增加CPU的自带的定时器中断服务程序,将上表中的定时器中断服务程序接口放进去。
|
除上面接口方法外,用户需要在文件末尾增加CPU的自带的定时器中断服务程序,将上表中的定时器中断服务程序接口放进去。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user