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

 
 
> Помогите откомпилировать пример в avr-gcc (GCC) 3.4.6.
ShuraM
сообщение Nov 14 2006, 11:05
Сообщение #1





Группа: Новичок
Сообщений: 14
Регистрация: 14-11-06
Пользователь №: 22 299



Прикрепленный файл  a16e2.zip ( 9.64 килобайт ) Кол-во скачиваний: 174
При попытке окомпилировать пример avr-gcc (GCC) 3.4.6 выдаёт кучу варнингов и ошибки, подкажите плз. как это исправить.

Версия WinAvr 20060421

Цитата
-------- begin --------
avr-gcc (GCC) 3.4.6
Copyright © 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: main.c
In file included from main.c:16:
symbol_tbl.h:5: warning: missing braces around initializer
symbol_tbl.h:5: warning: (near initialization for `symbol[0]')
main.c: In function `__vector_9':
main.c:132: warning: implicit declaration of function `sbi'
main.c: In function `spi_init':
main.c:184: warning: implicit declaration of function `cbi'
main.c: In function `adc_init':
main.c:201: error: `ADHSM' undeclared (first use in this function)
main.c:201: error: (Each undeclared identifier is reported only once
main.c:201: error: for each function it appears in.)
main.c: In function `main':
main.c:214: warning: passing arg 1 of `strcpy_P' discards qualifiers from pointer target type
main.c:215: warning: passing arg 1 of `strcpy_P' discards qualifiers from pointer target type
main.c:216: warning: passing arg 1 of `strcpy_P' discards qualifiers from pointer target type
main.c:217: warning: passing arg 1 of `strcpy_P' discards qualifiers from pointer target type
main.c:218: warning: passing arg 1 of `strcpy_P' discards qualifiers from pointer target type
main.c:233: warning: assignment discards qualifiers from pointer target type
main.c:242: warning: implicit declaration of function `PRG_RDB'
make: *** [main.o] Error 1
Build failed with 3 errors and 11 warnings...


В проиложении файл проекта.
Пример взят отсюда:
http://www.vga-avr.narod.ru/main_rus.html
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
Laksus
сообщение Nov 15 2006, 04:41
Сообщение #2


Частый гость
**

Группа: Участник
Сообщений: 146
Регистрация: 16-05-05
Пользователь №: 5 069



Посмотрите в своем файле ..\WinAVR\avr\include\avr\iom16.h
определение битов регистра SFIOR.

Если iom16.h очень древний (WinAVR20040404), то увидите:
/* SFIOR */
#define ADTS2 7
#define ADTS1 6
#define ADTS0 5
#define ADHSM 4
#define ACME 3
#define PUD 2
#define PSR2 1
#define PSR10 0

А если поновее:
/*
The ADHSM bit has been removed from all documentation,
as being not needed at all since the comparator has proven
to be fast enough even without feeding it more power.
*/
#define SFIOR _SFR_IO8(0x30)
#define PSR10 0
#define PSR2 1
#define PUD 2
#define ACME 3
#define ADTS0 5
#define ADTS1 6
#define ADTS2 7

То есть, насколько я понимаю, надо просто закомментировать строку:
// SFIOR = 1<<ADHSM;// High speed conversion mode
_______________
Александр
2006 11 15
Go to the top of the page
 
+Quote Post
ShuraM
сообщение Nov 16 2006, 18:18
Сообщение #3





Группа: Новичок
Сообщений: 14
Регистрация: 14-11-06
Пользователь №: 22 299



Спасибо, попробую. Подскажите плз. с чем связано предупреждение, компилятора.
Цитата
warning: passing arg 1 of `strcpy_P' discards qualifiers from pointer target type.
Go to the top of the page
 
+Quote Post



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

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 00:14
Рейтинг@Mail.ru


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