工具/软件:Code Composer Studio
我正在使用 CCS9.30和 MSP430F2418、我在将 printf()重定向到 UART#1时遇到问题。
我以前做过其他一些具有相同微控制器的项目、没有遇到任何问题、但现在似乎我错过了一些东西。
我定义了两个函数(见下面)、添加了#include ,增加堆栈(到160)和堆(到320)大小。
但当我调用 printf()函数时,执行点会跳转到 main()的开头,而不会丢失与 micro (!)的连接。 因此、它看起来不像 由于堆栈或堆的覆盖而重新启动的微控制器。
如果我单步进入 printf()-我要点击__TI_file_lock (stdout)函数,然后它跳转到 main(),请参见屏幕截图。
我忘记了什么、或者我做了什么错误?
int fputc (int _c、寄存器文件*_FP) { while (UC1IFG&UCA1TXIFG);UCA1TXBUF =(unsigned char _c;return (unsigned char)_c);int fputs (const char *_ptr、register file *_fp) { i、unsigned i、tr = 0;unsigned <len ; int flen (t = t);t = t = t = t (t);t = t = t = t = len (t i++) { while (!(UC1IFG&UCA1TXIFG)); UCA1TXBUF =(无符号字符)_PTR[i]; } 返回 len; }