Closed jas39 closed 4 years ago
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)
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?
Please go ahead and fix it as my git knowledge is too limited 😊
There seems to be a missing reservation of the SPI bus in function TFT_invertDisplay and TFT_setGammaCurve. Propose something like this:
This is verified on Lilygo T-Display (ST7789V based)