I received my chipKit Uno32 today and I wanted to program it with MPLab X. My code is fairly simple and just toggles a Pin (one with an LED...). When compiling, it gives me these errors though:
main.c: In function 'main':
main.c:9:5: error: '__PORTFbits_t' has no member named 'RF0'
main.c:13:13: warning: implicit declaration of function 'asm'
main.c:15:9: error: '__PORTFbits_t' has no member named 'RF0'
main.c:20:9: error: '__PORTFbits_t' has no member named 'RF0'
make[2]: *** [build/default/production/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 532ms)
plib.h is included and I enabled c99. When disabling c99, it compiles properly! Any ideas? I'd really like to use c99 since it features quite a ton of stuff I regularly use...
Code:
int main(int argc, char** argv) {
mPORTFSetPinsDigitalOut(PORTFbits.RF0);
while(1){
for(int i = 0; i < 80000000; i++){
asm("nop");
}
mPORTFSetBits(PORTFbits.RF0);
for(int i = 0; i < 80000000; i++){
asm("nop");
}
mPORTFClearBits(PORTFbits.RF0);
}
return (EXIT_SUCCESS);
}