From 8a5fa89da6ea15557142439c621a08e7e932bca3 Mon Sep 17 00:00:00 2001
From: tkl
Date: Wed, 21 Sep 2016 14:08:22 +0000
Subject: [PATCH] error correction in system_state.c - close rng after usage
---
source/application/system_state.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/source/application/system_state.c b/source/application/system_state.c
index f5532ef..c26e733 100644
--- a/source/application/system_state.c
+++ b/source/application/system_state.c
@@ -160,6 +160,7 @@ static enum system_state handle_state_collision_turn(void)
drv_open(&rng);
// random number between 500 and 4000
unsigned int sleep = (unsigned int)drv_read(&rng, NULL, 0) % 3500 + 500;
+ drv_close(&rng);
system_state_object.collision_timer.tick = sys_tick_get_ms() + sleep;
system_state_object.collision_timer.running = true;
// randomize turn direction