关于rt_hw_interrupt_disable的问题!
小弟在调试RT0.3.0的版本for LPC2148的版本时发现rt_hw_interrupt_disable禁止不了中断,导致总是IAP时写扇区失败或者跑飞。取消IAP代码单独调试时,注销rt_hw_interrupt_enable,发现还是能进入串口中断,Timer中断也是如此,请问rt_hw_interrupt_disable代码问题?
while (UART_LSR(lpc_serial->hw_base) & 0x01)
{
/* disable interrupt */
level = rt_hw_interrupt_disable();
/* read character */
lpc_serial->rx_buffer =
UART_RBR(lpc_serial->hw_base);
lpc_serial->save_index ++;
if (lpc_serial->save_index >= RT_UART_RX_BUFFER_SIZE)
lpc_serial->save_index = 0;
/* if the next position is read index, discard this 'read char' */
if (lpc_serial->save_index == lpc_serial->read_index)
{
lpc_serial->read_index ++;
if (lpc_serial->read_index >= RT_UART_RX_BUFFER_SIZE)
lpc_serial->read_index = 0;
}
/* enable interrupt */
//rt_hw_interrupt_enable(level); <= 注销此行还是能进入串口中断!!!
}
页:
[1]