реклама на сайте
подробности

 
 
> WinAvr бит установить?, Сбросить/установить бит.
UserM
сообщение May 7 2005, 20:56
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 49
Регистрация: 26-02-05
Пользователь №: 2 909



Подскажите плз. Что делаю не правильно. Взял пример кода здесь:
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);  
          }
  }

Но при компиляции возникает ошибка , что делаю не правильно?
Версия 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
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 18th July 2025 - 20:06
Рейтинг@Mail.ru


Страница сгенерированна за 0.01369 секунд с 7
ELECTRONIX ©2004-2016