Witam. Próbuje podpiąć do mojej atmegi klawiaturę, wykorzystując protokół ps2 - kod zaczerpnięty ze strony
http://radzio.dxp.pl/pckeyboard/
lecz wyskakuje mi błąd kompilacji i nie wiem dlaczego pomocy!!
błąd:
Jak mogę to naprawić??
Poprawiłem tytuł i treść wiadomości - regulamin p.11,15.
[zumek]
http://radzio.dxp.pl/pckeyboard/
lecz wyskakuje mi błąd kompilacji i nie wiem dlaczego pomocy!!
{
switch(i)
{
case 0 :
dane = 0;
i++;
break;
case 1 :
if(ATKbdGetDta()) dane |= 0x01;
i++;
break;
case 2 :
if(ATKbdGetDta()) dane |= 0x02;
i++;
break;
case 3 :
if(ATKbdGetDta()) dane |= 0x04;
i++;
break;
case 4 :
if(ATKbdGetDta()) dane |= 0x08;
i++;
break;
case 5 :
if(ATKbdGetDta()) dane |= 0x10;
i++;
break;
case 6 :
if(ATKbdGetDta()) dane |= 0x20;
i++;
break;
case 7 :
if(ATKbdGetDta()) dane |= 0x40;
i++;
break;
case 8 :
if(ATKbdGetDta()) dane |= 0x80;
i++;
break;
case 9 :
i++;
break;
case 10 :
nowy = 1;
i = 0;
break;
}
}błąd:
> "make.exe" all
avr-gcc -g -Wall -O2 -mmcu=atmega8 -c -o atkeyboard.o atkeyboard.c
atkeyboard.c:13: warning: return type defaults to `int'
atkeyboard.c: In function `ISR':
atkeyboard.c:60: warning: control reaches end of non-void function
avr-gcc -g -Wall -O2 -mmcu=atmega8 -Wl,-Map,atkeyboard.map -o atkeyboard.elf atkeyboard.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.1/../../../../avr/lib/avr4/crtm8.o(.init9+0x0): undefined reference to `main'
make.exe: *** [atkeyboard.elf] Error 1
Jak mogę to naprawić??
Poprawiłem tytuł i treść wiadomości - regulamin p.11,15.
[zumek]