Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fillScreen: trigger a redraw of the screen #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KurtE
Copy link

@KurtE KurtE commented Feb 5, 2024

From the Forum thread:
https://forum.arduino.cc/t/problem-with-fillscreen/1218319

The following sketch does not show anything on the screen:

#include "Arduino.h"
//#include "SPI.h"
#include "Arduino_GigaDisplay_GFX.h"

GigaDisplay_GFX tft;

#define GC9A01A_CYAN    0x07FF
#define GC9A01A_RED     0xf800
#define GC9A01A_BLUE    0x001F
#define GC9A01A_GREEN   0x07E0
#define GC9A01A_MAGENTA 0xF81F
#define GC9A01A_WHITE   0xffff
#define GC9A01A_BLACK   0x0000
#define GC9A01A_YELLOW  0xFFE0
#define WHITE 0xffff
#define BLACK 0x0000

void setup() {

  Serial.begin(115200);

  tft.begin();

  tft.fillScreen(GC9A01A_GREEN);
  yield();
  delay(3000);
  tft.fillScreen(GC9A01A_BLUE);
  yield();
  delay(3000);
  tft.fillScreen(GC9A01A_YELLOW);
  Serial.println("Done");

}

void loop() {
  // put your main code here, to run repeatedly:

}

Problem was you implemented your own version of fillScreen, which did not have the startWrite() and more specific endWrite() calls in it, and as such your dirty flag was not set.

From the Forum thread:
https://forum.arduino.cc/t/problem-with-fillscreen/1218319

The following sketch does not show anything on the screen:
```
#include "Arduino.h"
//#include "SPI.h"
#include "Arduino_GigaDisplay_GFX.h"

GigaDisplay_GFX tft;

#define GC9A01A_CYAN    0x07FF
#define GC9A01A_RED     0xf800
#define GC9A01A_BLUE    0x001F
#define GC9A01A_GREEN   0x07E0
#define GC9A01A_MAGENTA 0xF81F
#define GC9A01A_WHITE   0xffff
#define GC9A01A_BLACK   0x0000
#define GC9A01A_YELLOW  0xFFE0
#define WHITE 0xffff
#define BLACK 0x0000

void setup() {

  Serial.begin(115200);

  tft.begin();

  tft.fillScreen(GC9A01A_GREEN);
  yield();
  delay(3000);
  tft.fillScreen(GC9A01A_BLUE);
  yield();
  delay(3000);
  tft.fillScreen(GC9A01A_YELLOW);
  Serial.println("Done");

}

void loop() {
  // put your main code here, to run repeatedly:

}
```
Problem was you implemented your own version of fillScreen, which did not have the startWrite() and more specific endWrite() calls in it, and as such your dirty flag was not set.
@per1234 per1234 added the bug Something isn't working label Feb 5, 2024
@gilesp1729
Copy link
Contributor

gilesp1729 commented May 22, 2024

The same fix also needs to be applied to drawFastRawH/Vline.

gilesp1729 added a commit to gilesp1729/Arduino_GigaDisplay_GFX that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants