Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Hobbyking_Cheetah_Compact Hobbyking_Cheetah_Compact_DRV8323_14bit Hobbyking_Cheetah_Compact_DRV8323_V51_201907 HKC_MiniCheetah ... more
Fork of mbed-dev by
Diff: targets/TARGET_STM/TARGET_STM32F1/serial_api.c
- Revision:
- 165:e614a9f1c9e2
- Parent:
- 149:156823d33999
--- a/targets/TARGET_STM/TARGET_STM32F1/serial_api.c Wed May 10 12:06:41 2017 +0100
+++ b/targets/TARGET_STM/TARGET_STM32F1/serial_api.c Fri May 26 12:39:01 2017 +0100
@@ -158,19 +158,19 @@
// Reset UART and disable clock
if (obj_s->uart == UART_1) {
- __USART1_FORCE_RESET();
- __USART1_RELEASE_RESET();
- __USART1_CLK_DISABLE();
+ __HAL_RCC_USART1_FORCE_RESET();
+ __HAL_RCC_USART1_RELEASE_RESET();
+ __HAL_RCC_USART1_CLK_DISABLE();
}
if (obj_s->uart == UART_2) {
- __USART2_FORCE_RESET();
- __USART2_RELEASE_RESET();
- __USART2_CLK_DISABLE();
+ __HAL_RCC_USART2_FORCE_RESET();
+ __HAL_RCC_USART2_RELEASE_RESET();
+ __HAL_RCC_USART2_CLK_DISABLE();
}
if (obj_s->uart == UART_3) {
- __USART3_FORCE_RESET();
- __USART3_RELEASE_RESET();
- __USART3_CLK_DISABLE();
+ __HAL_RCC_USART3_FORCE_RESET();
+ __HAL_RCC_USART3_RELEASE_RESET();
+ __HAL_RCC_USART3_CLK_DISABLE();
}
// Configure GPIOs
@@ -750,10 +750,10 @@
// reset states
huart->TxXferCount = 0;
// update handle state
- if(huart->State == HAL_UART_STATE_BUSY_TX_RX) {
- huart->State = HAL_UART_STATE_BUSY_RX;
+ if(huart->gState == HAL_UART_STATE_BUSY_TX_RX) {
+ huart->gState = HAL_UART_STATE_BUSY_RX;
} else {
- huart->State = HAL_UART_STATE_READY;
+ huart->gState = HAL_UART_STATE_READY;
}
}
@@ -780,10 +780,10 @@
// reset states
huart->RxXferCount = 0;
// update handle state
- if(huart->State == HAL_UART_STATE_BUSY_TX_RX) {
- huart->State = HAL_UART_STATE_BUSY_TX;
+ if(huart->RxState == HAL_UART_STATE_BUSY_TX_RX) {
+ huart->RxState = HAL_UART_STATE_BUSY_TX;
} else {
- huart->State = HAL_UART_STATE_READY;
+ huart->RxState = HAL_UART_STATE_READY;
}
}
