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

twi.c failed to compile with MSP430G2553 #1075

Open
jhpark16 opened this issue Sep 4, 2022 · 0 comments
Open

twi.c failed to compile with MSP430G2553 #1075

jhpark16 opened this issue Sep 4, 2022 · 0 comments

Comments

@jhpark16
Copy link

jhpark16 commented Sep 4, 2022

Thank you for opening an issue on the Energia repository.

Do not use GitHub issues for project related questions.

Use instead the 43oh forum and TI E2E forum, so everyone can share the questions and answers.

Do not use GitHub issues for questions on third-party libraries.

Use instead their own repositories.

Check the issue hasn't been reported yet.

If an issue has alreday been reported, add your case to its thread.

Please provide the following information.

  • LaunchPad board name and version: INSERT LAUNCHPAD BOARD NAME AND VERSION
  • Energia IDE version (found in Energia > About Energia menu): INSERT ENERGIA VERSION
  • Board package version (found in Tools > Boards > Boards Manager menu): INSERT BOARD PACKAGE VERSION
  • OS name and version: INSERT OS NAME AND VERSION
    MSP-EXP430G2 (old version)
    Energia 1.8.10E23
    Energia MSP430 board 1.07
    Windows 10

Describe the expected results.

INSERT DESCRIPTION OF THE EXPECTED RESULT

Describe the actual results.

INSERT DESCRIPTION OF THE ACTUAL RESULT
twi.c failed to compile with MSP430G2553 because it does not have EUSCI_B0.

List the steps to reproduce the problem.

INSERT STEPS TO REPRODUCE THE PROBLEM
MSP430G2553 has an USCI_B0 but does not have EUSCI_BO. twi_disable cannot handle cases such as MSP430_HAS_USCI
MSP430_HAS_USCI_B0 or MSP430_HAS_USCI_B1.
The solution is:
twi.c should be change from

void twi_disable(void)
{
#if defined(__MSP430_HAS_USI__)
    /* Disable USI */
    USICTL0 |= USISWRST;
#else
     /* Disable USCI */
    UCBzCTLW0 |= (UCSWRST);
#endif
}

to

void twi_disable(void)
{
#if defined(__MSP430_HAS_USI__)
    /* Disable USI */
    USICTL0 |= USISWRST;
#elif defined(__MSP430_HAS_USCI__) \
 || defined(__MSP430_HAS_USCI_B0__) || defined(__MSP430_HAS_USCI_B1__)
    UCB0CTL1 |= UCSWRST;
#else
     /* Disable USCI */
    UCBzCTLW0 |= (UCSWRST);
#endif
}

Thank you.

Cheers
Jungho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant