Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PeriphDrivers): Fix bad logic on ME16 UART IDX checking in MXC_UART_SetClockSource. #1283

Conversation

Brandon-Hurst
Copy link
Contributor

Description

ME16 (MAX32675) will currently always fail to initialize its UART. This is because the logic inside the SetClockSource function uses an || instead of an && for checking mutually exclusive conditions:

// FIXME: CHANGE FROM || TO &&
    if (MXC_UART_GET_IDX(uart) != 0 || MXC_UART_GET_IDX(uart) != 2) { 
        return E_BAD_PARAM;
    }

Because the UART is for sure either 0 or 2, this check will always fail. The correct operation is to use && for this sort of check. That's the only change in this PR.

@github-actions github-actions bot added the MAX32675 Related to the MAX32675 (ME16) label Dec 1, 2024
@sihyung-maxim sihyung-maxim merged commit 9c8c137 into analogdevicesinc:main Dec 3, 2024
8 checks passed
sihyung-maxim pushed a commit to analogdevicesinc/hal_adi that referenced this pull request Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAX32675 Related to the MAX32675 (ME16)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants