void
USBUARTIntHandler(void)
{
uint32_t ui32Ints;
uint32_t transmitCmd=0;
//
// Get and clear the current interrupt source(s)
//
ui32Ints = ROM_UARTIntStatus(UART2_BASE, true);
ROM_UARTIntClear(UART2_BASE, ui32Ints);
//
// Are we being interrupted because the TX FIFO has space available?
//
if(ui32Ints & UART_INT_TX)
{
//
// Move as many bytes as we can into the transmit FIFO.
//
}
//
// Handle receive interrupts.
//
if(ui32Ints & (UART_INT_RX | UART_INT_RT))
{
//
// Read the UART's characters into the buffer.
//
transmitCmd=ReadUARTData();
}
if(transmitCmd==1)
{
(*((void (*)(void))(*(uint32_t *)0x04)))();
}
}
上面是个串口中断入口程序,结尾处通过判断transmitCmd==1后进行了地址跳转(*((void (*)(void))(*(uint32_t *)0x04)))();,请问如何在跳转前如何解决堆栈破坏问题??急求解答,谢谢
Michael Sun:
能否请楼主详细描述一下什么情况下对堆栈进行的破坏,需要保护哪些内容?