Skip to content

Commit

Permalink
Update tm_stm32_i2c_dma.c
Browse files Browse the repository at this point in the history
Some corrections to at least compile the module
  • Loading branch information
leodicarpaccio authored Apr 20, 2021
1 parent faf3f42 commit 43b5ead
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 00-STM32_LIBRARIES/tm_stm32_i2c_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ uint8_t TM_I2C_DMA_SendByte(I2C_TypeDef* I2Cx, uint8_t value, uint16_t count) {
TM_DMA_Start(&DMA_InitStruct, (uint32_t) &Settings->Dummy32, (uint32_t) &I2Cx->DR, count);

/* Enable I2C TX DMA */
I2Cx->CR2 |= I2C_CR2_TXDMAEN;
I2Cx->CR2 |= I2C_CR2_DMAEN;

/* Return OK */
return 1;
Expand Down Expand Up @@ -273,7 +273,7 @@ uint8_t TM_I2C_DMA_SendHalfWord(I2C_TypeDef* I2Cx, uint16_t value, uint16_t coun
TM_DMA_Start(&DMA_InitStruct, (uint32_t) &Settings->Dummy16, (uint32_t) &I2Cx->DR, count);

/* Enable I2C TX DMA */
I2Cx->CR2 |= I2C_CR2_TXDMAEN;
I2Cx->CR2 |= I2C_CR2_DMAEN;

/* Return OK */
return 1;
Expand All @@ -287,7 +287,7 @@ uint8_t TM_I2C_DMA_Transmitting(I2C_TypeDef* I2Cx) {
return (
Settings->RX_Stream->NDTR || /*!< RX is working */
Settings->TX_Stream->NDTR || /*!< TX is working */
I2C_IS_BUSY(I2Cx) /*!< I2C is busy */
I2C_SR2_BUSY(I2Cx) /*!< I2C is busy */

This comment has been minimized.

Copy link
@leodicarpaccio

leodicarpaccio Apr 20, 2021

Author Contributor

The real correction :
READ_BIT(I2Cx->SR2, I2C_SR2_BUSY)

This comment has been minimized.

Copy link
@MaJerle

MaJerle Apr 20, 2021

Owner

Can you make a pull request?

);
}

Expand Down

0 comments on commit 43b5ead

Please sign in to comment.