abdi110
Member level 3
Hi,i am using ATmega8 for a project to send and receive sms by sim900.
i use codevision and RX interrupt to get the input characters using getchar function.
after building the project i receive this error:Syntax error, unexpected REGDEF
in wait loop i do my normal program in order that microcontroller do its functions normally.
Could anyone please help why am i getting this error and how can i solve this problem?
i use codevision and RX interrupt to get the input characters using getchar function.
Code:
char getchar(void)
{
char data;
while (rx_counter==0) [COLOR="#FF0000"]wait_loop();[/COLOR]
data=rx_buffer[rx_rd_index++];
#if RX_BUFFER_SIZE != 256
if (rx_rd_index == RX_BUFFER_SIZE) rx_rd_index=0;
#endif
#asm("cli")
--rx_counter;
#asm("sei")
return data;
}
.
.
.
void wait_loop() {
if(PINB.1==0){
if(PINB.0==0){
delay_ms(60000);
if(PINB.1==0){
if(PINB.0==0){
E1=1;
if(a1<3) {
a1++;
PORTC.3=0;
send(e1);
delay_ms(100);
PORTC.4=0;
delay_ms(2000);
PORTC.3=1;
PORTC.4=1;
delay_ms(20000);
};
};
};
};
}
else {
if(E1==1) {
E1=0;
a1=0;
send(e1ok);
PORTC.3=0;
delay_ms(2000);
PORTC.3=1;
delay_ms(20000);
};
};
}
in wait loop i do my normal program in order that microcontroller do its functions normally.
Could anyone please help why am i getting this error and how can i solve this problem?
Last edited by a moderator: