Szanowni Koledzy
Postanowiłem zbudować licznik częstotliwości ze strony.
O ile ze zrozumieniem schematu nie maiłem żadnego problemu o tyle mam problem z kompilacją programu do procesora. WinAVR wywala niesamowitą ilość błędów. Plik Counter.c pobrałem ze strony projektu.
Czy ktoś mógłby mi pomóc w kompilacji tego programu?
W załącznikach plik Counter.c i Make.
Przeczytałem kursy kompilacji w C lecz samego C niestety jeszcze nie znam (do tej pory bawię się Bascom'em...)
Będę wdzięczny za pomoc
Poniżej log z WinAVR
Proszę, zgodnie z regulaminem pkt 11.1, o usunięcie słów PROBLEM lub/i POMOC z tytułu. Prośba dotyczy także wszelkich wariacji typu: kłopot, pomocy, problemy itd.
Postanowiłem zbudować licznik częstotliwości ze strony.
O ile ze zrozumieniem schematu nie maiłem żadnego problemu o tyle mam problem z kompilacją programu do procesora. WinAVR wywala niesamowitą ilość błędów. Plik Counter.c pobrałem ze strony projektu.
Czy ktoś mógłby mi pomóc w kompilacji tego programu?
W załącznikach plik Counter.c i Make.
Przeczytałem kursy kompilacji w C lecz samego C niestety jeszcze nie znam (do tej pory bawię się Bascom'em...)
Będę wdzięczny za pomoc
Poniżej log z WinAVR
>
"make.exe" all
-------- begin --------
avr-gcc (GCC) 4.1.2 (WinAVR 20070525)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling C: counter.c
avr-gcc -c -mmcu=attiny2313 -I. -gdwarf-2 -DF_CPU=4000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./counter.lst -std=gnu99 -MMD -MP -MF .dep/counter.o.d counter.c -o counter.o
counter.c:45:16: warning: io.h: No such file or directory
counter.c:46:20: warning: signal.h: No such file or directory
counter.c:47:23: warning: interrupt.h: No such file or directory
counter.c:70:1: warning: "F_CPU" redefined
<command line>:1:1: warning: this is the location of the previous definition
counter.c:121: warning: return type defaults to 'int'
counter.c:121: warning: function declaration isn't a prototype
counter.c: In function 'SIGNAL':
counter.c:121: warning: type of 'SIG_OVERFLOW0' defaults to 'int'
counter.c:125: warning: implicit declaration of function 'outp'
counter.c:125: error: 'TCNT0' undeclared (first use in this function)
counter.c:125: error: (Each undeclared identifier is reported only once
counter.c:125: error: for each function it appears in.)
counter.c:128: warning: implicit declaration of function 'inp'
counter.c:128: error: 'PORTB' undeclared (first use in this function)
counter.c:149: error: 'PORTD' undeclared (first use in this function)
counter.c: In function 'read_counters':
counter.c:186: warning: implicit declaration of function 'cli'
counter.c:189: error: 'PORTB' undeclared (first use in this function)
counter.c:192: error: 'DDRB' undeclared (first use in this function)
counter.c:195: error: 'DDRD' undeclared (first use in this function)
counter.c:199: warning: implicit declaration of function 'cbi'
counter.c:199: error: 'PORTD' undeclared (first use in this function)
counter.c:199: error: 'PD5' undeclared (first use in this function)
counter.c:201: warning: implicit declaration of function 'sbi'
counter.c:207: error: 'PINB' undeclared (first use in this function)
counter.c:209: error: 'PIND' undeclared (first use in this function)
counter.c:218: error: 'PD4' undeclared (first use in this function)
counter.c:240: warning: implicit declaration of function 'sei'
counter.c: In function 'capture':
counter.c:251: error: 'PORTD' undeclared (first use in this function)
counter.c:251: error: 'PD6' undeclared (first use in this function)
counter.c:255: error: 'TCNT1H' undeclared (first use in this function)
counter.c:256: error: 'TCNT1L' undeclared (first use in this function)
counter.c:258: error: 'OCR1H' undeclared (first use in this function)
counter.c:259: error: 'OCR1L' undeclared (first use in this function)
counter.c:261: error: 'TCCR1A' undeclared (first use in this function)
counter.c:263: error: 'TIFR' undeclared (first use in this function)
counter.c:263: error: 'OCF1A' undeclared (first use in this function)
counter.c:266: error: 'TCCR1B' undeclared (first use in this function)
counter.c:270: warning: implicit declaration of function 'BV'
counter.c: In function 'main':
counter.c:297: error: 'DDRB' undeclared (first use in this function)
counter.c:300: error: 'PORTB' undeclared (first use in this function)
counter.c:304: error: 'DDRD' undeclared (first use in this function)
counter.c:307: error: 'PORTD' undeclared (first use in this function)
counter.c:312: error: 'TCCR0' undeclared (first use in this function)
counter.c:316: error: 'TIMSK' undeclared (first use in this function)
counter.c:316: error: 'TOIE0' undeclared (first use in this function)
counter.c:344: error: 'TCNT1H' undeclared (first use in this function)
counter.c:345: error: 'TCNT1L' undeclared (first use in this function)
counter.c:347: error: 'OCR1H' undeclared (first use in this function)
counter.c:348: error: 'OCR1L' undeclared (first use in this function)
counter.c:350: error: 'TCCR1A' undeclared (first use in this function)
counter.c:353: error: 'TCCR1B' undeclared (first use in this function)
counter.c:354: error: 'TIFR' undeclared (first use in this function)
counter.c:354: error: 'OCF1A' undeclared (first use in this function)
make.exe: *** [counter.o] Error 1
> Process Exit Code: 2
> Time Taken: 00:01Proszę, zgodnie z regulaminem pkt 11.1, o usunięcie słów PROBLEM lub/i POMOC z tytułu. Prośba dotyczy także wszelkich wariacji typu: kłopot, pomocy, problemy itd.