Problem with DIRTYDEVICE?

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

  • Problem with DIRTYDEVICE?

    I am using the BitPlains driver and with that I am creating a dirty device:


    void LCD_X_Config(void) {
    //
    // Set display driver and color conversion for 1st layer
    //
    GUI_DEVICE *pDevice;
    pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_BITPLAINS, COLOR_CONVERSION, 0, 0);
    //
    // Configure the BITPLAINS driver
    //
    CONFIG_BITPLAINS pConfig;
    pConfig.Mirror = 1;
    GUIDRV_BitPlains_Config(pDevice, &pConfig);
    //
    // Display driver configuration
    //
    if (LCD_GetSwapXY()) {
    LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
    LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS);
    } else {
    LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
    LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS);
    }
    //
    // Initialize VRAM access off driver
    //
    LCD_SetVRAMAddrEx(0, (void *)&_VRAM_Desc);
    //
    // Create the DIRTYDEVICE object to monitor changes
    //
    GUI_DIRTYDEVICE_Create();
    }


    In my application code this is what I'm doing to initialize emWin:

    GUI_Init();
    GUI_SetOrientation(GUI_MIRROR_X | GUI_MIRROR_Y);

    I need to change the orientation since my display is rotated 180 degrees.

    In my main draining loop I do this:
    GUI_Exec();


    Next, I check to see if there is anything dirty and then I redraw those rows of my display in my own function LCD_draw_bitplain():

    if(GUI_DIRTYDEVICE_Fetch(&dirtyInfo) == 1)
    {
    LCD_draw_bitplain(dirtyInfo.y0, dirtyInfo.ySize);
    }

    Refer to Table 8.75 in the User & Reference Guide for emWin V5.32. The issue/question I have is that when I use GUI_DIRTYDEVICE_Fetch() it seems that y0 (Topmost position) is not taking into account the GUI_SetOrientation(GUI_MIRROR_X | GUI_MIRROR_Y) when returning values for x0 and y0?
  • In the file GUI_DirtyDevice.c I see this function being called:
    _CreateEx()

    In that function it creates its own context:
    pContext = (DRIVER_CONTEXT_DIRTY *)pDevice->u.pContext;


    How does the DIRTYDEVICE find out about the change in display orientation?
  • Update:The DIRTY DEVICE works fine with the BitPlain driver which currently supports only the default display orientation. If you need to change the orientation of your display do that in the code that renders the BitPlain to the display.