From 24432b4feeb1fa7bf35df16f3530e101797b6883 Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 16 Oct 2013 18:16:06 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E4=B8=AD=E5=87=A0=E5=A4=84=E6=96=AD=E8=A8=80?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=9A=E8=BF=87=E7=9A=84=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- BSP/inc/bsp.h | 2 +- FreeModbus/modbus/rtu/mbrtu_m.c | 6 +++--- FreeModbus/port/portserial.c | 1 - FreeModbus/port/portserial_m.c | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/BSP/inc/bsp.h b/BSP/inc/bsp.h index f2b4de0..2d57885 100644 --- a/BSP/inc/bsp.h +++ b/BSP/inc/bsp.h @@ -43,7 +43,7 @@ // Internal SRAM memory size[Kbytes] <8-64> // Default: 64 -#define STM32_SRAM_SIZE 64 +#define STM32_SRAM_SIZE 20 #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) diff --git a/FreeModbus/modbus/rtu/mbrtu_m.c b/FreeModbus/modbus/rtu/mbrtu_m.c index 1629f39..0460b37 100644 --- a/FreeModbus/modbus/rtu/mbrtu_m.c +++ b/FreeModbus/modbus/rtu/mbrtu_m.c @@ -160,7 +160,7 @@ eMBMasterRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLengt eMBErrorCode eStatus = MB_ENOERR; ENTER_CRITICAL_SECTION( ); - assert_param( usRcvBufferPos < MB_SER_PDU_SIZE_MAX ); + assert_param( usMasterRcvBufferPos < MB_SER_PDU_SIZE_MAX ); /* Length and CRC check */ if( ( usMasterRcvBufferPos >= MB_SER_PDU_SIZE_MIN ) @@ -235,7 +235,7 @@ xMBMasterRTUReceiveFSM( void ) BOOL xTaskNeedSwitch = FALSE; UCHAR ucByte; - assert_param( eSndState == STATE_TX_IDLE ); + assert_param( eSndState == STATE_M_TX_IDLE ); /* Always read the character. */ ( void )xMBMasterPortSerialGetByte( ( CHAR * ) & ucByte ); @@ -301,7 +301,7 @@ xMBMasterRTUTransmitFSM( void ) { BOOL xNeedPoll = FALSE; - assert_param( eRcvState == STATE_RX_IDLE ); + assert_param( eRcvState == STATE_M_RX_IDLE ); switch ( eSndState ) { diff --git a/FreeModbus/port/portserial.c b/FreeModbus/port/portserial.c index 1e9cfa1..32067c4 100644 --- a/FreeModbus/port/portserial.c +++ b/FreeModbus/port/portserial.c @@ -183,7 +183,6 @@ void USART1_IRQHandler(void) //·¢ËÍÖÐ¶Ï if (USART_GetITStatus(USART1, USART_IT_TXE) == SET) { - USART_ClearITPendingBit(USART1, USART_IT_TXE); prvvUARTTxReadyISR(); } rt_interrupt_leave(); diff --git a/FreeModbus/port/portserial_m.c b/FreeModbus/port/portserial_m.c index ddbb70a..fa062b7 100644 --- a/FreeModbus/port/portserial_m.c +++ b/FreeModbus/port/portserial_m.c @@ -184,7 +184,6 @@ void USART2_IRQHandler(void) //·¢ËÍÖÐ¶Ï if (USART_GetITStatus(USART2, USART_IT_TXE) == SET) { - USART_ClearITPendingBit(USART2, USART_IT_TXE); prvvUARTTxReadyISR(); } rt_interrupt_leave();