Compilation error with 1 bit color in Dev 6.1

Description

1-bit color selection causes compilation error in Dev 6.1.

What MCU/Processor/Board and compiler are you using?

Keil uVision MDK 5.27 w/ ARM V5.06 update 6 toolchain.

What do you experience?

When LV_COLOR_DEPTH is set to 1 compilation fails. The failure is a result of changes to the lv_color*_t unions to include the “ch” structures.

lv_draw_basic.c includes references to the new “ch” member that does not exists for the 1 bit color depth definition.

..\..\lvgl\src\lv_draw\lv_draw_basic.c(411): error:  #136: union "<unnamed>"  has no field "ch"

What do you expect?

lv_color1_t in Dev 6.1 has definition:

typedef union
{
    uint8_t blue : 1;
    uint8_t green : 1;
    uint8_t red : 1;
    uint8_t full : 1;
} lv_color1_t;

lv_color1_t should have definition:

typedef union
{
    struct
    {
        uint8_t blue : 1;
        uint8_t green : 1;
        uint8_t red : 1;
    } ch;
    uint8_t full;
} lv_color1_t;

Code to reproduce

Setting color depth to 1

#define LV_COLOR_DEPTH     1

Can you send a pull request?

I will attempt to do a pull request today.

Pull request sent and accepted. This bug is resolved.

1 Like