|
@@ -546,12 +546,15 @@ static const uint16_t ili9341_init[] = {
|
546
|
546
|
#define BUTTONC_X_LO (242 / 2) * (FSMC_UPSCALE)
|
547
|
547
|
#define BUTTONC_X_HI (BUTTONC_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1)
|
548
|
548
|
|
549
|
|
- #define BUTTON_Y_LO (184 / 2) * (FSMC_UPSCALE)
|
|
549
|
+ #define BUTTON_Y_LO (140 / 2) * (FSMC_UPSCALE) + 44 //184 2x, 254 3x
|
550
|
550
|
#define BUTTON_Y_HI (BUTTON_Y_LO + (FSMC_UPSCALE) * BUTTON_SIZE_Y - 1)
|
551
|
551
|
|
552
|
552
|
void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) {
|
553
|
553
|
uint16_t buffer[BUTTON_SIZE_X * sq(FSMC_UPSCALE)];
|
554
|
554
|
|
|
555
|
+ //NOTE: the buffer are sized for max 32 lenght! If you need draw bigger things with this function, we need increase the buffer
|
|
556
|
+ if (length > BUTTON_SIZE_X) return;
|
|
557
|
+
|
555
|
558
|
for (uint16_t i = 0; i < height; i++) {
|
556
|
559
|
uint16_t k = 0;
|
557
|
560
|
for (uint16_t j = 0; j < length; j++) {
|
|
@@ -567,7 +570,7 @@ static const uint16_t ili9341_init[] = {
|
567
|
570
|
for (uint16_t l = 0; l < length * (FSMC_UPSCALE); l++)
|
568
|
571
|
buffer[l + (length * (FSMC_UPSCALE) * n)] = buffer[l];
|
569
|
572
|
|
570
|
|
- LCD_IO_WriteSequence(buffer, COUNT(buffer));
|
|
573
|
+ LCD_IO_WriteSequence(buffer, length * sq(FSMC_UPSCALE));
|
571
|
574
|
#else
|
572
|
575
|
u8g_WriteSequence(u8g, dev, k << 1, (uint8_t*)buffer);
|
573
|
576
|
u8g_WriteSequence(u8g, dev, k << 1, (uint8_t*)buffer);
|
|
@@ -657,9 +660,9 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
|
657
|
660
|
// bottom line and buttons
|
658
|
661
|
#if ENABLED(TOUCH_BUTTONS)
|
659
|
662
|
|
660
|
|
- setWindow(u8g, dev, 10, 170, 309, 171);
|
|
663
|
+ setWindow(u8g, dev, BUTTOND_X_LO - 4, BUTTON_Y_LO - 5, BUTTONC_X_HI + BUFSIZE + 4, BUTTON_Y_LO - 4);
|
661
|
664
|
#ifdef LCD_USE_DMA_FSMC
|
662
|
|
- LCD_IO_WriteMultiple(TFT_DISABLED_COLOR, 600);
|
|
665
|
+ LCD_IO_WriteMultiple(TFT_DISABLED_COLOR, 600 / 2 * FSMC_UPSCALE);
|
663
|
666
|
#else
|
664
|
667
|
memset2(buffer, TFT_DISABLED_COLOR, 150);
|
665
|
668
|
for (uint8_t i = 8; i--;)
|