mirror of
https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git
synced 2025-01-19 19:21:19 +08:00
1、【修改】Slaver字段为Slave,统一从机英文名称
Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
parent
ff438e63fc
commit
31fab3ed4d
@ -33,7 +33,7 @@
|
||||
<option id="iar.arm.toolchain.option.lowLevelInterfaceCortex.v5.4.0.469960283" name="Library low-level interface implementation (Cortex-M cores):" superClass="iar.arm.toolchain.option.lowLevelInterfaceCortex.v5.4.0"/>
|
||||
<option id="iar.arm.toolchain.option.useDSPLibrary.v6.2.2.745067602" name="DSP Library" superClass="iar.arm.toolchain.option.useDSPLibrary.v6.2.2"/>
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="iar.arm.toolchain.targetPlatform.v5.4.0.555588680" isAbstract="false" name="IAR Target platform for ARM (ELF)" osList="win32,linux" superClass="iar.arm.toolchain.targetPlatform.v5.4.0"/>
|
||||
<builder buildPath="${workspace_loc:/FreeModbus_Slaver&Master+RTT+STM32/Debug}" id="iar.arm.toolchain.builder.2.2025863817" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="iar.arm.toolchain.builder.2"/>
|
||||
<builder buildPath="${workspace_loc:/FreeModbus_Slave&Master+RTT+STM32/Debug}" id="iar.arm.toolchain.builder.2.2025863817" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="iar.arm.toolchain.builder.2"/>
|
||||
<tool id="iar.arm.toolchain.compiler.v5.4.1.137030134" name="IAR C/C++ Compiler for ARM" superClass="iar.arm.toolchain.compiler.v5.4.1">
|
||||
<option defaultValue="true" id="iar.arm.toolchain.compiler.option.debugInfo.v5.4.0.2005964005" name="Generate debug information" superClass="iar.arm.toolchain.compiler.option.debugInfo.v5.4.0" valueType="boolean"/>
|
||||
<option defaultValue="iar.arm.toolchain.compiler.option.optLevel.none.v5.4.0" id="iar.arm.toolchain.compiler.option.optLevel.v5.4.0.138043467" name="Optimization level:" superClass="iar.arm.toolchain.compiler.option.optLevel.v5.4.0" value="iar.arm.toolchain.compiler.option.optLevel.low.v5.4.0" valueType="enumerated"/>
|
||||
@ -141,7 +141,7 @@
|
||||
<option id="iar.arm.toolchain.option.lowLevelInterfaceCortex.v5.4.0.298557260" name="Library low-level interface implementation (Cortex-M cores):" superClass="iar.arm.toolchain.option.lowLevelInterfaceCortex.v5.4.0"/>
|
||||
<option id="iar.arm.toolchain.option.useCMSIS.v6.2.2.1008613098" name="Use CMSIS" superClass="iar.arm.toolchain.option.useCMSIS.v6.2.2"/>
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="iar.arm.toolchain.targetPlatform.v5.4.0.227679239" isAbstract="false" name="IAR Target platform for ARM (ELF)" osList="win32,linux" superClass="iar.arm.toolchain.targetPlatform.v5.4.0"/>
|
||||
<builder buildPath="${workspace_loc:/FreeModbus_Slaver&Master+RTT+STM32/Release}" id="iar.arm.toolchain.builder.2.1632539169" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="iar.arm.toolchain.builder.2"/>
|
||||
<builder buildPath="${workspace_loc:/FreeModbus_Slave&Master+RTT+STM32/Release}" id="iar.arm.toolchain.builder.2.1632539169" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="iar.arm.toolchain.builder.2"/>
|
||||
<tool id="iar.arm.toolchain.compiler.v5.4.1.872171530" name="IAR C/C++ Compiler for ARM" superClass="iar.arm.toolchain.compiler.v5.4.1">
|
||||
<option defaultValue="false" id="iar.arm.toolchain.compiler.option.debugInfo.v5.4.0.533414914" name="Generate debug information" superClass="iar.arm.toolchain.compiler.option.debugInfo.v5.4.0" valueType="boolean"/>
|
||||
<option defaultValue="iar.arm.toolchain.compiler.option.optLevel.highBalance.v5.4.0" id="iar.arm.toolchain.compiler.option.optLevel.v5.4.0.173127463" name="Optimization level:" superClass="iar.arm.toolchain.compiler.option.optLevel.v5.4.0" valueType="enumerated"/>
|
||||
@ -179,7 +179,7 @@
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="FreeModbus_Slaver&Master+RTT+STM32.iar.arm.toolchain.project.exe.v5.4.0.215810011" name="Executable (IAR)" projectType="iar.arm.toolchain.project.exe.v5.4.0"/>
|
||||
<project id="FreeModbus_Slave&Master+RTT+STM32.iar.arm.toolchain.project.exe.v5.4.0.215810011" name="Executable (IAR)" projectType="iar.arm.toolchain.project.exe.v5.4.0"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
@ -188,7 +188,7 @@
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="1">
|
||||
<resource resourceType="PROJECT" workspacePath="/FreeModbus_Slaver&Master+RTT+STM32"/>
|
||||
<resource resourceType="PROJECT" workspacePath="/FreeModbus_Slave&Master+RTT+STM32"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
|
2
.project
2
.project
@ -27,7 +27,7 @@
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildLocation</key>
|
||||
<value>${workspace_loc:/FreeModbus_Slaver&Master+RTT+STM32/Debug}</value>
|
||||
<value>${workspace_loc:/FreeModbus_Slave&Master+RTT+STM32/Debug}</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.contents</key>
|
||||
|
@ -12,14 +12,14 @@ uint8_t CpuUsageMajor, CpuUsageMinor; //CPUʹ
|
||||
|
||||
//====================操作系统各线程优先级==================================
|
||||
#define thread_SysMonitor_Prio 11
|
||||
#define thread_ModbusSlaverPoll_Prio 10
|
||||
#define thread_ModbusSlavePoll_Prio 10
|
||||
ALIGN(RT_ALIGN_SIZE)
|
||||
//====================操作系统各线程堆栈====================================
|
||||
static rt_uint8_t thread_SysMonitor_stack[256];
|
||||
static rt_uint8_t thread_ModbusSlaverPoll_stack[512];
|
||||
static rt_uint8_t thread_ModbusSlavePoll_stack[512];
|
||||
|
||||
struct rt_thread thread_SysMonitor;
|
||||
struct rt_thread thread_ModbusSlaverPoll;
|
||||
struct rt_thread thread_ModbusSlavePoll;
|
||||
|
||||
//***************************系统监控线程***************************
|
||||
//函数定义: void thread_entry_SysRunLed(void* parameter)
|
||||
@ -45,12 +45,12 @@ void thread_entry_SysMonitor(void* parameter)
|
||||
}
|
||||
|
||||
//*************************** Modbus从机线程***************************
|
||||
//º¯Êý¶¨Òå: void thread_entry_ModbusSlaverPoll(void* parameter)
|
||||
//º¯Êý¶¨Òå: void thread_entry_ModbusSlavePoll(void* parameter)
|
||||
//入口参数:无
|
||||
//出口参数:无
|
||||
//备 注:Editor:Armink 2013-08-02 Company: BXXJS
|
||||
//******************************************************************
|
||||
void thread_entry_ModbusSlaverPoll(void* parameter)
|
||||
void thread_entry_ModbusSlavePoll(void* parameter)
|
||||
{
|
||||
eMBInit(MB_RTU, 0x01, 1, 115200, MB_PAR_EVEN);
|
||||
eMBEnable();
|
||||
@ -74,12 +74,12 @@ int rt_application_init(void)
|
||||
thread_SysMonitor_Prio, 5);
|
||||
rt_thread_startup(&thread_SysMonitor);
|
||||
|
||||
rt_thread_init(&thread_ModbusSlaverPoll, "MBSlaverPoll",
|
||||
thread_entry_ModbusSlaverPoll, RT_NULL,
|
||||
thread_ModbusSlaverPoll_stack,
|
||||
sizeof(thread_ModbusSlaverPoll_stack), thread_ModbusSlaverPoll_Prio,
|
||||
rt_thread_init(&thread_ModbusSlavePoll, "MBSlavePoll",
|
||||
thread_entry_ModbusSlavePoll, RT_NULL,
|
||||
thread_ModbusSlavePoll_stack,
|
||||
sizeof(thread_ModbusSlavePoll_stack), thread_ModbusSlavePoll_Prio,
|
||||
5);
|
||||
rt_thread_startup(&thread_ModbusSlaverPoll);
|
||||
rt_thread_startup(&thread_ModbusSlavePoll);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -53,11 +53,11 @@ PR_BEGIN_EXTERN_C
|
||||
#define MB_MASTER_RTU_ENABLED ( 1 )
|
||||
/*! \brief If Modbus Master TCP support is enabled. */
|
||||
#define MB_MASTER_TCP_ENABLED ( 0 )
|
||||
/*! \brief If Modbus Slaver ASCII support is enabled. */
|
||||
/*! \brief If Modbus Slave ASCII support is enabled. */
|
||||
#define MB_SLAVE_ASCII_ENABLED ( 0 )
|
||||
/*! \brief If Modbus Slaver RTU support is enabled. */
|
||||
/*! \brief If Modbus Slave RTU support is enabled. */
|
||||
#define MB_SLAVE_RTU_ENABLED ( 1 )
|
||||
/*! \brief If Modbus Slaver TCP support is enabled. */
|
||||
/*! \brief If Modbus Slave TCP support is enabled. */
|
||||
#define MB_SLAVE_TCP_ENABLED ( 0 )
|
||||
/*! \brief The character timeout value for Modbus ASCII.
|
||||
*
|
||||
|
@ -72,7 +72,7 @@ static enum
|
||||
|
||||
/* Functions pointer which are initialized in eMBInit( ). Depending on the
|
||||
* mode (RTU or ASCII) the are set to the correct implementations.
|
||||
* Using for Modbus Slaver
|
||||
* Using for Modbus Slave
|
||||
*/
|
||||
static peMBFrameSend peMBFrameSendCur;
|
||||
static pvMBFrameStart pvMBFrameStartCur;
|
||||
@ -93,7 +93,7 @@ static pvMBFrameClose pvMBMasterFrameCloseCur;
|
||||
/* Callback functions required by the porting layer. They are called when
|
||||
* an external event has happend which includes a timeout or the reception
|
||||
* or transmission of a character.
|
||||
* Using for Modbus Slaver
|
||||
* Using for Modbus Slave
|
||||
*/
|
||||
BOOL( *pxMBFrameCBByteReceived ) ( void );
|
||||
BOOL( *pxMBFrameCBTransmitterEmpty ) ( void );
|
||||
|
2
LICENSE
2
LICENSE
@ -290,7 +290,7 @@ to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
FreeModbus_Slaver&Master+RT-Thread1.1.1+STM32F103
|
||||
FreeModbus_Slave&Master+RT-Thread1.1.1+STM32F103
|
||||
Copyright (C) 2013 armink
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,4 +1,4 @@
|
||||
FreeModbus_Slaver&Master + RT-Thread1.1.1 + STM32F103
|
||||
FreeModbus_Slave&Master + RT-Thread1.1.1 + STM32F103
|
||||
----------
|
||||
# 一、 背景描述 #
|
||||
目前操作系统在嵌入式软件行业非常流行,在工控组网方面,可能以后会经常会用到Modbus主机+操作系统、Modbus从机+操作系统甚至Modbus主机+Modbus从机+操作系统。但是操作系统缺乏对Modbus的支持;同时市面上也有很好的开源Modbus协议栈,例如FreeModbus,但是缺点就是该协议栈只支持从机,网上缺乏它和操作系统结合的案例。
|
||||
|
Loading…
x
Reference in New Issue
Block a user