eray81
Junior Member level 3
I wrote a function below. it must check out the incoming data from uart then it must complete himself and go back to main routine. But it doesnt. Please help.
Code:
void incoming1(void){
if(getc()==id1){
goto s1;}
s1:
while(true){
if(kbhit()){
if(getc()==id2){
goto s2;}}}
s2:
while(true){
if(kbhit()){
if(getc()==id3){
goto s3;}}}
s3:
while(true){
if(kbhit()){
if(getc()==id4){
goto s4;}}}
s4:
while(true){
if(kbhit()){
if(getc()==0x55){
if(f==1){ output_high(pin_a6);output_low(pin_a7); goto s5;}
if(f==2){ output_low(pin_a6);output_high(pin_a7);goto s5;}
}
if(getc()==0x45){ output_low(pin_a6);output_low(pin_a7);goto s5;}
}
}
s5:
delay_ms(1);
}