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.

关于在Z-STACK 中重定义printf函数失败的请教

Other Parts Discussed in Thread: Z-STACK

在mdk中可以很好的重定义printf,但是在z-stack中使用下面代码重定义printf到串口1

//头文件包含

#include <stdio.h>

int putchar(int ch)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */
HalUARTWrite(HAL_UART_PORT_0, (uint8*)&ch,1);

return ch;
}

但是编译提示

Error[Pe147]: declaration is incompatible with "__near_func __xdata_reentrant int putchar(int)" 这个错误,Z-Stack有必须使用bank模式,请教一下高手应该怎么实现我需要的功能呢?谢谢!!!