From 57f9cbed9d4782c3bd07c8b7a9f18c3f4322b2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Moskal?= Date: Wed, 1 Aug 2018 10:18:34 -0700 Subject: [PATCH] Initialize our random generator with codal's (#1021) --- libs/core/codal.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/core/codal.cpp b/libs/core/codal.cpp index 463bc864..d389c14e 100644 --- a/libs/core/codal.cpp +++ b/libs/core/codal.cpp @@ -25,7 +25,10 @@ namespace pxt { MicroBit uBit; MicroBitEvent lastEvent; -void platform_init() {} +void platform_init() { + microbit_seed_random(); + seedRandom(microbit_random(0x7fffffff)); +} void platform_init(); void usb_init();