因为要使用到printf故在程序中代码如下:
//-------------------------------以下都为 标准 printf函数连接--------------------------------------------------------------
//#################################################
//-----------------------------------------------
//Printf 函数连接
//-----------------------------------------------
void open_uart_debug (void)
{
int status=0;
status = add_device("uart", _MSA, my_open, my_close, my_read, my_write, my_lseek, my_unlink, my_rename);
if (status == 0) {
freopen("uart:", "w", stdout); // open uart and redirect stdout to UART
setvbuf(stdout, NULL, _IONBF, 0); // disable buffering for stdout
}
}
int my_open(const char *path, unsigned flags, int fno)
{
//scia_fifo_init();
//scia_echoback_init();
path = path;
flags = flags;
fno = fno;
return 0;
}
int my_close(int fno)
{
fno =fno;
return 0;
}
int my_read(int fno, char *buffer, unsigned count)
{
fno = fno;
buffer = buffer;
count = count;
return 0;
}
int my_write(int fno, const char *buffer, unsigned count)
{
int i=0;
fno = fno;
while(count-- > 0) {
scia_xmit(buffer[i++]);
}
return count;
}
off_t my_lseek(int fno, off_t offset, int origin)
{
fno = fno; offset = offset; origin = origin;
return 0;
}
int my_unlink(const char *path)
{
path = path;
return 0;
}
int my_rename(const char *old_name, const char *new_name)
{
old_name = old_name;
new_name = new_name;
return 0;
}
使用printf好像要占用.ico段,但程序需要使用大数组,故造成程序的空间不够,那么请问不使用printf的CCS编译器是怎么设置?
不使用printf函数的情况下,SCI能否往外打印数据?谢谢!