共2条
1/1 1 跳转至页
IAR 请给看看IAR编译出错的问题!

问
编译出错,找不出原因。请给看看!
把下面这段代码加入源程序后,编译就没有办法通过!去掉后,可以编译通过!
这段代码是在程序C文件的最后部分,下面就没有其它代码了!
红体 为出错行!
提示为expect a ")"
...
#pragma vector=USART0TX_VECTOR
__interrupt void USARTTX_ISP(void)
{
_NOP(); /* check whether the value of URXIFG0 is cleared */
if((U0RCTL & URXWIE) == 0x04){ /* does RXWAKE enable? */
if(U0RXBUF == SLAVE_ADDR ){ /* check and match the address data */
U0RCTL &= ~URXWIE; /* clear UXWIE bit for receiving following data */
U0RCTL |= URXEIE; /* enable RX error interruption in following receiving */
}
}
/* for reason of non-address data will be ejection, above source part will not be in corrupt with the following part */
if(U0RCTL & (RXERR + URXEIE) == 0x09){
err_frm_idx[rx_arry_idx] = rx_arry_idx; /* record error frame number */
rx_array[rx_arry_idx++] = U0RXBUF; /* read error frame data */
}
else{
rx_array[rx_arry_idx++] = U0RXBUF; /* read data frame */
}
if(rx_arry_idx == 10){
U0RCTL |= URXWIE;
U0RCTL &= ~ URXEIE;
}
}
把下面这段代码加入源程序后,编译就没有办法通过!去掉后,可以编译通过!
这段代码是在程序C文件的最后部分,下面就没有其它代码了!
红体 为出错行!
提示为expect a ")"
...
#pragma vector=USART0TX_VECTOR
__interrupt void USARTTX_ISP(void)
{
_NOP(); /* check whether the value of URXIFG0 is cleared */
if((U0RCTL & URXWIE) == 0x04){ /* does RXWAKE enable? */
if(U0RXBUF == SLAVE_ADDR ){ /* check and match the address data */
U0RCTL &= ~URXWIE; /* clear UXWIE bit for receiving following data */
U0RCTL |= URXEIE; /* enable RX error interruption in following receiving */
}
}
/* for reason of non-address data will be ejection, above source part will not be in corrupt with the following part */
if(U0RCTL & (RXERR + URXEIE) == 0x09){
err_frm_idx[rx_arry_idx] = rx_arry_idx; /* record error frame number */
rx_array[rx_arry_idx++] = U0RXBUF; /* read error frame data */
}
else{
rx_array[rx_arry_idx++] = U0RXBUF; /* read data frame */
}
if(rx_arry_idx == 10){
U0RCTL |= URXWIE;
U0RCTL &= ~ URXEIE;
}
}
共2条
1/1 1 跳转至页