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

 
 
> Проблема с компилятором MPLAB-C30, Функции Putchar и Printf
Froze
сообщение Sep 12 2007, 11:44
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 15
Регистрация: 5-09-07
Пользователь №: 30 303



Пытаюсь скомпилировать программу для PIC24, в которой описана функция putchar,
...
void putchar(unsigned char q)
{
i2c_start(); i2c_write(LCD_ADDR);
i2c_write(CON1); i2c_write(0x01);
i2c_write(CON1); i2c_write(0x40 + f1);
i2c_write(CON1); i2c_write(0x80 + f);
i2c_write(CON2);
for(ii=0; ii<6; ii++) {i2c_write(symgen[q][ii]);}
i2c_write(0);
i2c_stop();
f += 6;
if (f >= 120) {f = 0; f1++;}
}
...

в ответ компилятор начинает выдавать кучу варнингов и ошибок касательно этой функции
вот:
P24.c:391: error: syntax error before '->' token
P24.c:393: error: syntax error before '(' token
P24.c:394: error: syntax error before '(' token
P24.c:394: error: syntax error before numeric constant
P24.c:394: warning: type defaults to 'int' in declaration of 'i2c_write'
P24.c:394: error: conflicting types for 'i2c_write'
P24.c:287: error: previous definition of 'i2c_write' was here
P24.c:394: warning: data definition has no type or storage class
P24.c:395: error: syntax error before '(' token
P24.c:395: error: syntax error before numeric constant
P24.c:395: warning: type defaults to 'int' in declaration of 'i2c_write'
P24.c:395: error: conflicting types for 'i2c_write'
P24.c:287: error: previous definition of 'i2c_write' was here
P24.c:395: warning: data definition has no type or storage class
P24.c:396: error: syntax error before '(' token
P24.c:396: error: syntax error before numeric constant
P24.c:396: warning: type defaults to 'int' in declaration of 'i2c_write'
P24.c:396: error: conflicting types for 'i2c_write'
P24.c:287: error: previous definition of 'i2c_write' was here
P24.c:396: warning: data definition has no type or storage class
P24.c:397: error: syntax error before '(' token
P24.c:399: error: syntax error before numeric constant
P24.c:399: warning: type defaults to 'int' in declaration of 'i2c_write'
P24.c:399: error: conflicting types for 'i2c_write'
P24.c:287: error: previous definition of 'i2c_write' was here
P24.c:399: warning: data definition has no type or storage class
P24.c:400: warning: type defaults to 'int' in declaration of 'i2c_stop'
P24.c:400: error: conflicting types for 'i2c_stop'
P24.c:285: error: previous definition of 'i2c_stop' was here
P24.c:400: warning: data definition has no type or storage class
P24.c:401: error: syntax error before '+=' token


Кто с этим знаком, обьясните пожалуйста в чем тут дело.
з.ы. такая проблема появилась только когда я начал работать с С30, а в С18 такого не было
Go to the top of the page
 
+Quote Post



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

 


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


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