From cfda86a6b39ddeae24bdbce247896e4f7831f0d7 Mon Sep 17 00:00:00 2001 From: Andrea Sonic0 Salvatori Date: Thu, 1 Nov 2018 14:03:27 +0100 Subject: [PATCH] Refact _resetReceiver based on softwareReset technique --- src/DW1000Ng.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/DW1000Ng.cpp b/src/DW1000Ng.cpp index fa4711ee..0f430041 100644 --- a/src/DW1000Ng.cpp +++ b/src/DW1000Ng.cpp @@ -1123,12 +1123,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 */