<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > STM32中用printf代替uart打印數(shù)據(jù)的方法

          STM32中用printf代替uart打印數(shù)據(jù)的方法

          作者: 時間:2016-11-11 來源:網(wǎng)絡(luò) 收藏
          .在程序中添加:(頭文件需要添加#include)

          #ifdef__GNUC__
          #definePUTCHAR_PROTOTYPEint__io_putchar(intch)
          #else
          #definePUTCHAR_PROTOTYPEintfputc(intch,FILE*f)
          #endif
          PUTCHAR_PROTOTYPE
          {

          本文引用地址:http://www.ex-cimer.com/article/201611/316696.htm

          USART_SendData(USART1,(u8)ch);
          while(USART_GetFlagStatus(USART1,USART_FLAG_TC)==RESET);

          returnch;
          }

          IAR:出現(xiàn)identifier "FILE" is undefined,工程option中,如下選折:

          需要在的Options -> General Options ->Library Configuration里設(shè)置一下函數(shù)庫,不然printf函數(shù)不對,將Library Configuration 中的Library 設(shè)置由"Normal"改為"Full"就可以了。


          KEIL:在工程屬性的 “Target" -> "Code Generation" 選項中勾選 "Use MicroLIB"”


          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();