微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI WIFI设计交流 > 利用CCS开发CC3200调用库函数UART_PRINT详情

利用CCS开发CC3200调用库函数UART_PRINT详情

时间:10-02 整理:3721RD 点击:

在调用CC3200库函数开发中,调用UART_PRINT打印输出,想利用这个来查看输出的值的样式,,想问打印格式要满足什么要求?

//***************************************************************************** // //! prints the formatted string on to the console //! //! \param format is a pointer to the character string specifying the format in //! the following arguments need to be interpreted. //! \param [variable number of] arguments according to the format in the first //! parameters //! This function //! 1. prints the formatted error statement. //! //! \return count of characters printed // //***************************************************************************** int Report(const char *pcFormat, ...) { int iRet = 0; #ifndef NOTERM char *pcBuff, *pcTemp; int iSize = 256; va_list list; pcBuff = (char*)malloc(iSize); if(pcBuff == NULL) { return -1; } while(1) { va_start(list,pcFormat); iRet = vsnprintf(pcBuff,iSize,pcFormat,list); va_end(list); if(iRet > -1 && iRet < iSize) { break; } else { iSize*=2; if((pcTemp=realloc(pcBuff,iSize))==NULL) { Message("Could not reallocate memory\n\r"); iRet = -1; break; } else { pcBuff=pcTemp; } } } Message(pcBuff); free(pcBuff); #endif return iRet; }

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top