From 9bf17aebf510bd69589fabea6dea485ca29abdc9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 30 Aug 2013 03:00:37 +0000 Subject: [PATCH] Reduce another int to uint8_t. --- lib/Charliplexing.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Charliplexing.cpp b/lib/Charliplexing.cpp index d4550e8..61fb566 100644 --- a/lib/Charliplexing.cpp +++ b/lib/Charliplexing.cpp @@ -360,11 +360,12 @@ void LedSign::Set(uint8_t x, uint8_t y, uint8_t c) c = SHADES-1; #endif - uint16_t mask = 1 << pgm_read_byte_near(&ledMap[x+y*DISPLAY_COLS].high); - uint8_t cycle = pgm_read_byte_near(&ledMap[x+y*DISPLAY_COLS].cycle); + const LEDPosition *map = &ledMap[x+y*DISPLAY_COLS]; + uint16_t mask = 1 << pgm_read_byte_near(&map->high); + uint8_t cycle = pgm_read_byte_near(&map->cycle); uint16_t *p = &workBuffer->pixels[cycle*(SHADES-1)]; - int i; + uint8_t i; for (i = 0; i < c; i++) *p++ |= mask; // ON; for (; i < SHADES-1; i++)