уменьшил размер максимального сообщения модбас до 27 элементов и вроде помещается... но надо проверить с структурой данных модбас под эти датчики
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
#define Addr_SIZE 2 ///< size of (Addr)
|
#define Addr_SIZE 2 ///< size of (Addr)
|
||||||
#define Qnt_SIZE 2 ///< size of (Qnt)
|
#define Qnt_SIZE 2 ///< size of (Qnt)
|
||||||
#define ByteCnt_SIZE 1 ///< size of (ByteCnt)
|
#define ByteCnt_SIZE 1 ///< size of (ByteCnt)
|
||||||
#define DATA_SIZE 125 ///< maximum number of data: DWORD (NOT MESSAGE SIZE)
|
#define DATA_SIZE 27 ///< maximum number of data: DWORD (NOT MESSAGE SIZE)
|
||||||
#define CRC_SIZE 2 ///< size of (MB_CRC) in bytes
|
#define CRC_SIZE 2 ///< size of (MB_CRC) in bytes
|
||||||
|
|
||||||
/** @brief Size of whole message */
|
/** @brief Size of whole message */
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ int main(void)
|
|||||||
HAL_TIM_Base_Start(&htim1);
|
HAL_TIM_Base_Start(&htim1);
|
||||||
MX_USART1_UART_Init();
|
MX_USART1_UART_Init();
|
||||||
|
|
||||||
// MODBUS_FirstInit();
|
MODBUS_FirstInit();
|
||||||
// RS_Receive_IT(&hmodbus1, &MODBUS_MSG);
|
RS_Receive_IT(&hmodbus1, &MODBUS_MSG);
|
||||||
|
|
||||||
|
|
||||||
PCHSens_FirstInit();
|
// PCHSens_FirstInit();
|
||||||
/* infinite loop */
|
/* infinite loop */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,23 +75,23 @@ void SysTick_Handler(void)
|
|||||||
HAL_IncTick();
|
HAL_IncTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
//#include "rs_message.h"
|
#include "rs_message.h"
|
||||||
///**
|
/**
|
||||||
// * @brief This function handles USART1.
|
* @brief This function handles USART1.
|
||||||
// */
|
*/
|
||||||
//void USART1_IRQHandler(void)
|
void USART1_IRQHandler(void)
|
||||||
//{
|
{
|
||||||
// RS_UART_Handler(&hmodbus1);
|
RS_UART_Handler(&hmodbus1);
|
||||||
//}
|
}
|
||||||
|
|
||||||
///**
|
/**
|
||||||
// * @brief This function handles TIM2 global interrupt.
|
* @brief This function handles TIM2 global interrupt.
|
||||||
// */
|
*/
|
||||||
//void TIM14_IRQHandler(void)
|
void TIM14_IRQHandler(void)
|
||||||
//{
|
{
|
||||||
// /* USER CODE BEGIN TIM2_IRQn 0 */
|
/* USER CODE BEGIN TIM2_IRQn 0 */
|
||||||
// RS_TIM_Handler(&hmodbus1);
|
RS_TIM_Handler(&hmodbus1);
|
||||||
//}
|
}
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* PY32F002B Peripheral Interrupt Handlers */
|
/* PY32F002B Peripheral Interrupt Handlers */
|
||||||
/* Add here the Interrupt Handlers for the used peripherals. */
|
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||||
|
|||||||
@@ -549,75 +549,6 @@
|
|||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>Modbus</GroupName>
|
<GroupName>Modbus</GroupName>
|
||||||
<GroupOption>
|
|
||||||
<CommonProperty>
|
|
||||||
<UseCPPCompiler>0</UseCPPCompiler>
|
|
||||||
<RVCTCodeConst>0</RVCTCodeConst>
|
|
||||||
<RVCTZI>0</RVCTZI>
|
|
||||||
<RVCTOtherData>0</RVCTOtherData>
|
|
||||||
<ModuleSelection>0</ModuleSelection>
|
|
||||||
<IncludeInBuild>0</IncludeInBuild>
|
|
||||||
<AlwaysBuild>2</AlwaysBuild>
|
|
||||||
<GenerateAssemblyFile>2</GenerateAssemblyFile>
|
|
||||||
<AssembleAssemblyFile>2</AssembleAssemblyFile>
|
|
||||||
<PublicsOnly>2</PublicsOnly>
|
|
||||||
<StopOnExitCode>11</StopOnExitCode>
|
|
||||||
<CustomArgument></CustomArgument>
|
|
||||||
<IncludeLibraryModules></IncludeLibraryModules>
|
|
||||||
<ComprImg>1</ComprImg>
|
|
||||||
</CommonProperty>
|
|
||||||
<GroupArmAds>
|
|
||||||
<Cads>
|
|
||||||
<interw>2</interw>
|
|
||||||
<Optim>0</Optim>
|
|
||||||
<oTime>2</oTime>
|
|
||||||
<SplitLS>2</SplitLS>
|
|
||||||
<OneElfS>2</OneElfS>
|
|
||||||
<Strict>2</Strict>
|
|
||||||
<EnumInt>2</EnumInt>
|
|
||||||
<PlainCh>2</PlainCh>
|
|
||||||
<Ropi>2</Ropi>
|
|
||||||
<Rwpi>2</Rwpi>
|
|
||||||
<wLevel>0</wLevel>
|
|
||||||
<uThumb>2</uThumb>
|
|
||||||
<uSurpInc>2</uSurpInc>
|
|
||||||
<uC99>2</uC99>
|
|
||||||
<uGnu>2</uGnu>
|
|
||||||
<useXO>2</useXO>
|
|
||||||
<v6Lang>0</v6Lang>
|
|
||||||
<v6LangP>0</v6LangP>
|
|
||||||
<vShortEn>2</vShortEn>
|
|
||||||
<vShortWch>2</vShortWch>
|
|
||||||
<v6Lto>2</v6Lto>
|
|
||||||
<v6WtE>2</v6WtE>
|
|
||||||
<v6Rtti>2</v6Rtti>
|
|
||||||
<VariousControls>
|
|
||||||
<MiscControls></MiscControls>
|
|
||||||
<Define></Define>
|
|
||||||
<Undefine></Undefine>
|
|
||||||
<IncludePath></IncludePath>
|
|
||||||
</VariousControls>
|
|
||||||
</Cads>
|
|
||||||
<Aads>
|
|
||||||
<interw>2</interw>
|
|
||||||
<Ropi>2</Ropi>
|
|
||||||
<Rwpi>2</Rwpi>
|
|
||||||
<thumb>2</thumb>
|
|
||||||
<SplitLS>2</SplitLS>
|
|
||||||
<SwStkChk>2</SwStkChk>
|
|
||||||
<NoWarn>2</NoWarn>
|
|
||||||
<uSurpInc>2</uSurpInc>
|
|
||||||
<useXO>2</useXO>
|
|
||||||
<ClangAsOpt>0</ClangAsOpt>
|
|
||||||
<VariousControls>
|
|
||||||
<MiscControls></MiscControls>
|
|
||||||
<Define></Define>
|
|
||||||
<Undefine></Undefine>
|
|
||||||
<IncludePath></IncludePath>
|
|
||||||
</VariousControls>
|
|
||||||
</Aads>
|
|
||||||
</GroupArmAds>
|
|
||||||
</GroupOption>
|
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
<File>
|
||||||
<FileName>crc_algs.c</FileName>
|
<FileName>crc_algs.c</FileName>
|
||||||
|
|||||||
Reference in New Issue
Block a user