Skip to content

Commit

Permalink
Merge pull request #24 from jpjporto/master
Browse files Browse the repository at this point in the history
Fixed number of bytes copied from A0 range packet
  • Loading branch information
ataffanel authored Feb 25, 2018
2 parents 37c150e + 6ed0433 commit d4116f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uwb_tdoa_anchor2.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static void handleRxPacket(dwDevice_t *dev)
if (ctx.slot == 0) {
// Resync local frame start to packet from anchor 0
dwTime_t pkTxTime = { .full = 0 };
memcpy(&pkTxTime, rangePacket->timestamps[ctx.slot], 5);
memcpy(&pkTxTime, rangePacket->timestamps[ctx.slot], TS_TX_SIZE);
ctx.tdmaFrameStart.full = rxTime.full - (pkTxTime.full - TDMA_LAST_FRAME(pkTxTime.full));

//TODO: Save relevant data to calculate masterTime
Expand Down Expand Up @@ -432,7 +432,7 @@ static uint32_t tdoa2UwbEvent(dwDevice_t *dev, uwbEvent_t event)

// Resync local frame start to packet from anchor 0
dwTime_t pkTxTime = { .full = 0 };
memcpy(&pkTxTime, rangePacket->timestamps[0], 5);
memcpy(&pkTxTime, rangePacket->timestamps[0], TS_TX_SIZE);
ctx.tdmaFrameStart.full = rxTime.full - (pkTxTime.full - TDMA_LAST_FRAME(pkTxTime.full));

ctx.tdmaFrameStart.full += TDMA_FRAME_LEN;
Expand Down

0 comments on commit d4116f0

Please sign in to comment.