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 <tcrawford@system76.com>
This commit is contained in:
committed by
Jeremy Soller
parent
f27d6350f2
commit
571316a4ea
@ -3,7 +3,7 @@
|
||||
#include <board/kbled.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
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,
|
||||
|
Reference in New Issue
Block a user