From 571316a4eaae23af4818d616d6f792317c9d4644 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 2 Aug 2021 11:56:47 -0600 Subject: [PATCH] kbled: Use u8 for array access The index will never be negative and will never exceed 255. Change them from i16 to u8 so SDCC will generate more efficient code. Signed-off-by: Tim Crawford --- src/board/system76/common/kbled.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/board/system76/common/kbled.c b/src/board/system76/common/kbled.c index 4328542..874f3fa 100644 --- a/src/board/system76/common/kbled.c +++ b/src/board/system76/common/kbled.c @@ -3,7 +3,7 @@ #include #include -static int16_t LEVEL_I = 1; +static uint8_t LEVEL_I = 1; static const uint8_t __code LEVELS[] = { 48, 72, @@ -13,7 +13,7 @@ static const uint8_t __code LEVELS[] = { 255 }; -static int16_t COLOR_I = 0; +static uint8_t COLOR_I = 0; static const uint32_t __code COLORS[] = { 0xFFFFFF, 0x0000FF,