Hi, in this case the revmask is used as a switch to detect new devices which have revision and id in different locations instead of combined.
These devices are listed with revmask=0 in the array of all ids, so the code is correct, although it would be more readable using:
if((PIC16LIST[i].revmask>0)&&((id>>5)==PIC16LIST[i].id)){
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
Hope this is the correct forum for technical questions.
I am reviewing the code for Open Programmer. In line 217 of progP16.cpp there is the following statement:
if(PIC16LIST[i].revmask&&(id>>5)==PIC16LIST[i].id){
I think it seems like a bug that a logical and (&&) is done with a bitmask instead of a bitwise and (&). Is the code correct?
Hi, in this case the revmask is used as a switch to detect new devices which have revision and id in different locations instead of combined.
These devices are listed with revmask=0 in the array of all ids, so the code is correct, although it would be more readable using:
if((PIC16LIST[i].revmask>0)&&((id>>5)==PIC16LIST[i].id)){