Skip to content

Commit

Permalink
#251 Minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Nov 30, 2017
1 parent 7cf8ebe commit 33cba3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/deck/drivers/src/lpsTdoaTag.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ static bool calcDistanceDiff(float* tdoaDistDiff, const uint8_t previousAnchor,
return true;
}

static void addToLog(const uint8_t anchor, const float tdoaDistDiff, const rangePacket_t* packet) {
// Only store diffs for anchors with succeeding numbers. In case of packet
static void addToLog(const uint8_t anchor, const uint8_t previousAnchor, const float tdoaDistDiff, const rangePacket_t* packet) {
// Only store diffs for anchors with succeeding seq numbers. In case of packet
// loss we can get ranging between any anchors and that messes up the graphs.
if (((previousAnchor + 1) & 0x07) == anchor) {
uwbTdoaDistDiff[anchor] = tdoaDistDiff;
Expand Down Expand Up @@ -165,7 +165,7 @@ static void rxcallback(dwDevice_t *dev) {
float tdoaDistDiff = 0.0;
if (calcDistanceDiff(&tdoaDistDiff, previousAnchor, anchor, packet, &arrival)) {
enqueueTDOA(previousAnchor, anchor, tdoaDistDiff);
addToLog(anchor, tdoaDistDiff, packet);
addToLog(anchor, previousAnchor, tdoaDistDiff, packet);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/deck/drivers/src/TestLpsTdoaTag.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void testDifferenceOfDistanceWithTwoAnchors3FramesWithClockDrift3() {
// Nothing here, verification in mocks
}

void testMissingTimestamInhibitsClockDriftCalculationInFirstIteration() {
void testMissingTimestampInhibitsClockDriftCalculationInFirstIteration() {
// Fixture
// Two anchors, separated by 1.0m
// Distance from A0 to tag is 2.0m
Expand Down

0 comments on commit 33cba3e

Please sign in to comment.