LVGL on a 16-Bit MCU

Description

I am new here, I know that LVGL is optimized to work on a 32-bit MCU, But I want to port LVGL to a 16-bit MCU, is there any concerns about that, or anything I must take care of?

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

dsPIC33CK128MP206, using XC_DSC compiler

What do you want to achieve?

Porting the library to this MCU efficiently and effectively

What have you tried so far?

I am able now to compile the full code without errors or warning, after I fixed some lines, you can check some examples of what I have fixed:

in (lv_sprintf.h) file:

#define LV_PRId32 "ld"	// [FIXED] from d to ld because the MCU is 16 bit
#define LV_PRIu32 "lu"	// [FIXED] from u to lu because the MCU is 16 bit
#define LV_PRIx32 "lx"	// [FIXED] from x to lx because the MCU is 16 bit
#define LV_PRIX32 "lX"	// [FIXED] from X to lX because the MCU is 16 bit

in (lv_refr.c) file:

lv_area_t res[4] = {0};	//[FIXED]	-Wno-missing-braces Added in Compiler configurations

in (lv_indev.c) file:

scale_x = (256L * 256) / scale_x;	//[FIXED] L Added
scale_y = (256L * 256) / scale_y;	//[FIXED] L Added

in (lv_color.c) file:

uint32_t lv_color_to_u32(lv_color_t color)
{
    return (uint32_t)((uint32_t)0xff << 24) + ((uint32_t)color.red << 16) + ((uint16_t)color.green << 8) + (color.blue);	//[FIXED] (uint32_t) Casting Added
}

in (lv_lru.c) file:

 if(key_length >= 3) {
        h ^= (uint32_t)data[2] << 16;	//[FIXED] (uint32_t) Casting Added
    }
    if(key_length >= 2) {
        h ^= (uint32_t)data[1] << 8;	//[FIXED] (uint32_t) Casting Added
    }

in (lv_text.c) file:

swapped = ((uint32_t)c8[0] << 24) + ((uint32_t)c8[1] << 16) + ((uint16_t)c8[2] << 8) + (c8[3]);	//[FIXED] (uint32_t) Casting Added

in (lv_tlsf.c) file:

// [FIXED] All arguments named (control) were replaced with (cont), because (control) is a key word.

in (lv_mem.c) file:

LV_LOG_INFO("used: %u (%3d %%), frag: %3d %%, biggest free: %u",			// [FIXED] from %zu to %u (I don't know why the compiler threw a warning here, despite it being correct)
                    mon.total_size - mon.free_size, mon.used_pct, mon.frag_pct,
                    mon.free_biggest_size);

in (lv_lv_theme_default.c) file:

static lv_color_t grey_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t color, lv_opa_t opa)
{
    LV_UNUSED(f);
    if(theme_def->base.flags & MODE_DARK) return lv_color_mix(lv_palette_darken(LV_PALETTE_GREY, 2), color, opa);	//[FIXED]	-fno-strict-aliasing (Compiler configurations)
    else return lv_color_mix(lv_palette_lighten(LV_PALETTE_GREY, 2), color, opa);
}


After I made these modifications, the compiler was happy, but not me, until I see something meaningful on the display, please don’t hesitate to recommend or to guide me to do anything else.

Thanks for any suggestion or correction.