Skip to content

Commit

Permalink
Add previous() to GPS_Signal::G1/G2
Browse files Browse the repository at this point in the history
  • Loading branch information
fenrir-naru committed Oct 15, 2024
1 parent 6075e8d commit 1589e6b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tool/navigation/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ class GPS_Signal {
PRN::content <<= 1;
PRN::content[0] = tmp;
}
void previous(){
bool tmp(PRN::content[3] ^ PRN::content[0]);
PRN::content >>= 1;
PRN::content[9] = tmp;
}
};

class G2 : public PRN {
Expand All @@ -114,6 +119,16 @@ class GPS_Signal {
PRN::content <<= 1;
PRN::content[0] = tmp;
}
void previous(){
bool tmp(PRN::content[2]
^ PRN::content[3]
^ PRN::content[6]
^ PRN::content[8]
^ PRN::content[9]
^ PRN::content[0]);
PRN::content >>= 1;
PRN::content[9] = tmp;
}
static G2 get_G2(const int &prn){
switch(prn){
case 1: return G2(1, 5);
Expand Down Expand Up @@ -177,6 +192,10 @@ class GPS_Signal {
g1.next();
g2.next();
}
void previous(){
g1.previous();
g2.previous();
}
};
};

Expand Down

0 comments on commit 1589e6b

Please sign in to comment.