欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: xc8編譯器,pic16f1825 單片機 串口發送程序編譯不過. [打印本頁]

作者: aliao15    時間: 2017-11-13 10:45
標題: xc8編譯器,pic16f1825 單片機 串口發送程序編譯不過.
大家好!請教個問題:
    xc8編譯器,pic16f1825 單片機 串口發送程序編譯不過.代碼如下:
/串口發送一串字符
void EUSART_SendString(const unsigned char  *pData)
{   
    di(); //GIE = 0 //disable all interrupts
    TXIE =0;  //屏閉EUSART 發送中斷
   
    int len = strlen(pData);
    unsigned char  *str= malloc(len);
    if(str !=NULL){
        strcpy(str,pData);
        while(*str!='\0')
        {
            TXREG = *str++;
            while(TXSTAbits.TRMT==0);//TRMT=1時,TSR為空,否則不為空
        }
        free(str);
    }
}

編譯錯誤 如下:
:: warning: (1273) Omniscient Code Generation not available in Free mode
mcu_wifi.c:108: advisory: (1510) non-reentrant function "_EUSART_SendString" appears in multiple call graphs and has been duplicated by the compiler
C:\Program Files\Microchip\xc8\v1.42\sources\common\strcpy.c:8: advisory: (1510) non-reentrant function "_strcpy" appears in multiple call graphs and has been duplicated by the compiler
C:\Program Files\Microchip\xc8\v1.42\sources\common\strlen.c:4: advisory: (1510) non-reentrant function "_strlen" appears in multiple call graphs and has been duplicated by the compiler
uart_comm.c:9: warning: (520) function "_calc_checksum" is never called
:0: error: (500) undefined symbols:
        _free(dist/default/production\mcu_wifi.X.production.obj) _malloc(dist/default/production\mcu_wifi.X.production.obj)
(908) exit status = 1
nbproject/Makefile-default.mk:147: recipe for target 'dist/default/production/mcu_wifi.X.production.hex' failed
make[2]: Leaving directory 'D:/VM/share/AbleCloud/mcu_firmware/mcu_wifi/mcu_wifi.X'
nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/VM/share/AbleCloud/mcu_firmware/mcu_wifi/mcu_wifi.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [dist/default/production/mcu_wifi.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

編譯已失敗 (退出值2, 總時間: 2s)

各位大牛,請幫我看下是什么問題!!
作者: king2007    時間: 2020-12-31 15:49
你的free 沒有包含頭文件 free 的頭文件是 #include<stdlib.h>




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1