From 54538b42dde7ec4496cfd504ddea468263e0aa59 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 1 Feb 2017 22:55:49 +0100 Subject: [PATCH] Fix the cap computation Signed-off-by: Gergely Nagy --- src/Akela/Heatmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Akela/Heatmap.cpp b/src/Akela/Heatmap.cpp index a7ae9410..ecb04583 100644 --- a/src/Akela/Heatmap.cpp +++ b/src/Akela/Heatmap.cpp @@ -112,7 +112,7 @@ namespace Akela { loopCount = 0; for (uint8_t r = 0; r < ROWS; r++) { for (uint8_t c = 0; c < COLS; c++) { - uint8_t cap = totalKeys || 1; + uint8_t cap = max(totalKeys, 1); float v = float(heatmap[r][c]) / cap; LEDControl.led_set_crgb_at (r, c, computeColor (v)); }