From 4914da575de90a8e575e07f4ccf302e93e0d34e0 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Mon, 9 Oct 2023 13:16:06 +0200 Subject: [PATCH] [nrf noup] [nrfconnect] Align nrf_power calls to new scheme Now the API to manage GPREGRET register is unified for all devices having one or more GPREGRET entries. Signed-off-by: Nikodem Kastelik --- src/platform/nrfconnect/Reboot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/nrfconnect/Reboot.cpp b/src/platform/nrfconnect/Reboot.cpp index 439adebddc..6d52facf74 100644 --- a/src/platform/nrfconnect/Reboot.cpp +++ b/src/platform/nrfconnect/Reboot.cpp @@ -42,7 +42,7 @@ SoftwareRebootReason GetSoftwareRebootReason() #else -using RetainedReason = decltype(nrf_power_gpregret_get(NRF_POWER)); +using RetainedReason = decltype(nrf_power_gpregret_get(NRF_POWER, 0)); constexpr RetainedReason EncodeReason(SoftwareRebootReason reason) { @@ -56,17 +56,17 @@ void Reboot(SoftwareRebootReason reason) { const RetainedReason retainedReason = EncodeReason(reason); - nrf_power_gpregret_set(NRF_POWER, retainedReason); + nrf_power_gpregret_set(NRF_POWER, 0, retainedReason); sys_reboot(retainedReason); } SoftwareRebootReason GetSoftwareRebootReason() { - switch (nrf_power_gpregret_get(NRF_POWER)) + switch (nrf_power_gpregret_get(NRF_POWER, 0)) { case EncodeReason(SoftwareRebootReason::kSoftwareUpdate): - nrf_power_gpregret_set(NRF_POWER, 0); + nrf_power_gpregret_set(NRF_POWER, 0, 0); return SoftwareRebootReason::kSoftwareUpdate; default: return SoftwareRebootReason::kOther;