Thank you for reply. Actually, I do have some USART and I2C devices with interrupt enabled. The way to enable interrupt for USART is thru USART1_4_IRQHandler and USART2_3_IRQHandler, and the way to enable I2C interrupt is thru static void i2c_iox_events(I2C_ID_T id, I2C_EVENT_T event).
Since those are functions that must be put in the code in order for USART and I2C to work normally. How is it possible to disable the interrupt if I must put these functions?
please refer below for those functions mentioned above:
void USART2_3_IRQHandler(void)
{
uint8_t res;
/* New data will be ignored if data not popped in time */
if ((Chip_UARTN_GetStatus(LPC_USART2) & UARTN_STAT_RXRDY) != 0)
{
res = Chip_UARTN_ReadByte(LPC_USART2);
Uart02Bf[USART2_RX_LEN++] = res;
if (USART2_RX_LEN == 26)
{
USART2_RX_LEN = 0;
FPreadFlag =0;
}
}
}
static void i2c_iox_events(I2C_ID_T id, I2C_EVENT_T event)
{
switch (event) {
case I2C_EVENT_DONE:
iox_xfer.rxBuff = &iox_data[1];
iox_xfer.rxSz = sizeof(iox_data);
iox_xfer.txBuff = (const uint8_t *) iox_data;
iox_xfer.txSz = sizeof(iox_data) + 1;
break;
case I2C_EVENT_SLAVE_RX://///////////////////////////////////////////////////////////////////////////////
iox_xfer.rxBuff = &iox_data[1];
iox_xfer.rxSz = sizeof(iox_data);
KeyInReadDataStatus = 1;
if(beepOn == 1)
{
if(beepSound == 1)
beep(); // beep!
}
LED_all_off();
uint32_t i;
for(i = 0 ; i < 180000 ; i++);
LED_all_on();
break;
case I2C_EVENT_SLAVE_TX:
if (iox_xfer.txSz == 1) {
iox_xfer.txBuff = (const uint8_t *) iox_data[0];
iox_xfer.txSz = sizeof(iox_data) + 1;
}
break;
}
}