Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #133 from F-Army/resetReceiver-refact
Browse files Browse the repository at this point in the history
Refact _resetReceiver() based on softwareReset technique
  • Loading branch information
Anacron-sec authored Dec 8, 2018
2 parents 0a7d32c + dada9f8 commit 24ec6d7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/DW1000Ng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,12 +1143,10 @@ namespace DW1000Ng {
}

void _resetReceiver() {
byte pmscctrl0[LEN_PMSC_CTRL0];
_readBytes(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
pmscctrl0[3] = 0xE0;
_writeBytesToRegister(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
pmscctrl0[3] = 0xF0;
_writeBytesToRegister(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
/* Set to 0 only bit 28 */
_writeToRegister(PMSC, PMSC_SOFTRESET_SUB, 0xE0, LEN_PMSC_SOFTRESET);
/* Set SOFTRESET to all ones */
_writeToRegister(PMSC, PMSC_SOFTRESET_SUB, 0xF0, LEN_PMSC_SOFTRESET);
}

/* Internal helpers to read configuration */
Expand Down

0 comments on commit 24ec6d7

Please sign in to comment.