From c3d21aec4337eae04f0434ecb09f2315be61a95f Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 17 Apr 2015 09:46:31 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91R?= =?UTF-8?q?TT=E7=9A=84GPIO=E8=AE=BE=E5=A4=87=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E3=80=82=E8=A7=A3=E5=86=B3=E4=BA=86FreeModbus=E4=B8=BB?= =?UTF-8?q?=E6=9C=BA=E4=B8=B2=E5=8F=A3=E4=B8=8ERTT=E7=9A=84GPIO=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- BSP/src/gpio.c | 2 +- BSP/src/usart.c | 2 +- FreeModbus/port/rtt/portserial_m.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BSP/src/gpio.c b/BSP/src/gpio.c index 8003c07..cf2d18e 100644 --- a/BSP/src/gpio.c +++ b/BSP/src/gpio.c @@ -30,7 +30,7 @@ struct pin_index static const struct pin_index pins[] = { { 0, RCC_APB2Periph_GPIOA, GPIOA, GPIO_Pin_1}, - { 1, RCC_APB2Periph_GPIOA, GPIOA, GPIO_Pin_2}, + { 1, RCC_APB2Periph_GPIOB, GPIOB, GPIO_Pin_1}, }; #define ITEM_NUM(items) sizeof(items)/sizeof(items[0]) diff --git a/BSP/src/usart.c b/BSP/src/usart.c index 7df2fc2..fa0c382 100644 --- a/BSP/src/usart.c +++ b/BSP/src/usart.c @@ -386,8 +386,8 @@ void stm32_hw_usart_init(void) #if defined(RT_USING_UART2) uart = &uart2; - config.baud_rate = BAUD_RATE_115200; + serial2.ops = &stm32_uart_ops; serial2.config = config; diff --git a/FreeModbus/port/rtt/portserial_m.c b/FreeModbus/port/rtt/portserial_m.c index 3db823f..93a4af7 100644 --- a/FreeModbus/port/rtt/portserial_m.c +++ b/FreeModbus/port/rtt/portserial_m.c @@ -36,7 +36,7 @@ static rt_uint8_t serial_soft_trans_irq_stack[512]; static struct rt_thread thread_serial_soft_trans_irq; /* serial event */ static struct rt_event event_serial; -/* modbus slave serial device */ +/* modbus master serial device */ static rt_serial_t *serial; /* ----------------------- Defines ------------------------------------------*/ @@ -109,14 +109,14 @@ BOOL xMBMasterPortSerialInit(UCHAR ucPORT, ULONG ulBaudRate, UCHAR ucDataBits, /* software initialize */ rt_thread_init(&thread_serial_soft_trans_irq, - "slave trans", + "master trans", serial_soft_trans_irq, RT_NULL, serial_soft_trans_irq_stack, sizeof(serial_soft_trans_irq_stack), 10, 5); rt_thread_startup(&thread_serial_soft_trans_irq); - rt_event_init(&event_serial, "slave event", RT_IPC_FLAG_PRIO); + rt_event_init(&event_serial, "master event", RT_IPC_FLAG_PRIO); return TRUE; }