微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 在线跪求大神解决EDK中Powerpc中断的问题

在线跪求大神解决EDK中Powerpc中断的问题

时间:10-02 整理:3721RD 点击:

  1. #include "xparameters.h"

  2. #include "xcache_l.h"

  3. #include "stdio.h"

  4. #include "xutil.h"

  5. #include "xuartlite.h"
  6. #include "xuartlite_l.h"

  7. #include "xintc.h"
  8. #include "xintc_l.h"
  9. #include "xintc_i.h"

  10. #include "xexception_l.h"

  11. //====================================================

  12. char buff;
  13. void RS232_IntHandler(void)
  14. {
  15. while(!XUartLite_mIsReceiveEmpty(XPAR_RS232_BASEADDR ))
  16. {
  17.   buff=XUartLite_RecvByte(XPAR_RS232_BASEADDR );
  18.   XUartLite_SendByte(XPAR_RS232_BASEADDR,buff);
  19. }
  20. }

  21. int main (void)
  22. {
  23.    print("-- Entering main() --\r\n");
  24.    XExc_Init();
  25.    XExc_RegisterHandler(XEXC_ID_NON_CRITICAL_INT,(XExceptionHandler)XIntc_DeviceInterruptHandler,(void*)0);
  26.    XCache_EnableICache(0xc0000001);
  27.    XCache_EnableDCache(0xc0000001);

  28.    XIntc_RegisterHandler(XPAR_XPS_INTC_0_BASEADDR,XPAR_XPS_INTC_0_RS232_INTERRUPT_INTR,(XInterruptHandler)RS232_IntHandler,(void *)0);
  29.    XIntc_mMasterEnable(XPAR_XPS_INTC_0_BASEADDR );
  30.    XIntc_mEnableIntr(XPAR_XPS_INTC_0_BASEADDR,XPAR_RS232_INTERRUPT_MASK );

  31.    XUartLite_mEnableIntr(XPAR_RS232_BASEADDR);
  32.    
  33.   while(1){}
  34.   return 0;
  35.   XCache_DisableDCache();
  36.   XCache_DisableICache();
  37. }

复制代码


我是想要实现用中断的方式实现串口收到数据之后马上将原数据发回,求大神解决,此函数现在不嫩刚进入到main函数,另外求教关于配置中断寄存器的方法

怎么没人回复啊

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top