Hallo
Beim Kompilieren des SD-Card-Beispiel habe ich einige Hürden zu überwinden. Gegen " 'for' loop initial declaration used outside C99 mode" hilft ein "-std=c99" in den Flags des Kompilers im Makefile. Das war noch einfach. Aber das verstehe ich nicht:
Beides bezieht sich auf die Datei RP6M256Lib.c:Code:avr-gcc -std=c99 -mmcu=atmega2560 -Os -mno-interrupts -funsigned-char -funsigned-bitfields -Wall -Wstrict-prototypes -ggdb -c -DF_CPU=16000000UL -Wa,-acdhlmns=RP6M256Lib.lst RP6M256Lib.c -o RP6M256Lib.o RP6M256Lib.c:547: warning: declaration does not declare anything RP6M256Lib.c: In function 'delayCycles': RP6M256Lib.c:650: error: 'asm' undeclared (first use in this function) RP6M256Lib.c:650: error: (Each undeclared identifier is reported only once RP6M256Lib.c:650: error: for each function it appears in.) RP6M256Lib.c:650: error: expected ';' before 'volatile' make: *** [RP6M256Lib.o] Error 1
Code:/*****************************************************************************/ // Delays, Stopwatches and Beeper: // --------------------- // Internal status bits volatile union { uint8_t byte; struct { unsigned beep:1; unsigned unused:7; }; <-- Zeile 547 } controlStatus;Das #define für nop() findet sich in RP6M256.h in Zeile 276:Code:/** * Delay a number of instruction cycles. * No exact delay function! And interrupts can still occur and * add a lot of extra cycles. * This function only guarantees to delay for a MINIMAL number * of cycles! * * Example: * delayCycles(1000); // Delays for *about* 1000 instruction cycles */ void delayCycles(volatile uint16_t dly) { //volatile uint16_t delay2 = dly; //while(delay2--) nop(); while(dly--) nop(); <-- Zeile 650 }
(Zeilenangaben jeweils aus der Library der Testmodule)Code:// Assembly and system macros: #define nop(); {asm volatile("nop\n\t");} <-- Zeile 276 #define bl_reset(); cli();bl_start();
Irgendwelche Ideen?
Gruß
mic







Zitieren

Lesezeichen