Skip to content

Commit

Permalink
zigbee: osif: zb_nrf_platform: align nrf_power calls to new scheme
Browse files Browse the repository at this point in the history
Now the API to manage GPREGRET register is unified for all devices
having one or more GPREGRET entries.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
  • Loading branch information
nika-nordic authored and nordicjm committed Oct 27, 2023
1 parent 20e7042 commit e31705b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subsys/zigbee/osif/zb_nrf_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ void zb_reset(zb_uint8_t param)
* Do it manually in this case - NCP samples require this.
*/
#ifdef CONFIG_SOC_NRF5340_CPUAPP
nrf_power_gpregret_set(NRF_POWER, reas);
nrf_power_gpregret_set(NRF_POWER, 0, reas);
#endif /* CONFIG_SOC_NRF5340_CPUAPP */

/* Power on unused sections of RAM to allow MCUboot to use it. */
Expand Down Expand Up @@ -685,7 +685,7 @@ zb_uint8_t zb_get_reset_source(void)

/* Read the value at the first API call, then use data from RAM. */
if (zephyr_reset_type == 0xFF) {
zephyr_reset_type = nrf_power_gpregret_get(NRF_POWER);
zephyr_reset_type = nrf_power_gpregret_get(NRF_POWER, 0);
}
#endif /* CONFIG_ZIGBEE_LIBRARY_NCP_DEV */

Expand Down Expand Up @@ -730,7 +730,7 @@ zb_uint8_t zb_get_reset_source(void)
* SW reset, the value will not trigger NCP logic.
*/
if (zephyr_reset_type == SYS_REBOOT_NCP) {
nrf_power_gpregret_set(NRF_POWER, (uint8_t)SYS_REBOOT_COLD);
nrf_power_gpregret_set(NRF_POWER, 0, (uint8_t)SYS_REBOOT_COLD);
}
#endif /* CONFIG_ZIGBEE_LIBRARY_NCP_DEV */

Expand Down

0 comments on commit e31705b

Please sign in to comment.