Branch data Line data Source code
1 : : /** 2 : : * Copyright (c) 2019 Nordic Semiconductor ASA 3 : : * 4 : : * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause 5 : : */ 6 : : #include <kernel.h> 7 : : #include <sys/reboot.h> 8 : : //#include <logging/log.h> 9 : : //LOG_MODULE_DECLARE(nrf_cc3xx_platform); 10 : : 11 : : #include "nrf_cc3xx_platform_abort.h" 12 : : 13 : : 14 : : /** @brief Definition of abort function used for Zephyr 15 : : */ 16 : 0 : static void abort_function(char const * const reason) 17 : : { 18 : : //LOG_ERR("Reason: %s", reason); 19 : : #ifdef CONFIG_REBOOT 20 : : //LOG_ERR("Rebooting"); 21 : : sys_reboot(SYS_REBOOT_WARM); 22 : : #else 23 : : //LOG_ERR("Halted"); 24 : 0 : while(1); 25 : : #endif 26 : : } 27 : : 28 : : 29 : : /** @brief Definition of abort API to set in nrf_cc3xx_platform 30 : : */ 31 : : static const nrf_cc3xx_platform_abort_apis_t apis = 32 : : { 33 : : .abort_handle = NULL, 34 : : .abort_fn = abort_function, 35 : : }; 36 : : 37 : : /** @brief Function to initialize the nrf_cc3xx_platform abort APIs. 38 : : */ 39 : : void nrf_cc3xx_platform_abort_init(void) 40 : : { 41 : 1 : nrf_cc3xx_platform_set_abort(&apis); 42 : 1 : }