http://www.ars.yet.ru/union/mk/mk06.html
Код
int main(void)
{
sbi (DDRD ,PD5);
while (1) {
cbi (PORTD,PD5);
delay_ms(500);
sbi (PORTD,PD5);
delay_ms(500);
}
}
{
sbi (DDRD ,PD5);
while (1) {
cbi (PORTD,PD5);
delay_ms(500);
sbi (PORTD,PD5);
delay_ms(500);
}
}
Но при компиляции возникает ошибка , что делаю не правильно?
Версия WinAVR - 20050214
Compiling: test.c
avr-gcc -c -mmcu=at90s4433 -I. -gstabs -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test.lst -std=gnu99 -MD -MP -MF .dep/test.o.d test.c -o test.o
test.c: In function `main':
test.c:31: warning: implicit declaration of function `sbi'
test.c:33: warning: implicit declaration of function `cbi'
test.c:38:5: warning: no newline at end of file
Linking: test.elf
avr-gcc -mmcu=at90s4433 -I. -gstabs -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test.o -std=gnu99 -MD -MP -MF .dep/test.elf.d test.o --output test.elf -Wl,-Map=test.map,--cref -lm
test.o(.text+0x2e): In function `main':
test.c:31: undefined reference to `sbi'
test.o(.text+0x38):test.c:33: undefined reference to `cbi'
test.o(.text+0x48):test.c:35: undefined reference to `sbi'
make: *** [test.elf] Error 1