1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/openthread: bump version to 20191113

This commit is contained in:
Benjamin Valentin 2020-12-17 14:50:37 +01:00 committed by Benjamin Valentin
parent 672a9affc7
commit da7cbf3e4c
6 changed files with 10 additions and 42 deletions

View File

@ -1,6 +1,6 @@
PKG_NAME=openthread
PKG_URL=https://github.com/openthread/openthread.git
PKG_VERSION=thread-reference-20180926
PKG_VERSION=thread-reference-20191113
PKG_LICENSE=BSD-3-Clause
# OpenThread build system doesn't support (yet) out-of-source builds
@ -28,6 +28,7 @@ CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"platform_config.h\"'
OPENTHREAD_COMMON_FLAGS = -fdata-sections -ffunction-sections -Os
OPENTHREAD_COMMON_FLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter
OPENTHREAD_CXXFLAGS += -Wno-class-memaccess
OPENTHREAD_CXXFLAGS += -DOPENTHREAD_TARGET_RIOT=1
OT_LIB_DIR = $(PKG_BUILD_DIR)/output/lib
MODULE_LIBS = mbedcrypto.a openthread-$(TD).a

View File

@ -73,9 +73,6 @@ static char ot_thread_stack[2 * THREAD_STACKSIZE_MAIN];
void openthread_bootstrap(void)
{
/* init random */
ot_random_init();
/* setup netdev modules */
#ifdef MODULE_AT86RF2XX
at86rf2xx_setup(&at86rf2xx_dev, &at86rf2xx_params[0], 0);

View File

@ -16,46 +16,11 @@
* @}
*/
#include <stdint.h>
#include "openthread/platform/random.h"
#include "periph/cpuid.h"
#include "openthread/platform/entropy.h"
#include "random.h"
#define ENABLE_DEBUG 0
#include "debug.h"
/* init random */
void ot_random_init(void)
otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength)
{
#ifdef CPUID_LEN
char cpu_id[CPUID_LEN];
cpuid_get(cpu_id);
uint32_t seed = 0;
for (unsigned i = 0; i < CPUID_LEN; i++) {
seed += cpu_id[i];
}
random_init(seed);
#else
#error "CPU not supported (current CPU doesn't provide CPUID, required for entropy)"
#endif
}
/* OpenThread will call this to get a random number */
uint32_t otPlatRandomGet(void)
{
uint32_t rand_val = random_uint32();
DEBUG("otPlatRandomGet: %i\n", (int) rand_val);
return rand_val;
}
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
{
for (uint16_t index = 0; index < aOutputLength; index++) {
aOutput[index] = 0;
uint32_t rand_val = random_uint32();
aOutput[index] = (uint8_t) rand_val;
}
random_bytes(aOutput, aOutputLength);
return OT_ERROR_NONE;
}

View File

@ -101,3 +101,8 @@ otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
return OT_ERROR_NONE;
}
otError otPlatUartFlush(void)
{
return OT_ERROR_NONE;
}

Binary file not shown.