C Code und If Abfrage

Support-Forum für Deutschsprachige, die in ihrer Muttersprache schreiben möchten.

Moderator: Benj

Post Reply
Jojo1981
Posts: 28
Joined: Wed Feb 29, 2012 9:23 pm
Been thanked: 3 times
Contact:

C Code und If Abfrage

Post by Jojo1981 »

Hallo,

auf dem C- Code bin ich nicht so ganz fit und bekomme immer eine Fehlermeldung:
Telemetrie_Sender_V1.c(3992): error: general error
Telemetrie_Sender_V1.c(3992): error: failure
Der entsprechende C- Code lautet:

Code: Select all

if(t5gcon,3=0);
 FCV_TIMER5_GATESTATUS=0;
 FCV_TIMER5_LOW=tmr5l;
 FCV_TIMER5_HIGH=tmr5h;
else;
 FCV_TIMER5_GATESTATUS=1;
Es wird die if- Abfrage sein mit der ich das Bit T5GGO/DONE abfragen möchte. Wer hat hier eine Lösung.

MfG

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: C Code und If Abfrage

Post by Benj »

Hallo,

Ich glaube, ich kann das Problem erkennen.

Versuchen Sie dies zu.

Code: Select all

if(test_bit(t5gcon,3) == 0)
{
  FCV_TIMER5_GATESTATUS=0;
  FCV_TIMER5_LOW=tmr5l;
  FCV_TIMER5_HIGH=tmr5h;
}
else
{
  FCV_TIMER5_GATESTATUS=1;
}



Hello,

I think I can spot the problem.

Try changing to this.

Code: Select all

if(test_bit(t5gcon,3) == 0)
{
  FCV_TIMER5_GATESTATUS=0;
  FCV_TIMER5_LOW=tmr5l;
  FCV_TIMER5_HIGH=tmr5h;
}
else
{
  FCV_TIMER5_GATESTATUS=1;
}

Jojo1981
Posts: 28
Joined: Wed Feb 29, 2012 9:23 pm
Been thanked: 3 times
Contact:

Re: C Code und If Abfrage

Post by Jojo1981 »

Es arbeitet perfekt, vielen Dank dafür. Es hat mir geholfen das C etwas besser zu verstehen.

Post Reply