Cross compiler interrupt service routine compatibility definitions for MSP430 based platforms based on isr_compat.h by Steve Underwood.
This commit is contained in:
parent
7eac4393c2
commit
684c3edfa6
31 changed files with 157 additions and 182 deletions
|
@ -39,6 +39,7 @@
|
|||
*/
|
||||
|
||||
#include "i2cmaster.h"
|
||||
#include "isr_compat.h"
|
||||
|
||||
signed char tx_byte_ctr, rx_byte_ctr;
|
||||
unsigned char rx_buf[2];
|
||||
|
@ -201,13 +202,8 @@ i2c_transmit_n(uint8_t byte_ctr, uint8_t *tx_buf) {
|
|||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#pragma vector=USCIAB1TX_VECTOR
|
||||
__interrupt void
|
||||
#else
|
||||
interrupt (USCIAB1TX_VECTOR)
|
||||
#endif
|
||||
i2c_tx_interrupt (void) {
|
||||
ISR(USCIAB1TX, i2c_tx_interrupt)
|
||||
{
|
||||
// TX Part
|
||||
if (UC1IFG & UCB1TXIFG) { // TX int. condition
|
||||
if (tx_byte_ctr == 0) {
|
||||
|
@ -237,18 +233,11 @@ i2c_tx_interrupt (void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#pragma vector=USCIAB1RX_VECTOR
|
||||
__interrupt void
|
||||
#else
|
||||
interrupt (USCIAB1RX_VECTOR)
|
||||
#endif
|
||||
i2c_rx_interrupt(void) {
|
||||
if (UCB1STAT & UCNACKIFG){
|
||||
ISR(USCIAB1RX, i2c_rx_interrupt)
|
||||
{
|
||||
if(UCB1STAT & UCNACKIFG) {
|
||||
PRINTFDEBUG("!!! NACK received in RX\n");
|
||||
UCB1CTL1 |= UCTXSTP;
|
||||
UCB1STAT &= ~UCNACKIFG;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue