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

Commit 24ec6d7

Browse files
authored
Merge pull request #133 from F-Army/resetReceiver-refact
Refact _resetReceiver() based on softwareReset technique
2 parents 0a7d32c + dada9f8 commit 24ec6d7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/DW1000Ng.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -1143,12 +1143,10 @@ namespace DW1000Ng {
11431143
}
11441144

11451145
void _resetReceiver() {
1146-
byte pmscctrl0[LEN_PMSC_CTRL0];
1147-
_readBytes(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
1148-
pmscctrl0[3] = 0xE0;
1149-
_writeBytesToRegister(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
1150-
pmscctrl0[3] = 0xF0;
1151-
_writeBytesToRegister(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
1146+
/* Set to 0 only bit 28 */
1147+
_writeToRegister(PMSC, PMSC_SOFTRESET_SUB, 0xE0, LEN_PMSC_SOFTRESET);
1148+
/* Set SOFTRESET to all ones */
1149+
_writeToRegister(PMSC, PMSC_SOFTRESET_SUB, 0xF0, LEN_PMSC_SOFTRESET);
11521150
}
11531151

11541152
/* Internal helpers to read configuration */

0 commit comments

Comments
 (0)