Hi, I am new in C++ and my English not so good, so I apologize in advance. I am using your library for TFT 2.8" with HX8347G, 3.2" with ILI9327 and 3.5" with ILI9486 on Mega. First two have different pin configuration then last one, so I made correcion in your code (mcufriend_shield.h) to accept ports B, G and H instead of E, G and H (usiing #ifdef), to make all of them works. Next correction I made is modify readReg40 function so it returns only lower 16 bits, because readID function tests only 16 bits values. Now it recognise all my graphic controlers. Another correciton is in function fillRect. In my oppinion, there is small error when testing (w<0) and (h<0):

if (w < 0) {

w = -w;

x -= w - 1; // MN: old equation: x -= w;

}

and

if (h < 0) {

h = -h;

y -= h - 1; // MN: old equation: y -= h;

}

Without adding -1, for negative length, start and end position are moved 1 pixel in negative direction and in that case, starting point is excluded. This made me many problems trying to make fast line and circle drawing. With this correction, starting point is always included, and length is not changed. On example, in positive direction, for length of 5, first point is 0 and last is 4, and for negative direction, first point is also 0 and last is -4 (in original, negative length gives points in range -1 to -5).

Now, I made my version of writeLine (non H/V). Any such line is composed of small H or V parts with length of minimum 1 (or single pixel). In my version of writeLine, I didn't draw every pixel one by one, but counting how many pixels has current direction (H or V). Only when X and Y are both changed, then I call drawFastHLine, or drawFastVLine (depending on direction). In this way, I get almost two time faster writeLine exceution. The same I used in drawCircle function, so I have much faster drawing then original function. The same I used in fillCircle, drawRoundRect, fill RoundRect etc. Now, I made my class based on MCUFRIEND_kbv, with additional functions drawEllipse, fillEllipse,k drawPie and fillPie.

Here is some tests:

TFT 3.2"

ID = 0x9327 MCUFRIEND_kbv my version

Test: FillScreen 1.208512 s 1.208512 s

Test: Text 0.241844 s 0.242124 s

Test: Lines 12.522761 s 6.372436 s

Test: Horiz/Vert Lines 0.108264 s 0.108360 s

Test: Rectangles (outline) 0.063036 s 0.063092 s

Test: Rectangles (filled) 1.526200 s 1.526228 s

Test: Circles (filled) 0.690836 s 0.511844 s

Test: Circles (outline) 1.306424 s 0.645500 s

Test: Circles 2 (outline) 0.568408 s 0.254412 s

Test: Circles 2 (filled) 0.680088 s 0.610644 s

Test: Triangles (outline) 0.523948 s 0.290940 s

Test: Triangles (filled) 1.137668 s 1.134044 s

Test: Rounded rects (outline) 0.640492 s 0.301240 s

Test: Rounded rects (filled) 2.132796 s 2.078888 s

------------------

Ellipse (outline) - skiped 0.345344 s

Ellipse (filled) - skiped 0.758544 s

Arc (outline) - skiped 0.390500 s

Pie (outline) - skiped 2.052564 s

Pie (filled) - skiped 2.340308 s

------------------

I have never work with GitHub, so if this is usable, I would preffer to send my code to somebody who knows what to do with it.