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

Commit cfda86a

Browse files
committed
Refact _resetReceiver based on softwareReset technique
1 parent 6a9665f commit cfda86a

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
@@ -1123,12 +1123,10 @@ namespace DW1000Ng {
11231123
}
11241124

11251125
void _resetReceiver() {
1126-
byte pmscctrl0[LEN_PMSC_CTRL0];
1127-
_readBytes(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
1128-
pmscctrl0[3] = 0xE0;
1129-
_writeBytesToRegister(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
1130-
pmscctrl0[3] = 0xF0;
1131-
_writeBytesToRegister(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
1126+
/* Set to 0 only bit 28 */
1127+
_writeToRegister(PMSC, PMSC_SOFTRESET_SUB, 0xE0, LEN_PMSC_SOFTRESET);
1128+
/* Set SOFTRESET to all ones */
1129+
_writeToRegister(PMSC, PMSC_SOFTRESET_SUB, 0xF0, LEN_PMSC_SOFTRESET);
11321130
}
11331131

11341132
/* Internal helpers to read configuration */

0 commit comments

Comments
 (0)