msp430: twi: move interrupt handler for USCI_Bx to twi.c - #589
Conversation
For the USCI module, it shares interrupt vector for USCI_Ax and USCI_Bx, so the interrupt routine should still be in usci_isr_handler. But for USCI_B0 and USCI_B1, the interrupt handler can be moved to twi.c. This is exactly the same way it is done for the EUSCI_Bx module, it already has the interrupt handler in twi.c
|
@spirilis I am a bit unsure about the "stay_asleep" code. #if defined(MSP430_HAS_USCI_B0) || defined(MSP430_HAS_USCI_B1) || defined(MSP430_HAS_EUSCI_B0) in twi.c ? Also, I do not understand why you have not added the "stay_asleep" code blocks in the interrupt handler for EUSCI_B0, in twi.c. Regards |
|
I don't have the code in front of me, but with stay_asleep code, ask yourself if there's a potential to run a user-provided callback function in the ISR. If so, the stay_asleep code should be there. I believe I2C slave callback functions may be a reason for this. |
For the USCI module, it shares interrupt vector for
USCI_Ax and USCI_Bx, so the interrupt routine should still
be in usci_isr_handler.
But for USCI_B0 and USCI_B1, the interrupt handler can be
moved to twi.c. This is exactly the same way it is done
for the EUSCI_Bx module, it already has the interrupt
handler in twi.c