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

TFT_invertDisplay #1

Closed
jas39 opened this issue Sep 25, 2019 · 2 comments
Closed

TFT_invertDisplay #1

jas39 opened this issue Sep 25, 2019 · 2 comments

Comments

@jas39
Copy link

jas39 commented Sep 25, 2019

There seems to be a missing reservation of the SPI bus in function TFT_invertDisplay and TFT_setGammaCurve. Propose something like this:

void TFT_invertDisplay(const uint8_t mode) {
	if (disp_select() == ESP_OK) {
	  if ( mode == INVERT_ON ) disp_spi_transfer_cmd(TFT_INVONN);
	  else disp_spi_transfer_cmd(TFT_INVOFF);
	  disp_deselect();
	}
}

void TFT_setGammaCurve(uint8_t gm) {
  uint8_t gamma_curve = 1 << (gm & 0x03);
  if (disp_select() == ESP_OK) {
	  disp_spi_transfer_cmd_data(TFT_CMD_GAMMASET, &gamma_curve, 1);
	  disp_deselect();
  }
}

This is verified on Lilygo T-Display (ST7789V based)

@jeremyjh
Copy link
Owner

Thanks! I had not tried TFT_invertDisplay yet, but I confirmed it did not work until doing this on my ILI9341. Do you want to submit a PR?

@jas39
Copy link
Author

jas39 commented Sep 28, 2019

Please go ahead and fix it as my git knowledge is too limited 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants