hej, moze ktos z was wie dlaczego sa takie błędy podczas kompilacji programu napisanego w C do ATmega32 (kompilator jest skonfigurowany - inne progzy kompiluje):
=============================================
#include <io.h>
#include <stdlib.h>
#define lcd_r, 0;
#define lcd_e, 1;
//funkcja opoznienia=============================
void czekaj (unsigned long pt)
{
unsigned char tpl;
for(;pt>0;pt--)
{
for(tpl=255;tpl!=0;tpl--);
}
}
//program główny=================================
// BIT_0 - RS
// BIT_1 - E
int main(void)
{
int i;
DDRB=0xFF;
for(i=3; i!=0; i--)
{
cbi(PORTB, lcd_e);
PORTB=(PORTB&0x0f)|0x30;
czekaj(1000);
sbi(PORTB, lcd_r);
}
}
oto co wyrzuca kompilator:
Compiling: poul.c
avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -DF_CPU=800000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=poul.lst -std=gnu99 -MD -MP -MF .dep/poul.o.d poul.c -o poul.o
poul.c:4:15: warning: ISO C requires whitespace after the macro name
poul.c:5:15: warning: ISO C requires whitespace after the macro name
poul.c: In function `main':
poul.c:26: warning: implicit declaration of function `cbi'
poul.c:26: error: syntax error before ',' token
poul.c:29: warning: implicit declaration of function `sbi'
poul.c:29: error: syntax error before ',' token
make: *** [poul.o] Error 1
Build failed with 2 errors and 4 warnings...
mi opadły juz rece...
=============================================
#include <io.h>
#include <stdlib.h>
#define lcd_r, 0;
#define lcd_e, 1;
//funkcja opoznienia=============================
void czekaj (unsigned long pt)
{
unsigned char tpl;
for(;pt>0;pt--)
{
for(tpl=255;tpl!=0;tpl--);
}
}
//program główny=================================
// BIT_0 - RS
// BIT_1 - E
int main(void)
{
int i;
DDRB=0xFF;
for(i=3; i!=0; i--)
{
cbi(PORTB, lcd_e);
PORTB=(PORTB&0x0f)|0x30;
czekaj(1000);
sbi(PORTB, lcd_r);
}
}
oto co wyrzuca kompilator:
Compiling: poul.c
avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -DF_CPU=800000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=poul.lst -std=gnu99 -MD -MP -MF .dep/poul.o.d poul.c -o poul.o
poul.c:4:15: warning: ISO C requires whitespace after the macro name
poul.c:5:15: warning: ISO C requires whitespace after the macro name
poul.c: In function `main':
poul.c:26: warning: implicit declaration of function `cbi'
poul.c:26: error: syntax error before ',' token
poul.c:29: warning: implicit declaration of function `sbi'
poul.c:29: error: syntax error before ',' token
make: *** [poul.o] Error 1
Build failed with 2 errors and 4 warnings...
mi opadły juz rece...