[DemoCode下载] 串**互,半主机模式

[复制链接]
570|1
 楼主| 天灵灵地灵灵 发表于 2019-11-30 18:05 | 显示全部楼层 |阅读模式
TE, se, AC, os
  1. /****************************************************************************
  2. * [url=home.php?mod=space&uid=288409]@file[/url]     main.c
  3. * [url=home.php?mod=space&uid=895143]@version[/url]  V3.00
  4. * $Revision: 2 $
  5. * $Date: 14/01/28 11:44a $
  6. * [url=home.php?mod=space&uid=247401]@brief[/url]    M051 Series Semihost Sample Code
  7. *
  8. * @note
  9. * Copyright (C) 2014 Nuvoton Technology Corp. All rights reserved.
  10. *
  11. ******************************************************************************/

  12. #include <stdio.h>
  13. #include "M051Series.h"


  14. /*---------------------------------------------------------------------------------------------------------*/
  15. /* Main Function                                                                                            */
  16. /*---------------------------------------------------------------------------------------------------------*/

  17. int32_t main()
  18. {
  19.     int8_t item;

  20.     /*
  21.         To enable semihost, user must define "DEBUG_ENABLE_SEMIHOST" constant when build code with M051Series BSP.
  22.         This sample code is used to show how to print message/getchar on IDE debug environment.
  23.         It will echo all input character back on UART #1 of KEIL IDE.

  24.         In KEIL MDK, user need to open "View->Serial Window->UART #1" windows in debug mode.
  25.         In IAR Workbench, user need to open "View->Terminal I/O" in debug mode.

  26.         NOTE1: HardFault_Handler handler is implemented in retarget.c when semihost enabled.
  27.         NOTE2: Semihost only works with Nuvoton NuLink ICE Dongle.
  28.     */

  29.     printf("\n Start SEMIHOST test: \n");

  30.     while(1)
  31.     {
  32.         /* Get input character */
  33.         item = getchar();

  34.         /* Print input character back */
  35.         printf("%c\n", item);
  36.     }
  37. }

  38. /*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/





 楼主| 天灵灵地灵灵 发表于 2019-11-30 18:06 | 显示全部楼层
哈哈,这名字厉害了。马赛克,串口,交互。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

183

主题

3475

帖子

13

粉丝
快速回复 在线客服 返回列表 返回顶部