mirror of
https://github.com/adafruit/Adafruit_ILI9341.git
synced 2026-10-26 22:10:38 +00:00
Fix computation in scrollMargin
as per issue #62 The function does not work as the computation of middle was incorrect. it either needed to be uint16_t middle = ILI9341_TFTHEIGHT - top - bottom; or what I prefer and did: uint16_t middle = ILI9341_TFTHEIGHT - (top + bottom);
This commit is contained in:
1 parent
8b01d82133
commit
d2694821a3
1 file changed
+1
-1
@@ -277,7 +277,7 @@ void Adafruit_ILI9341::scrollTo(uint16_t y) {
|
||||
void Adafruit_ILI9341::setScrollMargins(uint16_t top, uint16_t bottom) {
|
||||
// TFA+VSA+BFA must equal 320
|
||||
if (top + bottom <= ILI9341_TFTHEIGHT) {
|
||||
uint16_t middle = ILI9341_TFTHEIGHT - top + bottom;
|
||||
uint16_t middle = ILI9341_TFTHEIGHT - (top + bottom);
|
||||
uint8_t data[6];
|
||||
data[0] = top >> 8;
|
||||
data[1] = top & 0xff;
|
||||
|
||||
Reference in new issue
Block a user