From e3c8ef4ab7399f4711b9c1c674eda11c6d3cdfe2 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Fri, 3 Apr 2026 15:24:02 -0400 Subject: [PATCH] Improve randomizer seeding --- src/c/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/c/main.c b/src/c/main.c index b1a970c..0db1bd1 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -378,7 +378,13 @@ static void bluetooth_callback(bool connected) { // set up the app on launch (don't put app logic in here); static void init() { // seed RNG - srand(time(NULL)); + uint16_t seed_ms; + time_t seed_time; + time_ms(&seed_time, &seed_ms); + srand((unsigned int)seed_time ^ seed_ms); + rand(); + rand(); + rand(); // throw away first few values to alleviate seed correlation // create main Window element and assign to pointer s_main_window = window_create();