main.c 725 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "nim_config.h"
  2. #include "lwiplib.h"
  3. #include "lwipopts.h"
  4. #include "hlx.h"
  5. #define LEN_IP_ADDR (4u)
  6. #define ASCII_NUM_IDX (48u)
  7. void DeviceInit();
  8. int main()
  9. {
  10. DeviceInit();
  11. ConsolePuts("\r\n ============NIM DSP START===========.\r\n", -1);
  12. lwip_tcp_init(TCP_SERVER_PORT); //开启本设备TCP服务器
  13. for (;;)
  14. {
  15. HlxMain();
  16. }
  17. }
  18. /**
  19. * @title 全局中断
  20. */
  21. void InterruptInit(void)
  22. {
  23. // 初始化 DSP 中断控制器
  24. IntDSPINTCInit();
  25. // 使能 DSP 全局中断
  26. IntGlobalEnable();
  27. }
  28. /**
  29. * 设备初始化
  30. */
  31. void DeviceInit()
  32. {
  33. InterruptInit();
  34. ConsoleDeviceInit();//控制台初始化
  35. lwip_device_init(); //以太网模块初始化
  36. HlxInit();
  37. }