Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers random_stub.c Source File

random_stub.c

00001 /*
00002  * Copyright (c) 2016, ARM Limited, All Rights Reserved
00003  */
00004 
00005 #include "ns_types.h"
00006 
00007 static uint32_t seed_value = 4;
00008 static bool seed_inc = false;
00009 
00010 void arm_random_module_init(void)
00011 {
00012 
00013 }
00014 
00015 uint32_t arm_random_seed_get(void)
00016 {
00017     uint32_t result = seed_value;
00018     if (seed_inc) {
00019         ++seed_value;
00020     }
00021     return result;
00022 }
00023 
00024 void random_stub_set_seed(uint32_t value, bool increment)
00025 {
00026     seed_value = value;
00027     seed_inc = increment;
00028 }