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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > STM8 用printf代替uart方法

          STM8 用printf代替uart方法

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

          #ifdef__GNUC__
          #definePUTCHAR_PROTOTYPEint__io_putchar(intch)
          #else
          #definePUTCHAR_PROTOTYPEintfputc(intch,FILE*f)
          #endif
          PUTCHAR_PROTOTYPE
          {
          //發(fā)送數(shù)據(jù)代碼
          returnch;
          }

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

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

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



          關鍵詞: STM8printfuart方

          評論


          技術專區(qū)

          關閉
          看屁屁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); })();