refactor(style): store constant property IDs with a pointer instead of directly (#3506)

This commit is contained in:
embeddedt
2022-07-20 05:32:40 -04:00
committed by GitHub
parent 9ed5b3fe06
commit d6e5200013
7 changed files with 373 additions and 93 deletions

View File

@@ -401,12 +401,15 @@ def style_set_c(p):
print(" };")
print(" lv_style_set_prop(style, LV_STYLE_" + p['name'] +", v);")
print("}")
print("")
print("const lv_style_prop_t lv_style_const_prop_id_" + p['name'] + " = LV_STYLE_" + p['name'] + ";")
def style_set_h(p):
if 'section' in p: return
print("void lv_style_set_" + p['name'].lower() +"(lv_style_t * style, "+ p['var_type'] +" value);")
print("extern const lv_style_prop_t lv_style_const_prop_id_" + p['name'] + ";")
def local_style_set_c(p):
@@ -435,7 +438,7 @@ def style_const_set(p):
print("")
print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\")
print(" { \\")
print(" .prop = LV_STYLE_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\")
print(" .prop_ptr = &lv_style_const_prop_id_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\")
print(" }")