From cae283dc8678789ae70b11fdab7ee9fca19964c8 Mon Sep 17 00:00:00 2001 From: anatoly-savchenkov <48646998+anatoly-savchenkov@users.noreply.github.com> Date: Sun, 28 Nov 2021 22:31:15 +0300 Subject: [PATCH] Fixed data type inside fast_random_8() routine (#2818) --- esphome/core/helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/core/helpers.cpp b/esphome/core/helpers.cpp index 60849fcae7..6678eddbff 100644 --- a/esphome/core/helpers.cpp +++ b/esphome/core/helpers.cpp @@ -98,7 +98,7 @@ uint16_t fast_random_16() { return (rand32 & 0xFFFF) + (rand32 >> 16); } uint8_t fast_random_8() { - uint8_t rand32 = fast_random_32(); + uint32_t rand32 = fast_random_32(); return (rand32 & 0xFF) + ((rand32 >> 8) & 0xFF); }