Emwin mixes blue and red color

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Emwin mixes blue and red color

      New

      Hey,
      i'm facing a strange problem. I recently noticed that all blue texts are displayed in red and all red texts are displayed in blue.
      Looks like emwin swaps the red and blue color part

      My current emwin version is 5.40. I went back to some old version with emwin 5.32 and the texts are displayed correct. Now my actual driver to communicate with the lcd has not undergone any changes. I was wondering if there have been some emwin internal changes?

      Thats my current code (tested with emwin 5.32 and 5.40)

      C Source Code

      1. GUI_DispStringAt("Text 1", 10, 10);
      2. GUI_SetColor(GUI_RED);
      3. //displayed in blue in 5.40
      4. GUI_DispStringAt("Text 2", 10, 40);
      5. GUI_SetColor(GUI_DARKGREEN);
      6. //displayed in green in 5.40
      7. GUI_DispStringAt("Text 3", 10, 70);
      8. GUI_SetColor(GUI_BLUE);
      9. //displayed in red in 5.40
      10. GUI_DispStringAt("Text 4", 60, 100);
      Display All
      Can you tell me where the color information is actually passed to the lcd driver?
    • New

      hey thx, that did solve the problem i did replace GUICC_565 with GUICC_M565. :)
      I went back in my version control and i can defiantly confirm now that the change was introduced when i updated the emwin versions.
      However the actual driver and configuration files stayed the same. There must have been some internal changed in the emin lib.

      I replaced the GUICC_565 within the LCD_X_Config()

      Source Code

      1. void LCD_X_Config(void) {
      2. GUI_DEVICE * pDevice;
      3. CONFIG_FLEXCOLOR Config = {0};
      4. GUI_PORT_API PortAPI = {0};
      5. //
      6. // Set display driver and color conversion
      7. //
      8. pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_M565, 0, 0);
      9. //
      10. // Display driver configuration, required for Lin-driver
      11. //
      12. LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
      13. LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
      14. //
      15. // Orientation
      16. //
      17. Config.Orientation = GUI_MIRROR_X;//GUI_SWAP_XY;// | GUI_MIRROR_Y;
      18. GUIDRV_FlexColor_Config(pDevice, &Config);
      19. //
      20. // Set controller and operation mode
      21. //
      22. PortAPI.pfWrite8_A0 = LcdWriteReg;
      23. PortAPI.pfWrite8_A1 = LcdWriteData;
      24. PortAPI.pfWriteM8_A1 = LcdWriteDataMultiple;
      25. PortAPI.pfRead8_A1 = LcdReadData;
      26. PortAPI.pfReadM8_A1 = LcdReadDataMultiple;
      27. GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B8);
      28. }
      Display All
      is there any other place i'll have to change?