freecale FAE give me a example about MKE02Z lately.but i debug unsuccessful for<<UART_demo>> and <<PIT_demo>>. it's enter into interrupt but not turn out. result not run all proceduce .does anyone know the answer??
不久前飞思卡尔的技术支持给我了一个关于MKE02Z的范例,但是我调试<<UART_demo>> 和<<PIT_demo>>的时候并不成功,他们都能进入中断但是出不来,导致所有的程序都卡死了。有人知道答案吗???
#include "common.h"
#include "rtc.h"
#include "uart.h"
int main (void);
void RTC_Task(void);
/******************************************************************************
* Global functions
******************************************************************************/
void UART_rx(int8 ch)
{
UART1_send_byte(ch);
RED_Toggle();
}
/********************************************************************/
int main (void)
{
LED0_Init();
printf("\nRunning the Uart_demo project.\n");
#ifdef UART_INT
/* uart interrupt mode */
UART_set_rx_handler(UART_rx);
enable_UART1_int();
printf_int("\nhello world\n");
#endif
while(1)
{
}
}
Hi 宝荣,
请问您的问题解决了吗?从代码中,初步确定是因为没有使能UART 的时钟。
如果仍有问题,欢迎交流。
BR
Alice
我都忘了是那个事情了,倒不是UART不能使能,需要将中断函数与中断向量关联起来,在isr.h里面,把UART中断和向量关联起来。
Hello,
According to your Service Request the problem has been resolved.
If any issue arises or you have any questions please let us know.
Regards!
Jorge Gonzalez