刚接触xc8,以前一直汇编,入门问题多多,大侠们不要笑话。
话说一直以来 #define led portc,4用的溜溜的,现在C上不会了啊
#define offca LATDbits.LATD0;
while(1)
{
LATD=offco;
LATBbits.LATB0=1;
offca=1;
}
编译
清除已成功 (总时间: 17ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'D:/microchip/CTEST'
make -f nbproject/Makefile-default.mk dist/default/production/CTEST.production.hex
make[2]: Entering directory 'D:/microchip/CTEST'
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=18LF45K22 -c -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o build/default/production/mainC.p1 mainC.c
mainC.c:94:6: error: expected expression
offca=1;
^
1 error generated.
(908) exit status = 1
nbproject/Makefile-default.mk:106: recipe for target 'build/default/production/mainC.p1' failed
make[2]: Leaving directory 'D:/microchip/CTEST'
nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/microchip/CTEST'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [build/default/production/mainC.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
我想用个代号表示某个管脚该怎样啊,同志们
|