This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0L1306: CCS12.4 Studio如何配置工程使用printf

Part Number: MSPM0L1306

我基于中断的例程使用printf函数,但是重定向失败了,输出到了CIO的对话框中,没有定向到串口,而且__io_putchar函数没有被调用

代码如下,工程属性配置中是否应该进行修改

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "ti_msp_dl_config.h"
#include <stdio.h>
uint8_t data = 0;
volatile bool uart_send_complete_flag = false;
int __io_putchar(int ch)
{
DL_UART_Main_transmitData(UART_0_INST, (uint8_t)ch);
while(uart_send_complete_flag == false){}
uart_send_complete_flag = false;
return ch;
}
int main(void)
{
SYSCFG_DL_init();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX