diff --git a/components/micropython/usermodule/mp_sys_display.c b/components/micropython/usermodule/mp_sys_display.c index 5bd1206eb8c03770244ed10067517a91a9cca678..3da5cc5d4e350a241fb8972a9984304b9f1a6c1c 100644 --- a/components/micropython/usermodule/mp_sys_display.c +++ b/components/micropython/usermodule/mp_sys_display.c @@ -135,7 +135,7 @@ STATIC const mp_rom_map_elem_t mp_module_sys_display_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_low_latency), MP_ROM_INT((int)st3m_gfx_low_latency) }, { MP_ROM_QSTR(MP_QSTR_direct_ctx), MP_ROM_INT((int)st3m_gfx_direct_ctx) }, { MP_ROM_QSTR(MP_QSTR_unset), MP_ROM_INT((int)st3m_gfx_unset) }, - { MP_ROM_QSTR(MP_QSTR_force), MP_ROM_INT((int)st3m_gfx_force) }, + { MP_ROM_QSTR(MP_QSTR_lock), MP_ROM_INT((int)st3m_gfx_lock) }, { MP_ROM_QSTR(MP_QSTR_x2), MP_ROM_INT((int)st3m_gfx_2x) }, { MP_ROM_QSTR(MP_QSTR_x3), MP_ROM_INT((int)st3m_gfx_3x) }, { MP_ROM_QSTR(MP_QSTR_x4), MP_ROM_INT((int)st3m_gfx_4x) }, diff --git a/components/st3m/st3m_gfx.c b/components/st3m/st3m_gfx.c index 687cbbf748c9a6c6de975f4bbd213cdf74a1c550..c31d2f6a3f81859db464d9e24b504a3c6c9e504f 100644 --- a/components/st3m/st3m_gfx.c +++ b/components/st3m/st3m_gfx.c @@ -213,8 +213,8 @@ void st3m_gfx_set_palette(uint8_t *pal_in, int count) { void st3m_gfx_set_default_mode(st3m_gfx_mode mode) { if (mode & st3m_gfx_unset) { - if (mode & st3m_gfx_force) - default_mode &= ~st3m_gfx_force; + if (mode & st3m_gfx_lock) + default_mode &= ~st3m_gfx_lock; else if (mode & st3m_gfx_4x) default_mode &= ~st3m_gfx_4x; else if (mode & st3m_gfx_osd) @@ -245,18 +245,18 @@ void st3m_gfx_set_default_mode(st3m_gfx_mode mode) { default_mode |= st3m_gfx_osd; } else if (mode == st3m_gfx_low_latency) { default_mode |= st3m_gfx_low_latency; - } else if (mode == st3m_gfx_force) { - default_mode |= st3m_gfx_force; + } else if (mode == st3m_gfx_lock) { + default_mode |= st3m_gfx_lock; } else if (mode == st3m_gfx_direct_ctx) { default_mode |= st3m_gfx_direct_ctx; } else default_mode = mode; - if (default_mode & st3m_gfx_force) { - default_mode &= ~st3m_gfx_force; + if (default_mode & st3m_gfx_lock) { + default_mode &= ~st3m_gfx_lock; _st3m_gfx_mode = default_mode + 1; st3m_gfx_set_mode(st3m_gfx_default); - default_mode |= st3m_gfx_force; + default_mode |= st3m_gfx_lock; } else { _st3m_gfx_mode = default_mode + 1; st3m_gfx_set_mode(st3m_gfx_default); @@ -311,7 +311,7 @@ static void st3m_gfx_init_palette(st3m_gfx_mode mode) { } st3m_gfx_mode st3m_gfx_set_mode(st3m_gfx_mode mode) { - if ((mode == _st3m_gfx_mode) || (0 != (default_mode & st3m_gfx_force))) { + if ((mode == _st3m_gfx_mode) || (0 != (default_mode & st3m_gfx_lock))) { st3m_gfx_init_palette( mode); // we say it is a no-op but reset the palette return (mode ? mode : default_mode); diff --git a/components/st3m/st3m_gfx.h b/components/st3m/st3m_gfx.h index d2a744b83cbdb9ef8fde8b2b368b2b5f79716c2a..05b137eb058db732a577d4b12d9bd276a6f4eb23 100644 --- a/components/st3m/st3m_gfx.h +++ b/components/st3m/st3m_gfx.h @@ -17,7 +17,7 @@ typedef enum { // shallower pipeline, in the future might mean immediate mode st3m_gfx_low_latency = 512, st3m_gfx_unset = 1024, - st3m_gfx_force = 8192, + st3m_gfx_lock = 8192, st3m_gfx_2x = 2048, st3m_gfx_3x = 4096, st3m_gfx_4x = 6144, diff --git a/python_payload/apps/graphics_mode/__init__.py b/python_payload/apps/graphics_mode/__init__.py index 3740da9a62f9df3dae293095b26b48dd05930db7..5a4bd83b203bd5e2b33a9c81f2304cb7b41680af 100644 --- a/python_payload/apps/graphics_mode/__init__.py +++ b/python_payload/apps/graphics_mode/__init__.py @@ -126,7 +126,7 @@ class App(Application): curmode = sys_display.get_mode() low_latency = (curmode & sys_display.low_latency) != 0 direct_ctx = (curmode & sys_display.direct_ctx) != 0 - lock = (curmode & sys_display.force) != 0 + lock = (curmode & sys_display.lock) != 0 osd = (curmode & sys_display.osd) != 0 scale = 0 if (curmode & sys_display.x4) == sys_display.x2: @@ -194,7 +194,7 @@ class App(Application): mode += osd * sys_display.osd mode += low_latency * sys_display.low_latency mode += direct_ctx * sys_display.direct_ctx - mode += lock * sys_display.force + mode += lock * sys_display.lock if scale == 1: mode += sys_display.x2