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

mos_uclose doesn't appear to remove registered interrupts #44

Closed
envenomator opened this issue Apr 4, 2023 · 0 comments
Closed

mos_uclose doesn't appear to remove registered interrupts #44

envenomator opened this issue Apr 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@envenomator
Copy link
Contributor

mos_uclose calls close_UART1 in mos.c, which doesn't appear to remove the previously registered interrupt(s) from the UART1_IER register. This causes an issue later on, when the old interrupt vector is put back in place.
When I use the MOS API mos_setintvector to set my uart1 handler, then mos_uopen using a uart structure, call my own closing routine and put back the previous vector with mos_setintvector, everything runs just fine.
I'm using this close to close out the UART1 before returning the old vector:

VOID close_UART1( VOID )
{
UART1_IER = 0 ; //! Disable all UART1 interrupts.
UART1_LCTL = 0 ; //! Bring line control register to reset value.
UART1_MCTL = 0x00 ; //! Bring modem control register to reset value.
UART1_FCTL = 0 ; //! Bring FIFO control register to reset value.

init_UART1();													// set port pins to original values
return ;

}

perhaps it's unnecessary to again init the UART1, but I was just being cautious.

@breakintoprogram breakintoprogram moved this to In Progress in AGON Quark Firmware Apr 8, 2023
@breakintoprogram breakintoprogram added the bug Something isn't working label Apr 8, 2023
@breakintoprogram breakintoprogram moved this from In Progress to QA in AGON Quark Firmware Apr 8, 2023
@breakintoprogram breakintoprogram moved this from QA to Done in AGON Quark Firmware Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Released
Development

No branches or pull requests

2 participants