fix interfaccia
This commit is contained in:
@@ -11,6 +11,17 @@
|
||||
* + Peripheral Control functions
|
||||
* + Peripheral State and Error functions
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
@verbatim
|
||||
===============================================================================
|
||||
##### How to use this driver #####
|
||||
@@ -62,8 +73,8 @@
|
||||
allows the user to configure dynamically the driver callbacks.
|
||||
|
||||
[..]
|
||||
Use Function @ref HAL_USART_RegisterCallback() to register a user callback.
|
||||
Function @ref HAL_USART_RegisterCallback() allows to register following callbacks:
|
||||
Use Function HAL_USART_RegisterCallback() to register a user callback.
|
||||
Function HAL_USART_RegisterCallback() allows to register following callbacks:
|
||||
(+) TxHalfCpltCallback : Tx Half Complete Callback.
|
||||
(+) TxCpltCallback : Tx Complete Callback.
|
||||
(+) RxHalfCpltCallback : Rx Half Complete Callback.
|
||||
@@ -79,9 +90,9 @@
|
||||
and a pointer to the user callback function.
|
||||
|
||||
[..]
|
||||
Use function @ref HAL_USART_UnRegisterCallback() to reset a callback to the default
|
||||
Use function HAL_USART_UnRegisterCallback() to reset a callback to the default
|
||||
weak (surcharged) function.
|
||||
@ref HAL_USART_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
||||
HAL_USART_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
||||
and the Callback ID.
|
||||
This function allows to reset following callbacks:
|
||||
(+) TxHalfCpltCallback : Tx Half Complete Callback.
|
||||
@@ -97,13 +108,13 @@
|
||||
(+) MspDeInitCallback : USART MspDeInit.
|
||||
|
||||
[..]
|
||||
By default, after the @ref HAL_USART_Init() and when the state is HAL_USART_STATE_RESET
|
||||
By default, after the HAL_USART_Init() and when the state is HAL_USART_STATE_RESET
|
||||
all callbacks are set to the corresponding weak (surcharged) functions:
|
||||
examples @ref HAL_USART_TxCpltCallback(), @ref HAL_USART_RxHalfCpltCallback().
|
||||
examples HAL_USART_TxCpltCallback(), HAL_USART_RxHalfCpltCallback().
|
||||
Exception done for MspInit and MspDeInit functions that are respectively
|
||||
reset to the legacy weak (surcharged) functions in the @ref HAL_USART_Init()
|
||||
and @ref HAL_USART_DeInit() only when these callbacks are null (not registered beforehand).
|
||||
If not, MspInit or MspDeInit are not null, the @ref HAL_USART_Init() and @ref HAL_USART_DeInit()
|
||||
reset to the legacy weak (surcharged) functions in the HAL_USART_Init()
|
||||
and HAL_USART_DeInit() only when these callbacks are null (not registered beforehand).
|
||||
If not, MspInit or MspDeInit are not null, the HAL_USART_Init() and HAL_USART_DeInit()
|
||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
||||
|
||||
[..]
|
||||
@@ -112,8 +123,8 @@
|
||||
in HAL_USART_STATE_READY or HAL_USART_STATE_RESET state, thus registered (user)
|
||||
MspInit/DeInit callbacks can be used during the Init/DeInit.
|
||||
In that case first register the MspInit/MspDeInit user callbacks
|
||||
using @ref HAL_USART_RegisterCallback() before calling @ref HAL_USART_DeInit()
|
||||
or @ref HAL_USART_Init() function.
|
||||
using HAL_USART_RegisterCallback() before calling HAL_USART_DeInit()
|
||||
or HAL_USART_Init() function.
|
||||
|
||||
[..]
|
||||
When The compilation define USE_HAL_USART_REGISTER_CALLBACKS is set to 0 or
|
||||
@@ -123,17 +134,6 @@
|
||||
|
||||
@endverbatim
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
@@ -748,10 +748,10 @@ HAL_StatusTypeDef HAL_USART_UnRegisterCallback(USART_HandleTypeDef *husart, HAL_
|
||||
* @param Timeout Timeout duration.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size, uint32_t Timeout)
|
||||
HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size, uint32_t Timeout)
|
||||
{
|
||||
uint8_t *ptxdata8bits;
|
||||
uint16_t *ptxdata16bits;
|
||||
const uint8_t *ptxdata8bits;
|
||||
const uint16_t *ptxdata16bits;
|
||||
uint32_t tickstart;
|
||||
|
||||
if (husart->State == HAL_USART_STATE_READY)
|
||||
@@ -777,7 +777,7 @@ HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, uint8_t *pTxDa
|
||||
if ((husart->Init.WordLength == USART_WORDLENGTH_9B) && (husart->Init.Parity == USART_PARITY_NONE))
|
||||
{
|
||||
ptxdata8bits = NULL;
|
||||
ptxdata16bits = (uint16_t *) pTxData;
|
||||
ptxdata16bits = (const uint16_t *) pTxData;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -957,13 +957,13 @@ HAL_StatusTypeDef HAL_USART_Receive(USART_HandleTypeDef *husart, uint8_t *pRxDat
|
||||
* @param Timeout Timeout duration.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData,
|
||||
HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData,
|
||||
uint16_t Size, uint32_t Timeout)
|
||||
{
|
||||
uint8_t *prxdata8bits;
|
||||
uint16_t *prxdata16bits;
|
||||
uint8_t *ptxdata8bits;
|
||||
uint16_t *ptxdata16bits;
|
||||
const uint8_t *ptxdata8bits;
|
||||
const uint16_t *ptxdata16bits;
|
||||
uint16_t uhMask;
|
||||
uint16_t rxdatacount;
|
||||
uint32_t tickstart;
|
||||
@@ -998,7 +998,7 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, uint8_t
|
||||
{
|
||||
prxdata8bits = NULL;
|
||||
ptxdata8bits = NULL;
|
||||
ptxdata16bits = (uint16_t *) pTxData;
|
||||
ptxdata16bits = (const uint16_t *) pTxData;
|
||||
prxdata16bits = (uint16_t *) pRxData;
|
||||
}
|
||||
else
|
||||
@@ -1104,7 +1104,7 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, uint8_t
|
||||
* @param Size amount of data elements (u8 or u16) to be sent.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size)
|
||||
HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size)
|
||||
{
|
||||
if (husart->State == HAL_USART_STATE_READY)
|
||||
{
|
||||
@@ -1231,7 +1231,10 @@ HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRx
|
||||
__HAL_UNLOCK(husart);
|
||||
|
||||
/* Enable the USART Parity Error interrupt and RX FIFO Threshold interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
if (husart->Init.Parity != USART_PARITY_NONE)
|
||||
{
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
}
|
||||
SET_BIT(husart->Instance->CR3, USART_CR3_RXFTIE);
|
||||
}
|
||||
else
|
||||
@@ -1250,7 +1253,14 @@ HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRx
|
||||
__HAL_UNLOCK(husart);
|
||||
|
||||
/* Enable the USART Parity Error and Data Register not empty Interrupts */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE | USART_CR1_RXNEIE_RXFNEIE);
|
||||
if (husart->Init.Parity != USART_PARITY_NONE)
|
||||
{
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE | USART_CR1_RXNEIE_RXFNEIE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_RXNEIE_RXFNEIE);
|
||||
}
|
||||
}
|
||||
|
||||
if (husart->SlaveMode == USART_SLAVEMODE_DISABLE)
|
||||
@@ -1291,7 +1301,7 @@ HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRx
|
||||
* @param Size amount of data elements (u8 or u16) to be sent (same amount to be received).
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData,
|
||||
HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData,
|
||||
uint16_t Size)
|
||||
{
|
||||
|
||||
@@ -1339,8 +1349,11 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint
|
||||
/* Enable the USART Error Interrupt: (Frame error, noise error, overrun error) */
|
||||
SET_BIT(husart->Instance->CR3, USART_CR3_EIE);
|
||||
|
||||
/* Enable the USART Parity Error interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
if (husart->Init.Parity != USART_PARITY_NONE)
|
||||
{
|
||||
/* Enable the USART Parity Error interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
}
|
||||
|
||||
/* Enable the TX and RX FIFO Threshold interrupts */
|
||||
SET_BIT(husart->Instance->CR3, (USART_CR3_TXFTIE | USART_CR3_RXFTIE));
|
||||
@@ -1365,7 +1378,14 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint
|
||||
SET_BIT(husart->Instance->CR3, USART_CR3_EIE);
|
||||
|
||||
/* Enable the USART Parity Error and USART Data Register not empty Interrupts */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE | USART_CR1_RXNEIE_RXFNEIE);
|
||||
if (husart->Init.Parity != USART_PARITY_NONE)
|
||||
{
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE | USART_CR1_RXNEIE_RXFNEIE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_RXNEIE_RXFNEIE);
|
||||
}
|
||||
|
||||
/* Enable the USART Transmit Data Register Empty Interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_TXEIE_TXFNFIE);
|
||||
@@ -1389,10 +1409,10 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint
|
||||
* @param Size amount of data elements (u8 or u16) to be sent.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size)
|
||||
HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size)
|
||||
{
|
||||
HAL_StatusTypeDef status = HAL_OK;
|
||||
uint32_t *tmp;
|
||||
const uint32_t *tmp;
|
||||
|
||||
if (husart->State == HAL_USART_STATE_READY)
|
||||
{
|
||||
@@ -1423,8 +1443,8 @@ HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *p
|
||||
husart->hdmatx->XferErrorCallback = USART_DMAError;
|
||||
|
||||
/* Enable the USART transmit DMA channel */
|
||||
tmp = (uint32_t *)&pTxData;
|
||||
status = HAL_DMA_Start_IT(husart->hdmatx, *(uint32_t *)tmp, (uint32_t)&husart->Instance->TDR, Size);
|
||||
tmp = (const uint32_t *)&pTxData;
|
||||
status = HAL_DMA_Start_IT(husart->hdmatx, *(const uint32_t *)tmp, (uint32_t)&husart->Instance->TDR, Size);
|
||||
}
|
||||
|
||||
if (status == HAL_OK)
|
||||
@@ -1535,8 +1555,11 @@ HAL_StatusTypeDef HAL_USART_Receive_DMA(USART_HandleTypeDef *husart, uint8_t *pR
|
||||
/* Process Unlocked */
|
||||
__HAL_UNLOCK(husart);
|
||||
|
||||
/* Enable the USART Parity Error Interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
if (husart->Init.Parity != USART_PARITY_NONE)
|
||||
{
|
||||
/* Enable the USART Parity Error Interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
}
|
||||
|
||||
/* Enable the USART Error Interrupt: (Frame error, noise error, overrun error) */
|
||||
SET_BIT(husart->Instance->CR3, USART_CR3_EIE);
|
||||
@@ -1591,11 +1614,11 @@ HAL_StatusTypeDef HAL_USART_Receive_DMA(USART_HandleTypeDef *husart, uint8_t *pR
|
||||
* @param Size amount of data elements (u8 or u16) to be received/sent.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData,
|
||||
HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData,
|
||||
uint16_t Size)
|
||||
{
|
||||
HAL_StatusTypeDef status;
|
||||
uint32_t *tmp;
|
||||
const uint32_t *tmp;
|
||||
|
||||
if (husart->State == HAL_USART_STATE_READY)
|
||||
{
|
||||
@@ -1637,13 +1660,13 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, uin
|
||||
|
||||
/* Enable the USART receive DMA channel */
|
||||
tmp = (uint32_t *)&pRxData;
|
||||
status = HAL_DMA_Start_IT(husart->hdmarx, (uint32_t)&husart->Instance->RDR, *(uint32_t *)tmp, Size);
|
||||
status = HAL_DMA_Start_IT(husart->hdmarx, (uint32_t)&husart->Instance->RDR, *(const uint32_t *)tmp, Size);
|
||||
|
||||
/* Enable the USART transmit DMA channel */
|
||||
if (status == HAL_OK)
|
||||
{
|
||||
tmp = (uint32_t *)&pTxData;
|
||||
status = HAL_DMA_Start_IT(husart->hdmatx, *(uint32_t *)tmp, (uint32_t)&husart->Instance->TDR, Size);
|
||||
tmp = (const uint32_t *)&pTxData;
|
||||
status = HAL_DMA_Start_IT(husart->hdmatx, *(const uint32_t *)tmp, (uint32_t)&husart->Instance->TDR, Size);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1656,8 +1679,11 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, uin
|
||||
/* Process Unlocked */
|
||||
__HAL_UNLOCK(husart);
|
||||
|
||||
/* Enable the USART Parity Error Interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
if (husart->Init.Parity != USART_PARITY_NONE)
|
||||
{
|
||||
/* Enable the USART Parity Error Interrupt */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
}
|
||||
|
||||
/* Enable the USART Error Interrupt: (Frame error, noise error, overrun error) */
|
||||
SET_BIT(husart->Instance->CR3, USART_CR3_EIE);
|
||||
@@ -1774,7 +1800,10 @@ HAL_StatusTypeDef HAL_USART_DMAResume(USART_HandleTypeDef *husart)
|
||||
__HAL_USART_CLEAR_FLAG(husart, USART_CLEAR_OREF);
|
||||
|
||||
/* Re-enable PE and ERR (Frame error, noise error, overrun error) interrupts */
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
if (husart->Init.Parity != USART_PARITY_NONE)
|
||||
{
|
||||
SET_BIT(husart->Instance->CR1, USART_CR1_PEIE);
|
||||
}
|
||||
SET_BIT(husart->Instance->CR3, USART_CR3_EIE);
|
||||
|
||||
/* Enable the USART DMA Rx request before the DMA Tx request */
|
||||
@@ -1866,9 +1895,10 @@ HAL_StatusTypeDef HAL_USART_Abort(USART_HandleTypeDef *husart)
|
||||
USART_CR1_TCIE));
|
||||
CLEAR_BIT(husart->Instance->CR3, (USART_CR3_EIE | USART_CR3_RXFTIE | USART_CR3_TXFTIE));
|
||||
|
||||
/* Disable the USART DMA Tx request if enabled */
|
||||
/* Abort the USART DMA Tx channel if enabled */
|
||||
if (HAL_IS_BIT_SET(husart->Instance->CR3, USART_CR3_DMAT))
|
||||
{
|
||||
/* Disable the USART DMA Tx request if enabled */
|
||||
CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAT);
|
||||
|
||||
/* Abort the USART DMA Tx channel : use blocking DMA Abort API (no callback) */
|
||||
@@ -1891,9 +1921,10 @@ HAL_StatusTypeDef HAL_USART_Abort(USART_HandleTypeDef *husart)
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable the USART DMA Rx request if enabled */
|
||||
/* Abort the USART DMA Rx channel if enabled */
|
||||
if (HAL_IS_BIT_SET(husart->Instance->CR3, USART_CR3_DMAR))
|
||||
{
|
||||
/* Disable the USART DMA Rx request if enabled */
|
||||
CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAR);
|
||||
|
||||
/* Abort the USART DMA Rx channel : use blocking DMA Abort API (no callback) */
|
||||
@@ -1995,7 +2026,7 @@ HAL_StatusTypeDef HAL_USART_Abort_IT(USART_HandleTypeDef *husart)
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable the USART DMA Tx request if enabled */
|
||||
/* Abort the USART DMA Tx channel if enabled */
|
||||
if (HAL_IS_BIT_SET(husart->Instance->CR3, USART_CR3_DMAT))
|
||||
{
|
||||
/* Disable DMA Tx at USART level */
|
||||
@@ -2019,9 +2050,10 @@ HAL_StatusTypeDef HAL_USART_Abort_IT(USART_HandleTypeDef *husart)
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable the USART DMA Rx request if enabled */
|
||||
/* Abort the USART DMA Rx channel if enabled */
|
||||
if (HAL_IS_BIT_SET(husart->Instance->CR3, USART_CR3_DMAR))
|
||||
{
|
||||
/* Disable the USART DMA Rx request if enabled */
|
||||
CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAR);
|
||||
|
||||
/* Abort the USART DMA Rx channel : use non blocking DMA Abort API (callback) */
|
||||
@@ -2201,9 +2233,10 @@ void HAL_USART_IRQHandler(USART_HandleTypeDef *husart)
|
||||
Disable Interrupts, and disable DMA requests, if ongoing */
|
||||
USART_EndTransfer(husart);
|
||||
|
||||
/* Disable the USART DMA Rx request if enabled */
|
||||
/* Abort the USART DMA Rx channel if enabled */
|
||||
if (HAL_IS_BIT_SET(husart->Instance->CR3, USART_CR3_DMAR))
|
||||
{
|
||||
/* Disable the USART DMA Rx request if enabled */
|
||||
CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAR | USART_CR3_DMAR);
|
||||
|
||||
/* Abort the USART DMA Tx channel */
|
||||
@@ -2810,10 +2843,11 @@ static void USART_DMARxAbortCallback(DMA_HandleTypeDef *hdma)
|
||||
|
||||
|
||||
/**
|
||||
* @brief Handle USART Communication Timeout.
|
||||
* @brief Handle USART Communication Timeout. It waits
|
||||
* until a flag is no longer in the specified status.
|
||||
* @param husart USART handle.
|
||||
* @param Flag Specifies the USART flag to check.
|
||||
* @param Status the Flag status (SET or RESET).
|
||||
* @param Status the actual Flag status (SET or RESET).
|
||||
* @param Tickstart Tick start value
|
||||
* @param Timeout timeout duration.
|
||||
* @retval HAL status
|
||||
@@ -3038,7 +3072,7 @@ static void USART_TxISR_8BIT(USART_HandleTypeDef *husart)
|
||||
static void USART_TxISR_16BIT(USART_HandleTypeDef *husart)
|
||||
{
|
||||
const HAL_USART_StateTypeDef state = husart->State;
|
||||
uint16_t *tmp;
|
||||
const uint16_t *tmp;
|
||||
|
||||
if ((state == HAL_USART_STATE_BUSY_TX) ||
|
||||
(state == HAL_USART_STATE_BUSY_TX_RX))
|
||||
@@ -3053,7 +3087,7 @@ static void USART_TxISR_16BIT(USART_HandleTypeDef *husart)
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = (uint16_t *) husart->pTxBuffPtr;
|
||||
tmp = (const uint16_t *) husart->pTxBuffPtr;
|
||||
husart->Instance->TDR = (uint16_t)(*tmp & 0x01FFU);
|
||||
husart->pTxBuffPtr += 2U;
|
||||
husart->TxXferCount--;
|
||||
@@ -3119,7 +3153,7 @@ static void USART_TxISR_8BIT_FIFOEN(USART_HandleTypeDef *husart)
|
||||
static void USART_TxISR_16BIT_FIFOEN(USART_HandleTypeDef *husart)
|
||||
{
|
||||
const HAL_USART_StateTypeDef state = husart->State;
|
||||
uint16_t *tmp;
|
||||
const uint16_t *tmp;
|
||||
uint16_t nb_tx_data;
|
||||
|
||||
/* Check that a Tx process is ongoing */
|
||||
@@ -3140,7 +3174,7 @@ static void USART_TxISR_16BIT_FIFOEN(USART_HandleTypeDef *husart)
|
||||
}
|
||||
else if (__HAL_USART_GET_FLAG(husart, USART_FLAG_TXFNF) == SET)
|
||||
{
|
||||
tmp = (uint16_t *) husart->pTxBuffPtr;
|
||||
tmp = (const uint16_t *) husart->pTxBuffPtr;
|
||||
husart->Instance->TDR = (uint16_t)(*tmp & 0x01FFU);
|
||||
husart->pTxBuffPtr += 2U;
|
||||
husart->TxXferCount--;
|
||||
@@ -3672,4 +3706,3 @@ static void USART_RxISR_16BIT_FIFOEN(USART_HandleTypeDef *husart)
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
||||
Reference in New Issue
Block a user