OpenThread requires platform definition with standarized API so we have to add wrappers to make it compatible with Zephyr. OpenThread is based on autoconf, this requires more specific CMakeLists.txt which allows to clone specific commit or point to local copy of openthread. Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
28 lines
528 B
C
28 lines
528 B
C
/*
|
|
* Copyright (c) 2018 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <kernel.h>
|
|
#include <misc/reboot.h>
|
|
#include <openthread/types.h>
|
|
#include <openthread/platform/misc.h>
|
|
|
|
#include "platform-zephyr.h"
|
|
|
|
void otPlatReset(otInstance *aInstance)
|
|
{
|
|
ARG_UNUSED(aInstance);
|
|
|
|
/* This function does nothing on the Posix platform. */
|
|
sys_reboot(SYS_REBOOT_WARM);
|
|
}
|
|
|
|
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
|
{
|
|
ARG_UNUSED(aInstance);
|
|
|
|
return OT_PLAT_RESET_REASON_POWER_ON;
|
|
}
|