1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

Fixed data type inside fast_random_8() routine (#2818)

This commit is contained in:
anatoly-savchenkov
2021-11-28 22:31:15 +03:00
committed by GitHub
parent 7afcb0fb04
commit cae283dc86

View File

@@ -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);
}