Bonjour à tous, voilà, je débute sur MPLAB X, ou du moins, çà fait des années que je ne m'y suis plus intéressé !
Je rencontre des difficultés pour l'organisation des dossiers des projets, pour les déclarations et pour la syntaxe ce qui me crée beaucoup d'erreur quand je veux compiler !
Par exemple, sur ce petit programme :
1 - Ou dois'je placer les fichiers xc.h et delays.h, dois-je les placer dans le dossier du projet ou les laisser où ils sont ?Code:#include "xc.h" #include "delays.h" char T[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x47,0x7F,0x6F}; int i; void main(void) { trisb=0x00; portb=0x00; while(1){ for(i=0;i<10;i++){ portb=T[i]; delay_ms(1000); } } return; }
2 - Dois-je les importer dans documents importants, fichiers sources ou bibliothèque ou les 3 ?
3 - Ai-je des fautes de syntaxe ?
Je vous joins les logs du build !
En vous remerciant par avance !Code:CLEAN SUCCESSFUL (total time: 3ms) make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf make[1]: Entering directory 'D:/ELECTRONIC/PROJETS/segment_1.X' make -f nbproject/Makefile-default.mk dist/default/production/segment_1.X.production.hex make[2]: Entering directory 'D:/ELECTRONIC/PROJETS/segment_1.X' "D:\ELECTRONIC\bin\xc8-cc.exe" -mcpu=16F84A -c -mdfp="C:/Program Files/Microchip/MPLABX/v5.45/packs/Microchip/PIC16Fxxx_DFP/1.2.33/xc8" -fno-short-double -fno-short-float -O0 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/Main.p1 Main.c ::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries In file included from Main.c:10: ./delays.h:32:18: error: invalid storage class specifier in function declarator void Delay10TCYx(PARAM_SCLASS unsigned char); ^ ./delays.h:21:22: note: expanded from macro 'PARAM_SCLASS' #define PARAM_SCLASS auto ^ ./delays.h:39:19: error: invalid storage class specifier in function declarator void Delay100TCYx(PARAM_SCLASS unsigned char); ^ ./delays.h:21:22: note: expanded from macro 'PARAM_SCLASS' #define PARAM_SCLASS auto ^ ./delays.h:46:18: error: invalid storage class specifier in function declarator void Delay1KTCYx(PARAM_SCLASS unsigned char); ^ ./delays.h:21:22: note: expanded from macro 'PARAM_SCLASS' #define PARAM_SCLASS auto ^ ./delays.h:53:19: error: invalid storage class specifier in function declarator void Delay10KTCYx(PARAM_SCLASS unsigned char); ^ ./delays.h:21:22: note: expanded from macro 'PARAM_SCLASS' #define PARAM_SCLASS auto ^ Main.c:18:5: error: use of undeclared identifier 'trisb' trisb=0x00; ^ Main.c:19:5: error: use of undeclared identifier 'portb' portb=0x00; ^ Main.c:23:13: error: use of undeclared identifier 'portb' portb=T[i]; ^ Main.c:24:13: warning: implicit declaration of function 'delay_ms' is invalid in C99 [-Wimplicit-function-declaration] delay_ms(1000); ^ 1 warning and 7 errors generated. (908) exit status = 1 nbproject/Makefile-default.mk:107: recipe for target 'build/default/production/Main.p1' failed make[2]: Leaving directory 'D:/ELECTRONIC/PROJETS/segment_1.X' nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed make[1]: Leaving directory 'D:/ELECTRONIC/PROJETS/segment_1.X' nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed make[2]: *** [build/default/production/Main.p1] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 458ms)
-----