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

Swapped RED and BLUE color channels on the LCD #47

Open
TheCrypt0 opened this issue Jun 30, 2020 · 3 comments
Open

Swapped RED and BLUE color channels on the LCD #47

TheCrypt0 opened this issue Jun 30, 2020 · 3 comments

Comments

@TheCrypt0
Copy link

Thank you for the great work with this firmware.
I've just flashed it on my scope and I noticed a weird behavior where the red and blue color channels seems to be swapped. Nothing too fancy and (probably) easily fixable but worth mentioning.

photo6041835486214992760

I took a look at the code and in global.h the analog line should actually be yellow:

// display colours
#define AN_SIGNAL1    ILI9341_YELLOW
#define DG_SIGNAL1    ILI9341_RED
#define DG_SIGNAL2    ILI9341_BLUE
#define DG_SIGNAL3    ILI9341_GREEN

As expected the ILI9341_YELLOW is defined in the Adafruit library:

#define ILI9341_YELLOW      0xFFE0      /* 255, 255,   0 */

Maybe a change with the new LCD controller?

@gregcrago
Copy link

I have Original JYETech 150 and I get BLUE text as well. I changed my Stats and Cursor text my changing in display.cpp line 974 tft_setTextColor(ILI9341_BLUE, ILI9341_BLUE); // should now get RED text and also change line 682 to tft_setTextColor(ILI9341_BLUE, ILI9341_BLUE); // should now get RED text
It would be nice to know all the the actual colors in this unit. Analog is set to YELLOW, but I see CYAN

@gregcrago
Copy link

in global.h I changed:
#define AN_SIGNAL1 ILI9341_CYAN // now displays YELLOW
#define DG_SIGNAL1 ILI9341_BLUE // now displays RED

now it looks like the pictures, the BLUE text overlay and digital signal was very hard to read

@TheCrypt0
Copy link
Author

TheCrypt0 commented Dec 24, 2020

I've finally managed to fix it. Just replace the following lines in the file:

https://github.com/michar71/Open-DSO-150/blob/master/Src/TFTLib/Adafruit_TFTLCD_8bit_STM32.cpp#L53

...
writeRegister8(ILI9341_MADCTL , ILI9341_MADCTL_MY | ILI9341_MADCTL_RGB);
...

https://github.com/michar71/Open-DSO-150/blob/master/Src/TFTLib/Adafruit_TFTLCD_8bit_STM32.cpp#L291

void setRotation(uint8_t x)
{
  //perform hardware-specific rotation operations...
   uint16_t t = 0;


   if ( dispControllerId==0x8552)
   {
	   x = (x+1) % 4; // Landscape & portrait are inverted compared to ILI
   }


//#ifdef IS_ST7789
//   x = (x+1) % 4; // Landscape & portrait are inverted compared to ILI
//#endif
 

   switch (x)
   {
   case 2:
     t = ILI9341_MADCTL_MX | ILI9341_MADCTL_RGB;
     break;
   case 3:
     t = ILI9341_MADCTL_MV | ILI9341_MADCTL_RGB;
     break;
  case 0:
    t = ILI9341_MADCTL_MY | ILI9341_MADCTL_RGB;
    break;
   case 1:
     t = ILI9341_MADCTL_MX | ILI9341_MADCTL_MY | ILI9341_MADCTL_MV | ILI9341_MADCTL_RGB;
     break;
   }
   writeRegister8(ILI9341_MADCTL, t ); // MADCTL
   // For 9341, init default full-screen address window:
   setAddrWindow(0, 0, TFTWIDTH - 1, TFTHEIGHT - 1); // CS_IDLE happens here
}

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