dsPIC を使用して C で少しプログラミングを行っていますが、理由や方法がわからない小さな問題を見つけました。MPLAB 用コンパイラ C30
私はこのコードを持っています:
int Function1(){
.
.
.
while(1){
.
.
.
P1 = EPC96_1[18]; //Here the value of P1 = 0xB6
P2 = EPC96_1[19];
CRC_CCITT(EPC96_2, 18); //in this function CRC_1 is calculated also CRC2
if(P1 != CRC_1){ //In the calculation of CRC_1 it comes always 0xB6
P1++; //Both values P1 and CRC1 are the same, stil it
if(P2 != CRC_2) //comes here and continues with the break
break;
}
}
return 1;
}
//end of my function, return to main code
----申し訳ありませんが、指定しませんでした。ifに入らないと仮定!=
します。プログラムに実行させたいのは、両方の変数が等しい場合、while(1)
最初に戻る必要があるためです。 .----
MPLAB (8.92) の Watch で変数を調べましたが、それらは同じです。問題がコードの前後または他の場所にあるとは思いませんが、間違っている可能性があります。体験中に同じ問題を見つけた人はいますか?
お時間をいただきありがとうございます。