diff --git a/iap/iap.c b/iap/iap.c index 2dea004..3d296f1 100644 --- a/iap/iap.c +++ b/iap/iap.c @@ -407,6 +407,10 @@ static int _iap_entry(rt_bool_t is_boot) ports[i] = rt_device_find(name); RT_ASSERT(ports[i]); + struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; + config.baud_rate = BAUD_RATE_460800; + rt_device_control(ports[i], RT_DEVICE_CTRL_CONFIG, &config); + rt_device_set_rx_indicate(ports[i], port_rx_ind); rt_device_open(ports[i], RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX); } @@ -418,6 +422,11 @@ static int _iap_entry(rt_bool_t is_boot) odev_rx_ind = ports[0]->rx_indicate; rt_device_set_rx_indicate(ports[0], port_rx_ind); + + struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; + config.baud_rate = BAUD_RATE_460800; + rt_device_control(ports[0], RT_DEVICE_CTRL_CONFIG, &config); + rt_device_open(ports[0], RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX); } diff --git a/libraries/HAL_Drivers/drv_common.c b/libraries/HAL_Drivers/drv_common.c index 2f08260..d37381a 100644 --- a/libraries/HAL_Drivers/drv_common.c +++ b/libraries/HAL_Drivers/drv_common.c @@ -197,6 +197,12 @@ void rt_hw_board_init(void) rt_hw_usart_init(); #endif + struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; + config.baud_rate = BAUD_RATE_460800; + rt_device_t dev = rt_device_find(RT_CONSOLE_DEVICE_NAME); + RT_ASSERT(dev); + rt_device_control(dev, RT_DEVICE_CTRL_CONFIG, &config); + /* Set the shell console output device */ #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) rt_console_set_device(RT_CONSOLE_DEVICE_NAME); diff --git a/project.uvoptx b/project.uvoptx index 4a21d4c..95ce837 100644 --- a/project.uvoptx +++ b/project.uvoptx @@ -604,7 +604,7 @@ Drivers - 1 + 0 0 0 0 @@ -856,7 +856,7 @@ IAP - 0 + 1 0 0 0