test commit, update gitignore
This commit is contained in:
@ -755,15 +755,14 @@ HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uin
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||
{
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_BUSY;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
/* Set state and reset error code */
|
||||
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||
@ -874,15 +873,14 @@ HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||
{
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_BUSY;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
/* Set state and reset error code */
|
||||
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||
@ -972,15 +970,14 @@ HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||
{
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_BUSY;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
/* Set state and reset error code */
|
||||
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||
@ -999,6 +996,8 @@ HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
hi2s->TxXferCount = Size;
|
||||
}
|
||||
|
||||
__HAL_UNLOCK(hi2s);
|
||||
|
||||
/* Enable TXE and ERR interrupt */
|
||||
__HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
|
||||
|
||||
@ -1009,7 +1008,6 @@ HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
__HAL_I2S_ENABLE(hi2s);
|
||||
}
|
||||
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
@ -1038,15 +1036,14 @@ HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, u
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||
{
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_BUSY;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
/* Set state and reset error code */
|
||||
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||
@ -1065,6 +1062,8 @@ HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, u
|
||||
hi2s->RxXferCount = Size;
|
||||
}
|
||||
|
||||
__HAL_UNLOCK(hi2s);
|
||||
|
||||
/* Enable RXNE and ERR interrupt */
|
||||
__HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_RXNE | I2S_IT_ERR));
|
||||
|
||||
@ -1075,7 +1074,6 @@ HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, u
|
||||
__HAL_I2S_ENABLE(hi2s);
|
||||
}
|
||||
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
@ -1102,15 +1100,14 @@ HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||
{
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_BUSY;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
/* Set state and reset error code */
|
||||
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||
@ -1152,12 +1149,7 @@ HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Check if the I2S is already enabled */
|
||||
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
||||
{
|
||||
/* Enable I2S peripheral */
|
||||
__HAL_I2S_ENABLE(hi2s);
|
||||
}
|
||||
__HAL_UNLOCK(hi2s);
|
||||
|
||||
/* Check if the I2S Tx request is already enabled */
|
||||
if (HAL_IS_BIT_CLR(hi2s->Instance->CR2, SPI_CR2_TXDMAEN))
|
||||
@ -1166,7 +1158,13 @@ HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
SET_BIT(hi2s->Instance->CR2, SPI_CR2_TXDMAEN);
|
||||
}
|
||||
|
||||
__HAL_UNLOCK(hi2s);
|
||||
/* Check if the I2S is already enabled */
|
||||
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
||||
{
|
||||
/* Enable I2S peripheral */
|
||||
__HAL_I2S_ENABLE(hi2s);
|
||||
}
|
||||
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
@ -1193,15 +1191,14 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||
{
|
||||
__HAL_UNLOCK(hi2s);
|
||||
return HAL_BUSY;
|
||||
}
|
||||
|
||||
/* Process Locked */
|
||||
__HAL_LOCK(hi2s);
|
||||
|
||||
/* Set state and reset error code */
|
||||
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||
@ -1249,12 +1246,7 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* Check if the I2S is already enabled */
|
||||
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
||||
{
|
||||
/* Enable I2S peripheral */
|
||||
__HAL_I2S_ENABLE(hi2s);
|
||||
}
|
||||
__HAL_UNLOCK(hi2s);
|
||||
|
||||
/* Check if the I2S Rx request is already enabled */
|
||||
if (HAL_IS_BIT_CLR(hi2s->Instance->CR2, SPI_CR2_RXDMAEN))
|
||||
@ -1263,7 +1255,13 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
||||
SET_BIT(hi2s->Instance->CR2, SPI_CR2_RXDMAEN);
|
||||
}
|
||||
|
||||
__HAL_UNLOCK(hi2s);
|
||||
/* Check if the I2S is already enabled */
|
||||
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
||||
{
|
||||
/* Enable I2S peripheral */
|
||||
__HAL_I2S_ENABLE(hi2s);
|
||||
}
|
||||
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user