Skip to content

Review interrupt in STM32F4 i2c_api #1586

Closed
@arnaudrichard

Description

@arnaudrichard

About: targets/hal/TARGET_STM/TARGET_STM32F4/i2c_api.c

In function serial_irq_set(), the tx interrupt enabled and disabled are not the same:

line 764: HAL_UART_ENABLE_IT(handle, UART_IT_TC);

mismatch with

line 768: HAL_UART_DISABLE_IT(handle, UART_IT_TXE);

My guess is that the same interrupt should be used for enable and disable cases.

Now when trying to understand which one is good, the confusion between UART_IT_TC and UART_IT_TXE seems broader:
•In function serial_clear(), UART_FLAG_TXE is cleared (and not UART_FLAG_TC)
•In function uart_irq(), UART_FLAG_TC is tested (and not UART_FLAG_TXE)

I stopped here investigations and leave it to your comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions