From 33cba3e61457b369026471d555342515a4cb6d8a Mon Sep 17 00:00:00 2001 From: Kristoffer Richardsson Date: Thu, 30 Nov 2017 13:38:03 +0100 Subject: [PATCH] #251 Minor corrections --- src/deck/drivers/src/lpsTdoaTag.c | 6 +++--- test/deck/drivers/src/TestLpsTdoaTag.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/deck/drivers/src/lpsTdoaTag.c b/src/deck/drivers/src/lpsTdoaTag.c index 685cad3fd4..df18b4204b 100644 --- a/src/deck/drivers/src/lpsTdoaTag.c +++ b/src/deck/drivers/src/lpsTdoaTag.c @@ -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; @@ -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); } } diff --git a/test/deck/drivers/src/TestLpsTdoaTag.c b/test/deck/drivers/src/TestLpsTdoaTag.c index 4df7d7b47c..0b95349d13 100644 --- a/test/deck/drivers/src/TestLpsTdoaTag.c +++ b/test/deck/drivers/src/TestLpsTdoaTag.c @@ -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