mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix conflicts
This commit is contained in:
commit
a740af4afb
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lvgl",
|
"name": "lvgl",
|
||||||
"version": "v7.0.2",
|
"version": "v7.1.0",
|
||||||
"keywords": "graphics, gui, embedded, littlevgl",
|
"keywords": "graphics, gui, embedded, littlevgl",
|
||||||
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
|
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
|
||||||
"repository":
|
"repository":
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file lv_conf.h
|
* @file lv_conf.h
|
||||||
* Configuration file for LVGL v7.0.2
|
* Configuration file for LVGL v7.1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
2
lvgl.h
2
lvgl.h
@ -79,7 +79,7 @@ extern "C" {
|
|||||||
#define LVGL_VERSION_MAJOR 7
|
#define LVGL_VERSION_MAJOR 7
|
||||||
#define LVGL_VERSION_MINOR 1
|
#define LVGL_VERSION_MINOR 1
|
||||||
#define LVGL_VERSION_PATCH 0
|
#define LVGL_VERSION_PATCH 0
|
||||||
#define LVGL_VERSION_INFO "dev"
|
#define LVGL_VERSION_INFO ""
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
|
310
scripts/release.py
Normal file → Executable file
310
scripts/release.py
Normal file → Executable file
@ -1,227 +1,224 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
|
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
|
||||||
|
|
||||||
|
|
||||||
def title(t):
|
def title(t):
|
||||||
print("\n---------------------------------")
|
print("\n---------------------------------")
|
||||||
print(t)
|
print(t)
|
||||||
print("---------------------------------")
|
print("---------------------------------")
|
||||||
|
|
||||||
|
|
||||||
def cmd(c):
|
def cmd(c):
|
||||||
print("\n" + c)
|
print("\n" + c)
|
||||||
r = os.system(c)
|
r = os.system(c)
|
||||||
if r:
|
if r:
|
||||||
print("Exit due to previous error")
|
print("### Error: " + str(r))
|
||||||
exit(r)
|
|
||||||
|
|
||||||
def lvgl_clone():
|
def lvgl_clone():
|
||||||
title("lvgl: Clone")
|
title("lvgl: Clone")
|
||||||
cmd("git clone https://github.com/lvgl/lvgl.git")
|
cmd("git clone https://github.com/lvgl/lvgl.git")
|
||||||
os.chdir("./lvgl")
|
os.chdir("./lvgl")
|
||||||
cmd("git co master")
|
cmd("git co master")
|
||||||
|
|
||||||
def lvgl_format():
|
def lvgl_format():
|
||||||
title("lvgl: Run code formatter")
|
title("lvgl: Run code formatter")
|
||||||
os.chdir("./scripts")
|
os.chdir("./scripts")
|
||||||
cmd("./code-format.sh")
|
cmd("./code-format.sh")
|
||||||
cmd("git ci -am 'Run code formatter'")
|
os.system("git ci -am 'Run code formatter'")
|
||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
|
||||||
def lvgl_update_version():
|
def lvgl_update_version():
|
||||||
title("lvgl: Update version number")
|
title("lvgl: Update version number")
|
||||||
|
|
||||||
f = open("./lvgl.h", "r")
|
f = open("./lvgl.h", "r")
|
||||||
|
|
||||||
outbuf = ""
|
outbuf = ""
|
||||||
major_ver = -1
|
major_ver = -1
|
||||||
minor_ver = -1
|
minor_ver = -1
|
||||||
patch_ver = -1
|
patch_ver = -1
|
||||||
|
|
||||||
for i in f.read().splitlines():
|
for i in f.read().splitlines():
|
||||||
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
|
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
|
||||||
if r:
|
if r:
|
||||||
m = lastNum.search(i)
|
m = lastNum.search(i)
|
||||||
if m: major_ver = m.group(1)
|
if m: major_ver = m.group(1)
|
||||||
|
|
||||||
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
|
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
|
||||||
if r:
|
if r:
|
||||||
m = lastNum.search(i)
|
m = lastNum.search(i)
|
||||||
if m: minor_ver = m.group(1)
|
if m: minor_ver = m.group(1)
|
||||||
|
|
||||||
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
|
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
|
||||||
if r:
|
if r:
|
||||||
m = lastNum.search(i)
|
m = lastNum.search(i)
|
||||||
if m: patch_ver = m.group(1)
|
if m: patch_ver = m.group(1)
|
||||||
|
|
||||||
|
|
||||||
r = re.search(r'^#define LVGL_VERSION_INFO ', i)
|
r = re.search(r'^#define LVGL_VERSION_INFO ', i)
|
||||||
if r:
|
if r:
|
||||||
i = "#define LVGL_VERSION_INFO \"\""
|
i = "#define LVGL_VERSION_INFO \"\""
|
||||||
|
|
||||||
outbuf += i + '\n'
|
outbuf += i + '\n'
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
f = open("./lvgl.h", "w")
|
f = open("./lvgl.h", "w")
|
||||||
|
|
||||||
f.write(outbuf)
|
f.write(outbuf)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
s = "v" + str(major_ver) + "." + str(minor_ver) + "." + str(patch_ver)
|
s = "v" + str(major_ver) + "." + str(minor_ver) + "." + str(patch_ver)
|
||||||
print("New version:" + s)
|
print("New version:" + s)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def lvgl_update_library_json(v):
|
def lvgl_update_library_json(v):
|
||||||
title("lvgl: Update version number in library.json")
|
title("lvgl: Update version number in library.json")
|
||||||
|
|
||||||
f = open("./library.json", "r")
|
f = open("./library.json", "r")
|
||||||
|
|
||||||
outbuf = ""
|
outbuf = ""
|
||||||
|
|
||||||
for i in f.read().splitlines():
|
for i in f.read().splitlines():
|
||||||
r = re.search(r'"version": ', i)
|
r = re.search(r'"version": ', i)
|
||||||
if r:
|
if r:
|
||||||
i = ' "version": "' + v + '",'
|
i = ' "version": "' + v + '",'
|
||||||
|
|
||||||
outbuf += i + '\n'
|
outbuf += i + '\n'
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
f = open("./library.json", "w")
|
f = open("./library.json", "w")
|
||||||
|
|
||||||
f.write(outbuf)
|
f.write(outbuf)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def lvgl_update_lv_conf_templ(ver_str):
|
def lvgl_update_lv_conf_templ(ver_str):
|
||||||
title("lvgl: Update version number in lv_conf_template.h")
|
title("lvgl: Update version number in lv_conf_template.h")
|
||||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' lv_conf_template.h ")
|
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' lv_conf_template.h ")
|
||||||
|
|
||||||
|
|
||||||
def lvgl_commit_push(v):
|
def lvgl_commit_push(v):
|
||||||
title("lvgl: commit and push release")
|
title("lvgl: commit and push release")
|
||||||
|
|
||||||
cmd('git ci -am "Release ' + v + '"')
|
os.system('git ci -am "Release ' + v + '"')
|
||||||
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
|
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
|
||||||
cmd('git push origin master')
|
cmd('git push origin master')
|
||||||
cmd('git push origin ' + v)
|
cmd('git push origin ' + v)
|
||||||
|
|
||||||
|
|
||||||
def lvgl_merge_to_release_branch(v):
|
def lvgl_merge_to_release_branch(v):
|
||||||
title("lvgl: merge to release branch")
|
title("lvgl: merge to release branch")
|
||||||
cmd('git co release/v7')
|
cmd('git co release/v7')
|
||||||
cmd('git merge master')
|
cmd('git merge master')
|
||||||
cmd('git push origin release/v7')
|
cmd('git push origin release/v7')
|
||||||
os.chdir("../")
|
os.chdir("../")
|
||||||
|
|
||||||
|
|
||||||
def lvgl_update_api_docs():
|
def lvgl_update_api_docs():
|
||||||
title("lvgl: Update API with Doxygen")
|
title("lvgl: Update API with Doxygen")
|
||||||
|
|
||||||
cmd("cd scripts; doxygen");
|
cmd("cd scripts; doxygen");
|
||||||
|
|
||||||
|
|
||||||
def examples_clone():
|
def examples_clone():
|
||||||
title("examples: Clone")
|
title("examples: Clone")
|
||||||
cmd("git clone https://github.com/lvgl/lv_examples.git")
|
cmd("git clone https://github.com/lvgl/lv_examples.git")
|
||||||
os.chdir("./lv_examples")
|
os.chdir("./lv_examples")
|
||||||
cmd("git co master")
|
cmd("git co master")
|
||||||
|
|
||||||
def examples_commit_push(v):
|
def examples_commit_push(v):
|
||||||
title("examples: commit and push release")
|
title("examples: commit and push release")
|
||||||
|
|
||||||
cmd('git ci -am "Release ' + v + '"')
|
os.system('git ci -am "Release ' + v + '"')
|
||||||
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
|
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
|
||||||
cmd('git push origin master')
|
cmd('git push origin master')
|
||||||
cmd('git push origin ' + v)
|
cmd('git push origin ' + v)
|
||||||
|
|
||||||
|
|
||||||
def examples_merge_to_release_branch(v):
|
def examples_merge_to_release_branch(v):
|
||||||
title("examples: merge to release branch")
|
title("examples: merge to release branch")
|
||||||
cmd('git co release/v7')
|
cmd('git co release/v7')
|
||||||
cmd('git merge master')
|
cmd('git merge master')
|
||||||
cmd('git push origin release/v7')
|
cmd('git push origin release/v7')
|
||||||
os.chdir("../")
|
os.chdir("../")
|
||||||
|
|
||||||
|
|
||||||
def drivers_clone():
|
def drivers_clone():
|
||||||
title("drivers: Clone")
|
title("drivers: Clone")
|
||||||
cmd("git clone https://github.com/lvgl/lv_drivers.git")
|
cmd("git clone https://github.com/lvgl/lv_drivers.git")
|
||||||
os.chdir("./lv_drivers")
|
os.chdir("./lv_drivers")
|
||||||
cmd("git co master")
|
cmd("git co master")
|
||||||
|
|
||||||
def drivers_commit_push(v):
|
def drivers_commit_push(v):
|
||||||
title("drivers: commit and push release")
|
title("drivers: commit and push release")
|
||||||
|
|
||||||
cmd('git ci -am "Release ' + v + '"')
|
os.system('git ci -am "Release ' + v + '"')
|
||||||
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
|
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
|
||||||
cmd('git push origin master')
|
cmd('git push origin master')
|
||||||
cmd('git push origin ' + v)
|
cmd('git push origin ' + v)
|
||||||
|
|
||||||
def drivers_merge_to_release_branch(v):
|
def drivers_merge_to_release_branch(v):
|
||||||
title("drivers: merge to release branch")
|
title("drivers: merge to release branch")
|
||||||
cmd('git co release/v7')
|
cmd('git co release/v7')
|
||||||
cmd('git merge master')
|
cmd('git merge master')
|
||||||
cmd('git push origin release/v7')
|
cmd('git push origin release/v7')
|
||||||
os.chdir("../")
|
os.chdir("../")
|
||||||
|
|
||||||
def docs_clone():
|
def docs_clone():
|
||||||
title("docs: Clone")
|
title("docs: Clone")
|
||||||
cmd("git clone --recursive https://github.com/lvgl/docs.git")
|
#cmd("git clone --recursive https://github.com/lvgl/docs.git")
|
||||||
os.chdir("./docs")
|
os.chdir("./docs")
|
||||||
|
|
||||||
def docs_get_api():
|
def docs_get_api():
|
||||||
title("docs: Get API files")
|
title("docs: Get API files")
|
||||||
|
|
||||||
cmd("git co latest")
|
cmd("git co latest --")
|
||||||
cmd("rm -rf xml");
|
cmd("rm -rf xml");
|
||||||
cmd("cp -r ../../lvgl/docs/api_doc/xml .");
|
cmd("cp -r ../lvgl/docs/api_doc/xml .");
|
||||||
cmd("git add xml");
|
cmd("git add xml");
|
||||||
cmd('git commit -m "update API"')
|
cmd('git commit -m "update API"')
|
||||||
|
|
||||||
def docs_update_version(v):
|
def docs_update_version(v):
|
||||||
title("docs: Update version number")
|
title("docs: Update version number")
|
||||||
|
|
||||||
f = open("./conf.py", "r")
|
f = open("./conf.py", "r")
|
||||||
|
|
||||||
outbuf = ""
|
outbuf = ""
|
||||||
|
|
||||||
for i in f.read().splitlines():
|
for i in f.read().splitlines():
|
||||||
r = re.search(r'^version = ', i)
|
r = re.search(r'^version = ', i)
|
||||||
if r:
|
if r:
|
||||||
i = "version = '" + v + "'"
|
i = "version = '" + v + "'"
|
||||||
|
|
||||||
r = re.search(r'^release = ', i)
|
r = re.search(r'^release = ', i)
|
||||||
if r:
|
if r:
|
||||||
i = "version = '" + v + "'"
|
i = "version = '" + v + "'"
|
||||||
|
|
||||||
outbuf += i + '\n'
|
outbuf += i + '\n'
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
f = open("./conf.py", "w")
|
f = open("./conf.py", "w")
|
||||||
|
|
||||||
f.write(outbuf)
|
f.write(outbuf)
|
||||||
f.close()
|
f.close()
|
||||||
cmd("git add conf.py")
|
cmd("git add conf.py")
|
||||||
cmd('git ci -m "update conf.py to ' + v '"')
|
cmd('git ci -m "update conf.py to ' + v + '"')
|
||||||
|
|
||||||
def docs_update_trans():
|
|
||||||
title("docs: Update translations")
|
|
||||||
cmd("cd en && ./trans_push.py && ./trans_pull.py")
|
|
||||||
|
|
||||||
def docs_build():
|
def docs_build():
|
||||||
title("docs: Build")
|
title("docs: Build")
|
||||||
cmd("git checkout master")
|
cmd("git checkout master")
|
||||||
cmd("./update.py latest")
|
cmd("./update.py latest")
|
||||||
|
|
||||||
def clean_up():
|
def clean_up():
|
||||||
title("Clean up repos")
|
title("Clean up repos")
|
||||||
os.chdir("../..")
|
os.chdir("../")
|
||||||
cmd("rm -rf lvgl docs lv_examples lv_drivers")
|
cmd("rm -rf lvgl docs lv_examples lv_drivers")
|
||||||
|
|
||||||
lvgl_clone()
|
lvgl_clone()
|
||||||
lvgl_format()
|
lvgl_format()
|
||||||
@ -243,7 +240,6 @@ drivers_merge_to_release_branch(ver_str)
|
|||||||
docs_clone()
|
docs_clone()
|
||||||
docs_get_api()
|
docs_get_api()
|
||||||
docs_update_version(ver_str)
|
docs_update_version(ver_str)
|
||||||
#docs_update_trans() # Zanata is not working now
|
|
||||||
docs_build()
|
docs_build()
|
||||||
|
|
||||||
clean_up()
|
clean_up()
|
||||||
|
@ -609,7 +609,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
|||||||
|
|
||||||
/*Process the steps they are valid only with released button*/
|
/*Process the steps they are valid only with released button*/
|
||||||
if(data->state != LV_INDEV_STATE_REL) {
|
if(data->state != LV_INDEV_STATE_REL) {
|
||||||
data->enc_diff = 0;
|
data->enc_diff = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Refresh the focused object. It might change due to lv_group_focus_prev/next*/
|
/*Refresh the focused object. It might change due to lv_group_focus_prev/next*/
|
||||||
@ -619,71 +619,74 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
|||||||
/*Button press happened*/
|
/*Button press happened*/
|
||||||
if(data->state == LV_INDEV_STATE_PR && last_state == LV_INDEV_STATE_REL) {
|
if(data->state == LV_INDEV_STATE_PR && last_state == LV_INDEV_STATE_REL) {
|
||||||
|
|
||||||
i->proc.pr_timestamp = lv_tick_get();
|
i->proc.pr_timestamp = lv_tick_get();
|
||||||
|
|
||||||
if (data->key == LV_KEY_ENTER) {
|
if(data->key == LV_KEY_ENTER) {
|
||||||
bool editable = false;
|
bool editable = false;
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable);
|
||||||
|
|
||||||
if(lv_group_get_editing(g) == true || editable == false) {
|
if(lv_group_get_editing(g) == true || editable == false) {
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_PRESSED, NULL);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_PRESSED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_PRESSED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_PRESSED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
}
|
}
|
||||||
} else if(data->key == LV_KEY_LEFT) {
|
}
|
||||||
/*emulate encoder left*/
|
else if(data->key == LV_KEY_LEFT) {
|
||||||
data->enc_diff--;
|
/*emulate encoder left*/
|
||||||
} else if(data->key == LV_KEY_RIGHT) {
|
data->enc_diff--;
|
||||||
/*emulate encoder right*/
|
}
|
||||||
data->enc_diff++;
|
else if(data->key == LV_KEY_RIGHT) {
|
||||||
} else if(data->key == LV_KEY_ESC) {
|
/*emulate encoder right*/
|
||||||
|
data->enc_diff++;
|
||||||
|
}
|
||||||
|
else if(data->key == LV_KEY_ESC) {
|
||||||
/*Send the ESC as a normal KEY*/
|
/*Send the ESC as a normal KEY*/
|
||||||
lv_group_send_data(g, LV_KEY_ESC);
|
lv_group_send_data(g, LV_KEY_ESC);
|
||||||
|
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_CANCEL, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_CANCEL, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
}
|
}
|
||||||
/*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/
|
/*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/
|
||||||
else {
|
else {
|
||||||
lv_group_send_data(g, data->key);
|
lv_group_send_data(g, data->key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*Pressing*/
|
/*Pressing*/
|
||||||
else if(data->state == LV_INDEV_STATE_PR && last_state == LV_INDEV_STATE_PR) {
|
else if(data->state == LV_INDEV_STATE_PR && last_state == LV_INDEV_STATE_PR) {
|
||||||
/* Long press*/
|
/* Long press*/
|
||||||
if(i->proc.long_pr_sent == 0 && lv_tick_elaps(i->proc.pr_timestamp) > i->driver.long_press_time) {
|
if(i->proc.long_pr_sent == 0 && lv_tick_elaps(i->proc.pr_timestamp) > i->driver.long_press_time) {
|
||||||
|
|
||||||
i->proc.long_pr_sent = 1;
|
i->proc.long_pr_sent = 1;
|
||||||
i->proc.longpr_rep_timestamp = lv_tick_get();
|
i->proc.longpr_rep_timestamp = lv_tick_get();
|
||||||
|
|
||||||
if (data->key == LV_KEY_ENTER) {
|
if(data->key == LV_KEY_ENTER) {
|
||||||
bool editable = false;
|
bool editable = false;
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable);
|
||||||
|
|
||||||
/*On enter long press toggle edit mode.*/
|
/*On enter long press toggle edit mode.*/
|
||||||
if(editable) {
|
if(editable) {
|
||||||
/*Don't leave edit mode if there is only one object (nowhere to navigate)*/
|
/*Don't leave edit mode if there is only one object (nowhere to navigate)*/
|
||||||
if(_lv_ll_is_empty(&g->obj_ll) == false) {
|
if(_lv_ll_is_empty(&g->obj_ll) == false) {
|
||||||
lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/
|
lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*If not editable then just send a long press signal*/
|
/*If not editable then just send a long press signal*/
|
||||||
else {
|
else {
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_LONG_PRESS, NULL);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_LONG_PRESS, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i->proc.long_pr_sent = 1;
|
i->proc.long_pr_sent = 1;
|
||||||
}
|
}
|
||||||
/*Long press repeated time has elapsed?*/
|
/*Long press repeated time has elapsed?*/
|
||||||
else if(i->proc.long_pr_sent != 0 && lv_tick_elaps(i->proc.longpr_rep_timestamp) > i->driver.long_press_rep_time) {
|
else if(i->proc.long_pr_sent != 0 && lv_tick_elaps(i->proc.longpr_rep_timestamp) > i->driver.long_press_rep_time) {
|
||||||
|
|
||||||
i->proc.longpr_rep_timestamp = lv_tick_get();
|
i->proc.longpr_rep_timestamp = lv_tick_get();
|
||||||
|
|
||||||
if(data->key == LV_KEY_ENTER) {
|
if(data->key == LV_KEY_ENTER) {
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_LONG_PRESS_REP, NULL);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_LONG_PRESS_REP, NULL);
|
||||||
@ -692,12 +695,14 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
|||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
}
|
}
|
||||||
else if(data->key == LV_KEY_LEFT) {
|
else if(data->key == LV_KEY_LEFT) {
|
||||||
/*emulate encoder left*/
|
/*emulate encoder left*/
|
||||||
data->enc_diff--;
|
data->enc_diff--;
|
||||||
} else if(data->key == LV_KEY_RIGHT) {
|
}
|
||||||
/*emulate encoder right*/
|
else if(data->key == LV_KEY_RIGHT) {
|
||||||
data->enc_diff++;
|
/*emulate encoder right*/
|
||||||
} else {
|
data->enc_diff++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
lv_group_send_data(g, data->key);
|
lv_group_send_data(g, data->key);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
}
|
}
|
||||||
@ -708,49 +713,49 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
|||||||
/*Release happened*/
|
/*Release happened*/
|
||||||
else if(data->state == LV_INDEV_STATE_REL && last_state == LV_INDEV_STATE_PR) {
|
else if(data->state == LV_INDEV_STATE_REL && last_state == LV_INDEV_STATE_PR) {
|
||||||
|
|
||||||
if (data->key == LV_KEY_ENTER) {
|
if(data->key == LV_KEY_ENTER) {
|
||||||
bool editable = false;
|
bool editable = false;
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable);
|
||||||
|
|
||||||
/*The button was released on a non-editable object. Just send enter*/
|
/*The button was released on a non-editable object. Just send enter*/
|
||||||
if(editable == false) {
|
if(editable == false) {
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
if(i->proc.long_pr_sent == 0) lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL);
|
if(i->proc.long_pr_sent == 0) lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
}
|
}
|
||||||
/*An object is being edited and the button is released. */
|
/*An object is being edited and the button is released. */
|
||||||
else if(g->editing) {
|
else if(g->editing) {
|
||||||
/*Ignore long pressed enter release because it comes from mode switch*/
|
/*Ignore long pressed enter release because it comes from mode switch*/
|
||||||
if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) {
|
if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) {
|
||||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL);
|
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL);
|
||||||
if(indev_reset_check(&i->proc)) return;
|
if(indev_reset_check(&i->proc)) return;
|
||||||
|
|
||||||
lv_group_send_data(g, LV_KEY_ENTER);
|
lv_group_send_data(g, LV_KEY_ENTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*If the focused object is editable and now in navigate mode then on enter switch edit
|
/*If the focused object is editable and now in navigate mode then on enter switch edit
|
||||||
mode*/
|
mode*/
|
||||||
else if(editable && !g->editing && !i->proc.long_pr_sent) {
|
else if(editable && !g->editing && !i->proc.long_pr_sent) {
|
||||||
lv_group_set_editing(g, true); /*Set edit mode*/
|
lv_group_set_editing(g, true); /*Set edit mode*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i->proc.pr_timestamp = 0;
|
i->proc.pr_timestamp = 0;
|
||||||
i->proc.long_pr_sent = 0;
|
i->proc.long_pr_sent = 0;
|
||||||
@ -758,7 +763,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
|||||||
indev_obj_act = NULL;
|
indev_obj_act = NULL;
|
||||||
|
|
||||||
/*if encoder steps or simulated steps via left/right keys*/
|
/*if encoder steps or simulated steps via left/right keys*/
|
||||||
if (data->enc_diff != 0) {
|
if(data->enc_diff != 0) {
|
||||||
/*In edit mode send LEFT/RIGHT keys*/
|
/*In edit mode send LEFT/RIGHT keys*/
|
||||||
if(lv_group_get_editing(g)) {
|
if(lv_group_get_editing(g)) {
|
||||||
int32_t s;
|
int32_t s;
|
||||||
@ -1211,15 +1216,16 @@ static void indev_click_focus(lv_indev_proc_t * proc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*Focus to the act. in its group*/
|
/*Focus to the act. in its group*/
|
||||||
if(g_act) {
|
if(g_act) {
|
||||||
lv_group_focus_obj(indev_obj_act);
|
lv_group_focus_obj(indev_obj_act);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
|
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(proc->types.pointer.last_pressed) {
|
if(proc->types.pointer.last_pressed) {
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include LV_THEME_DEFAULT_INCLUDE
|
#include LV_THEME_DEFAULT_INCLUDE
|
||||||
|
|
||||||
#if LV_USE_GPU_STM32_DMA2D
|
#if LV_USE_GPU_STM32_DMA2D
|
||||||
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
|
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
@ -1516,21 +1516,21 @@ void lv_obj_set_gesture_parent(lv_obj_t * obj, bool en)
|
|||||||
*/
|
*/
|
||||||
void lv_obj_set_focus_parent(lv_obj_t * obj, bool en)
|
void lv_obj_set_focus_parent(lv_obj_t * obj, bool en)
|
||||||
{
|
{
|
||||||
if (lv_obj_is_focused(obj)) {
|
if(lv_obj_is_focused(obj)) {
|
||||||
if (en) {
|
if(en) {
|
||||||
obj->focus_parent = 1;
|
obj->focus_parent = 1;
|
||||||
lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED);
|
lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED);
|
||||||
lv_obj_set_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED);
|
lv_obj_set_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lv_obj_clear_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED | LV_STATE_EDITED);
|
lv_obj_clear_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED | LV_STATE_EDITED);
|
||||||
lv_obj_set_state(obj, LV_STATE_FOCUSED);
|
lv_obj_set_state(obj, LV_STATE_FOCUSED);
|
||||||
obj->focus_parent = 0;
|
obj->focus_parent = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj->focus_parent = (en == true ? 1 : 0);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
obj->focus_parent = (en == true ? 1 : 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3650,10 +3650,10 @@ lv_obj_t * lv_obj_get_focused_obj(const lv_obj_t * obj)
|
|||||||
if(obj == NULL) return NULL;
|
if(obj == NULL) return NULL;
|
||||||
const lv_obj_t * focus_obj = obj;
|
const lv_obj_t * focus_obj = obj;
|
||||||
while(lv_obj_get_focus_parent(focus_obj) != false && focus_obj != NULL) {
|
while(lv_obj_get_focus_parent(focus_obj) != false && focus_obj != NULL) {
|
||||||
focus_obj = lv_obj_get_parent(focus_obj);
|
focus_obj = lv_obj_get_parent(focus_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (lv_obj_t*)focus_obj;
|
return (lv_obj_t *)focus_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -246,7 +246,8 @@ static inline void lv_style_set_pad_ver(lv_style_t * style, lv_state_t state, lv
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
|
static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t part, lv_state_t state,
|
||||||
|
lv_style_int_t value)
|
||||||
{
|
{
|
||||||
lv_obj_set_style_local_margin_top(obj, part, state, value);
|
lv_obj_set_style_local_margin_top(obj, part, state, value);
|
||||||
lv_obj_set_style_local_margin_bottom(obj, part, state, value);
|
lv_obj_set_style_local_margin_bottom(obj, part, state, value);
|
||||||
@ -264,7 +265,8 @@ static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
|
static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t part, lv_state_t state,
|
||||||
|
lv_style_int_t value)
|
||||||
{
|
{
|
||||||
lv_obj_set_style_local_margin_left(obj, part, state, value);
|
lv_obj_set_style_local_margin_left(obj, part, state, value);
|
||||||
lv_obj_set_style_local_margin_right(obj, part, state, value);
|
lv_obj_set_style_local_margin_right(obj, part, state, value);
|
||||||
@ -278,7 +280,8 @@ static inline void lv_style_set_margin_hor(lv_style_t * style, lv_state_t state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
|
static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t part, lv_state_t state,
|
||||||
|
lv_style_int_t value)
|
||||||
{
|
{
|
||||||
lv_obj_set_style_local_margin_top(obj, part, state, value);
|
lv_obj_set_style_local_margin_top(obj, part, state, value);
|
||||||
lv_obj_set_style_local_margin_bottom(obj, part, state, value);
|
lv_obj_set_style_local_margin_bottom(obj, part, state, value);
|
||||||
|
@ -36,10 +36,10 @@
|
|||||||
**********************/
|
**********************/
|
||||||
LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t * style, lv_style_property_t prop);
|
LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t * style, lv_style_property_t prop);
|
||||||
static lv_style_t * get_alloc_local_style(lv_style_list_t * list);
|
static lv_style_t * get_alloc_local_style(lv_style_list_t * list);
|
||||||
static inline void style_resize(lv_style_t *style, size_t sz);
|
static inline void style_resize(lv_style_t * style, size_t sz);
|
||||||
static inline lv_style_property_t get_style_prop(const lv_style_t *style, size_t idx);
|
static inline lv_style_property_t get_style_prop(const lv_style_t * style, size_t idx);
|
||||||
static inline uint8_t get_style_prop_id(const lv_style_t *style, size_t idx);
|
static inline uint8_t get_style_prop_id(const lv_style_t * style, size_t idx);
|
||||||
static inline uint8_t get_style_prop_attr(const lv_style_t *style, size_t idx);
|
static inline uint8_t get_style_prop_attr(const lv_style_t * style, size_t idx);
|
||||||
static inline size_t get_prop_size(uint8_t prop_id);
|
static inline size_t get_prop_size(uint8_t prop_id);
|
||||||
static inline size_t get_next_prop_index(uint8_t prop_id, size_t id);
|
static inline size_t get_next_prop_index(uint8_t prop_id, size_t id);
|
||||||
|
|
||||||
@ -1065,7 +1065,7 @@ LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t
|
|||||||
|
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
uint8_t prop_id;
|
uint8_t prop_id;
|
||||||
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
|
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
|
||||||
if(prop_id == id_to_find) {
|
if(prop_id == id_to_find) {
|
||||||
lv_style_attr_t attr_i;
|
lv_style_attr_t attr_i;
|
||||||
@ -1124,7 +1124,7 @@ static lv_style_t * get_alloc_local_style(lv_style_list_t * list)
|
|||||||
* @param style pointer to the style to be resized.
|
* @param style pointer to the style to be resized.
|
||||||
* @param size new size
|
* @param size new size
|
||||||
*/
|
*/
|
||||||
static inline void style_resize(lv_style_t *style, size_t sz)
|
static inline void style_resize(lv_style_t * style, size_t sz)
|
||||||
{
|
{
|
||||||
style->map = lv_mem_realloc(style->map, sz);
|
style->map = lv_mem_realloc(style->map, sz);
|
||||||
}
|
}
|
||||||
@ -1135,10 +1135,10 @@ static inline void style_resize(lv_style_t *style, size_t sz)
|
|||||||
* @param idx index of the style in style->map
|
* @param idx index of the style in style->map
|
||||||
* @return property in style->map + idx
|
* @return property in style->map + idx
|
||||||
*/
|
*/
|
||||||
static inline lv_style_property_t get_style_prop(const lv_style_t *style, size_t idx)
|
static inline lv_style_property_t get_style_prop(const lv_style_t * style, size_t idx)
|
||||||
{
|
{
|
||||||
lv_style_property_t prop;
|
lv_style_property_t prop;
|
||||||
uint8_t *prop_p = (uint8_t*)∝
|
uint8_t * prop_p = (uint8_t *)∝
|
||||||
prop_p[0] = style->map[idx];
|
prop_p[0] = style->map[idx];
|
||||||
prop_p[1] = style->map[idx + 1];
|
prop_p[1] = style->map[idx + 1];
|
||||||
return prop;
|
return prop;
|
||||||
@ -1150,7 +1150,7 @@ static inline lv_style_property_t get_style_prop(const lv_style_t *style, size_t
|
|||||||
* @param idx index of the style in style->map
|
* @param idx index of the style in style->map
|
||||||
* @return id of property in style->map + idx
|
* @return id of property in style->map + idx
|
||||||
*/
|
*/
|
||||||
static inline uint8_t get_style_prop_id(const lv_style_t *style, size_t idx)
|
static inline uint8_t get_style_prop_id(const lv_style_t * style, size_t idx)
|
||||||
{
|
{
|
||||||
return get_style_prop(style, idx) & 0xFF;
|
return get_style_prop(style, idx) & 0xFF;
|
||||||
}
|
}
|
||||||
@ -1161,7 +1161,7 @@ static inline uint8_t get_style_prop_id(const lv_style_t *style, size_t idx)
|
|||||||
* @param idx index of the style in style->map
|
* @param idx index of the style in style->map
|
||||||
* @return attribute of property in style->map + idx
|
* @return attribute of property in style->map + idx
|
||||||
*/
|
*/
|
||||||
static inline uint8_t get_style_prop_attr(const lv_style_t *style, size_t idx)
|
static inline uint8_t get_style_prop_attr(const lv_style_t * style, size_t idx)
|
||||||
{
|
{
|
||||||
return ((get_style_prop(style, idx) >> 8) & 0xFFU);
|
return ((get_style_prop(style, idx) >> 8) & 0xFFU);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
|
|||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
#if LV_USE_GPU || LV_USE_GPU_STM32_DMA2D
|
#if LV_USE_GPU || LV_USE_GPU_STM32_DMA2D
|
||||||
LV_ATTRIBUTE_DMA static lv_color_t blend_buf[LV_HOR_RES_MAX];
|
LV_ATTRIBUTE_DMA static lv_color_t blend_buf[LV_HOR_RES_MAX];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
@ -103,7 +103,7 @@ typedef uint8_t lv_img_cf_t;
|
|||||||
* LVGL image header
|
* LVGL image header
|
||||||
*/
|
*/
|
||||||
/* The first 8 bit is very important to distinguish the different source types.
|
/* The first 8 bit is very important to distinguish the different source types.
|
||||||
* For more info see `lv_img_get_src_type()` in lv_img.c
|
* For more info see `lv_img_get_src_type()` in lv_img.c
|
||||||
* On big endian systems the order is reversed so cf and always_zero must be at
|
* On big endian systems the order is reversed so cf and always_zero must be at
|
||||||
* the end of the struct.
|
* the end of the struct.
|
||||||
* */
|
* */
|
||||||
|
@ -174,7 +174,7 @@ LV_FONT_DECLARE(lv_font_montserrat_32)
|
|||||||
#if LV_FONT_MONTSERRAT_34
|
#if LV_FONT_MONTSERRAT_34
|
||||||
LV_FONT_DECLARE(lv_font_montserrat_34)
|
LV_FONT_DECLARE(lv_font_montserrat_34)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_FONT_MONTSERRAT_36
|
#if LV_FONT_MONTSERRAT_36
|
||||||
LV_FONT_DECLARE(lv_font_montserrat_36)
|
LV_FONT_DECLARE(lv_font_montserrat_36)
|
||||||
#endif
|
#endif
|
||||||
|
@ -194,10 +194,10 @@ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color
|
|||||||
DMA2D->BGOR = buf_w - copy_w;
|
DMA2D->BGOR = buf_w - copy_w;
|
||||||
|
|
||||||
DMA2D->FGPFCCR = (uint32_t)LV_DMA2D_COLOR_FORMAT
|
DMA2D->FGPFCCR = (uint32_t)LV_DMA2D_COLOR_FORMAT
|
||||||
/* alpha mode 2, replace with foreground * alpha value */
|
/* alpha mode 2, replace with foreground * alpha value */
|
||||||
| (2 << DMA2D_FGPFCCR_AM_Pos)
|
| (2 << DMA2D_FGPFCCR_AM_Pos)
|
||||||
/* alpha value */
|
/* alpha value */
|
||||||
| (opa << DMA2D_FGPFCCR_ALPHA_Pos);
|
| (opa << DMA2D_FGPFCCR_ALPHA_Pos);
|
||||||
DMA2D->FGMAR = (uint32_t)map;
|
DMA2D->FGMAR = (uint32_t)map;
|
||||||
DMA2D->FGOR = map_w - copy_w;
|
DMA2D->FGOR = map_w - copy_w;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ typedef struct {
|
|||||||
static uint32_t zero_mem; /*Give the address of this variable if 0 byte should be allocated*/
|
static uint32_t zero_mem; /*Give the address of this variable if 0 byte should be allocated*/
|
||||||
|
|
||||||
#if LV_MEM_CUSTOM == 0
|
#if LV_MEM_CUSTOM == 0
|
||||||
static uint32_t mem_max_size; /*Tracks the maximum total size of memory ever used from the internal heap*/
|
static uint32_t mem_max_size; /*Tracks the maximum total size of memory ever used from the internal heap*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint8_t mem_buf1_32[MEM_BUF_SMALL_SIZE];
|
static uint8_t mem_buf1_32[MEM_BUF_SMALL_SIZE];
|
||||||
@ -125,7 +125,7 @@ void _lv_mem_init(void)
|
|||||||
#else
|
#else
|
||||||
work_mem = (uint8_t *)LV_MEM_ADR;
|
work_mem = (uint8_t *)LV_MEM_ADR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lv_mem_ent_t * full = (lv_mem_ent_t *)work_mem;
|
lv_mem_ent_t * full = (lv_mem_ent_t *)work_mem;
|
||||||
full->header.s.used = 0;
|
full->header.s.used = 0;
|
||||||
/*The total mem size id reduced by the first header and the close patterns */
|
/*The total mem size id reduced by the first header and the close patterns */
|
||||||
@ -205,16 +205,17 @@ void * lv_mem_alloc(size_t size)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(alloc == NULL) {
|
if(alloc == NULL) {
|
||||||
LV_LOG_WARN("Couldn't allocate memory");
|
LV_LOG_WARN("Couldn't allocate memory");
|
||||||
}else{
|
}
|
||||||
#if LV_MEM_CUSTOM == 0
|
else {
|
||||||
/* just a safety check, should always be true */
|
#if LV_MEM_CUSTOM == 0
|
||||||
if ((uintptr_t) alloc > (uintptr_t) work_mem) {
|
/* just a safety check, should always be true */
|
||||||
if ((((uintptr_t) alloc - (uintptr_t) work_mem) + size) > mem_max_size) {
|
if((uintptr_t) alloc > (uintptr_t) work_mem) {
|
||||||
mem_max_size = ((uintptr_t) alloc - (uintptr_t) work_mem) + size;
|
if((((uintptr_t) alloc - (uintptr_t) work_mem) + size) > mem_max_size) {
|
||||||
|
mem_max_size = ((uintptr_t) alloc - (uintptr_t) work_mem) + size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return alloc;
|
return alloc;
|
||||||
|
@ -427,12 +427,12 @@ void lv_btnmatrix_set_one_check(lv_obj_t * btnm, bool one_chk)
|
|||||||
* @param btnm pointer to a btnmatrix object
|
* @param btnm pointer to a btnmatrix object
|
||||||
* @param align LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
* @param align LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
||||||
*/
|
*/
|
||||||
void lv_btnmatrix_set_align(lv_obj_t* btnm, lv_label_align_t align)
|
void lv_btnmatrix_set_align(lv_obj_t * btnm, lv_label_align_t align)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(btnm, LV_OBJX_NAME);
|
LV_ASSERT_OBJ(btnm, LV_OBJX_NAME);
|
||||||
|
|
||||||
lv_btnmatrix_ext_t* ext = lv_obj_get_ext_attr(btnm);
|
lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm);
|
||||||
if (ext->align == align) return;
|
if(ext->align == align) return;
|
||||||
|
|
||||||
ext->align = align;
|
ext->align = align;
|
||||||
|
|
||||||
@ -585,18 +585,18 @@ bool lv_btnmatrix_get_one_check(const lv_obj_t * btnm)
|
|||||||
* @param btnm pointer to a btnmatrix object
|
* @param btnm pointer to a btnmatrix object
|
||||||
* @return LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
* @return LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
||||||
*/
|
*/
|
||||||
lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t* btnm)
|
lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t * btnm)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(btnm, LV_OBJX_NAME);
|
LV_ASSERT_OBJ(btnm, LV_OBJX_NAME);
|
||||||
|
|
||||||
lv_btnmatrix_ext_t* ext = lv_obj_get_ext_attr(btnm);
|
lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm);
|
||||||
|
|
||||||
lv_label_align_t align = ext->align;
|
lv_label_align_t align = ext->align;
|
||||||
|
|
||||||
if (align == LV_LABEL_ALIGN_AUTO) {
|
if(align == LV_LABEL_ALIGN_AUTO) {
|
||||||
#if LV_USE_BIDI
|
#if LV_USE_BIDI
|
||||||
lv_bidi_dir_t base_dir = lv_obj_get_base_dir(btnm);
|
lv_bidi_dir_t base_dir = lv_obj_get_base_dir(btnm);
|
||||||
if (base_dir == LV_BIDI_DIR_RTL) align = LV_LABEL_ALIGN_RIGHT;
|
if(base_dir == LV_BIDI_DIR_RTL) align = LV_LABEL_ALIGN_RIGHT;
|
||||||
else align = LV_LABEL_ALIGN_LEFT;
|
else align = LV_LABEL_ALIGN_LEFT;
|
||||||
#else
|
#else
|
||||||
align = LV_LABEL_ALIGN_LEFT;
|
align = LV_LABEL_ALIGN_LEFT;
|
||||||
@ -641,10 +641,10 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
|||||||
uint16_t btn_i = 0;
|
uint16_t btn_i = 0;
|
||||||
uint16_t txt_i = 0;
|
uint16_t txt_i = 0;
|
||||||
lv_txt_flag_t txt_flag = LV_TXT_FLAG_NONE;
|
lv_txt_flag_t txt_flag = LV_TXT_FLAG_NONE;
|
||||||
if (ext->recolor) txt_flag |= LV_TXT_FLAG_RECOLOR;
|
if(ext->recolor) txt_flag |= LV_TXT_FLAG_RECOLOR;
|
||||||
lv_label_align_t align = lv_btnmatrix_get_align(btnm);
|
lv_label_align_t align = lv_btnmatrix_get_align(btnm);
|
||||||
if (align == LV_LABEL_ALIGN_CENTER) txt_flag |= LV_TXT_FLAG_CENTER;
|
if(align == LV_LABEL_ALIGN_CENTER) txt_flag |= LV_TXT_FLAG_CENTER;
|
||||||
if (align == LV_LABEL_ALIGN_RIGHT) txt_flag |= LV_TXT_FLAG_RIGHT;
|
if(align == LV_LABEL_ALIGN_RIGHT) txt_flag |= LV_TXT_FLAG_RIGHT;
|
||||||
|
|
||||||
lv_draw_rect_dsc_t draw_rect_rel_dsc;
|
lv_draw_rect_dsc_t draw_rect_rel_dsc;
|
||||||
lv_draw_label_dsc_t draw_label_rel_dsc;
|
lv_draw_label_dsc_t draw_label_rel_dsc;
|
||||||
|
@ -170,13 +170,13 @@ void lv_btnmatrix_set_btn_width(lv_obj_t * btnm, uint16_t btn_id, uint8_t width)
|
|||||||
* @param one_chk Whether "one check" mode is enabled
|
* @param one_chk Whether "one check" mode is enabled
|
||||||
*/
|
*/
|
||||||
void lv_btnmatrix_set_one_check(lv_obj_t * btnm, bool one_chk);
|
void lv_btnmatrix_set_one_check(lv_obj_t * btnm, bool one_chk);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the align of the map text (left, right or center)
|
* Set the align of the map text (left, right or center)
|
||||||
* @param btnm pointer to a btnmatrix object
|
* @param btnm pointer to a btnmatrix object
|
||||||
* @param align LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
* @param align LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
||||||
*/
|
*/
|
||||||
void lv_btnmatrix_set_align(lv_obj_t* btnm, lv_label_align_t align);
|
void lv_btnmatrix_set_align(lv_obj_t * btnm, lv_label_align_t align);
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Getter functions
|
* Getter functions
|
||||||
@ -244,14 +244,14 @@ bool lv_btnmatrix_get_btn_ctrl(lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ct
|
|||||||
* @return whether "one toggle" mode is enabled
|
* @return whether "one toggle" mode is enabled
|
||||||
*/
|
*/
|
||||||
bool lv_btnmatrix_get_one_check(const lv_obj_t * btnm);
|
bool lv_btnmatrix_get_one_check(const lv_obj_t * btnm);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the align attribute
|
* Get the align attribute
|
||||||
* @param btnm pointer to a btnmatrix object
|
* @param btnm pointer to a btnmatrix object
|
||||||
* @return LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
* @return LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER
|
||||||
*/
|
*/
|
||||||
lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t* btnm);
|
lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t * btnm);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
@ -577,15 +577,15 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint32_t char_id, lv_point_
|
|||||||
if(txt[0] == '\0') {
|
if(txt[0] == '\0') {
|
||||||
pos->y = 0;
|
pos->y = 0;
|
||||||
switch(align) {
|
switch(align) {
|
||||||
case LV_LABEL_ALIGN_LEFT:
|
case LV_LABEL_ALIGN_LEFT:
|
||||||
pos->x = 0;
|
pos->x = 0;
|
||||||
break;
|
break;
|
||||||
case LV_LABEL_ALIGN_RIGHT:
|
case LV_LABEL_ALIGN_RIGHT:
|
||||||
pos->x = lv_obj_get_width(label);
|
pos->x = lv_obj_get_width(label);
|
||||||
break;
|
break;
|
||||||
case LV_LABEL_ALIGN_CENTER:
|
case LV_LABEL_ALIGN_CENTER:
|
||||||
pos->x = lv_obj_get_width(label) / 2;
|
pos->x = lv_obj_get_width(label) / 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -470,7 +470,7 @@ int32_t lv_list_get_btn_index(const lv_obj_t * list, const lv_obj_t * btn)
|
|||||||
list = lv_obj_get_parent(lv_obj_get_parent(btn));
|
list = lv_obj_get_parent(lv_obj_get_parent(btn));
|
||||||
}
|
}
|
||||||
LV_ASSERT_OBJ(list, LV_OBJX_NAME);
|
LV_ASSERT_OBJ(list, LV_OBJX_NAME);
|
||||||
|
|
||||||
lv_obj_t * e = lv_list_get_next_btn(list, NULL);
|
lv_obj_t * e = lv_list_get_next_btn(list, NULL);
|
||||||
while(e != NULL) {
|
while(e != NULL) {
|
||||||
if(e == btn) {
|
if(e == btn) {
|
||||||
|
@ -264,14 +264,14 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
|
|||||||
lv_slider_ext_t * ext = lv_obj_get_ext_attr(slider);
|
lv_slider_ext_t * ext = lv_obj_get_ext_attr(slider);
|
||||||
|
|
||||||
/* Advanced hit testing: react only on dragging the knob(s) */
|
/* Advanced hit testing: react only on dragging the knob(s) */
|
||||||
if (sign == LV_SIGNAL_HIT_TEST) {
|
if(sign == LV_SIGNAL_HIT_TEST) {
|
||||||
lv_hit_test_info_t *info = param;
|
lv_hit_test_info_t * info = param;
|
||||||
|
|
||||||
/* Ordinary slider: was the knob area hit? */
|
/* Ordinary slider: was the knob area hit? */
|
||||||
info->result = _lv_area_is_point_on(&ext->right_knob_area, info->point, 0);
|
info->result = _lv_area_is_point_on(&ext->right_knob_area, info->point, 0);
|
||||||
|
|
||||||
/* There's still a change we have a hit, if we have another knob */
|
/* There's still a change we have a hit, if we have another knob */
|
||||||
if ((info->result == false) && (type == LV_SLIDER_TYPE_RANGE)) {
|
if((info->result == false) && (type == LV_SLIDER_TYPE_RANGE)) {
|
||||||
info->result = _lv_area_is_point_on(&ext->left_knob_area, info->point, 0);
|
info->result = _lv_area_is_point_on(&ext->left_knob_area, info->point, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,16 +231,16 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
|
|||||||
|
|
||||||
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
|
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
|
||||||
|
|
||||||
const char *letter_buf;
|
const char * letter_buf;
|
||||||
|
|
||||||
uint32_t u32_buf[2];
|
uint32_t u32_buf[2];
|
||||||
u32_buf[0] = c;
|
u32_buf[0] = c;
|
||||||
u32_buf[1] = 0;
|
u32_buf[1] = 0;
|
||||||
|
|
||||||
letter_buf = (char*)&u32_buf;
|
letter_buf = (char *)&u32_buf;
|
||||||
|
|
||||||
#if LV_BIG_ENDIAN_SYSTEM
|
#if LV_BIG_ENDIAN_SYSTEM
|
||||||
if (c != 0) while (*letter_buf == 0) ++letter_buf;
|
if(c != 0) while(*letter_buf == 0) ++letter_buf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ta_insert_replace = NULL;
|
ta_insert_replace = NULL;
|
||||||
|
@ -34,8 +34,8 @@ typedef struct {
|
|||||||
} lv_win_btn_ext_t;
|
} lv_win_btn_ext_t;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
LV_WIN_BTN_ALIGN_RIGHT = 0, /**< Align button to right of the header */
|
LV_WIN_BTN_ALIGN_RIGHT = 0, /**< Align button to right of the header */
|
||||||
LV_WIN_BTN_ALIGN_LEFT /**< Align button to left of the header */
|
LV_WIN_BTN_ALIGN_LEFT /**< Align button to left of the header */
|
||||||
};
|
};
|
||||||
typedef uint8_t lv_win_btn_align_t;
|
typedef uint8_t lv_win_btn_align_t;
|
||||||
|
|
||||||
@ -559,7 +559,7 @@ static lv_design_res_t lv_win_header_design(lv_obj_t * header, const lv_area_t *
|
|||||||
lv_coord_t left_btn_offset = 0;
|
lv_coord_t left_btn_offset = 0;
|
||||||
btn = lv_obj_get_child_back(ext->header, NULL);
|
btn = lv_obj_get_child_back(ext->header, NULL);
|
||||||
while(btn != NULL) {
|
while(btn != NULL) {
|
||||||
if (LV_WIN_BTN_ALIGN_LEFT == lv_win_btn_get_alignment(btn)) {
|
if(LV_WIN_BTN_ALIGN_LEFT == lv_win_btn_get_alignment(btn)) {
|
||||||
left_btn_offset += btn_w + header_inner;
|
left_btn_offset += btn_w + header_inner;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,26 +716,28 @@ static void lv_win_realign(lv_obj_t * win)
|
|||||||
lv_obj_set_size(btn, btn_w, btn_h);
|
lv_obj_set_size(btn, btn_w, btn_h);
|
||||||
uint8_t btn_alignment = lv_win_btn_get_alignment(btn);
|
uint8_t btn_alignment = lv_win_btn_get_alignment(btn);
|
||||||
|
|
||||||
if (LV_WIN_BTN_ALIGN_RIGHT == btn_alignment) {
|
if(LV_WIN_BTN_ALIGN_RIGHT == btn_alignment) {
|
||||||
if (is_header_right_side_empty) {
|
if(is_header_right_side_empty) {
|
||||||
/* Align the button to the right of the header */
|
/* Align the button to the right of the header */
|
||||||
lv_obj_align(btn, ext->header, LV_ALIGN_IN_RIGHT_MID, -header_right, 0);
|
lv_obj_align(btn, ext->header, LV_ALIGN_IN_RIGHT_MID, -header_right, 0);
|
||||||
|
|
||||||
is_header_right_side_empty = false;
|
is_header_right_side_empty = false;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/* Align the button to the left of the previous button */
|
/* Align the button to the left of the previous button */
|
||||||
lv_obj_align(btn, btn_prev_at_right, LV_ALIGN_OUT_LEFT_MID, -header_inner, 0);
|
lv_obj_align(btn, btn_prev_at_right, LV_ALIGN_OUT_LEFT_MID, -header_inner, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
btn_prev_at_right = btn;
|
btn_prev_at_right = btn;
|
||||||
}
|
}
|
||||||
else if (LV_WIN_BTN_ALIGN_LEFT == btn_alignment) {
|
else if(LV_WIN_BTN_ALIGN_LEFT == btn_alignment) {
|
||||||
if (is_header_left_side_empty) {
|
if(is_header_left_side_empty) {
|
||||||
/* Align the button to the right of the header */
|
/* Align the button to the right of the header */
|
||||||
lv_obj_align(btn, ext->header, LV_ALIGN_IN_LEFT_MID, header_left, 0);
|
lv_obj_align(btn, ext->header, LV_ALIGN_IN_LEFT_MID, header_left, 0);
|
||||||
|
|
||||||
is_header_left_side_empty = false;
|
is_header_left_side_empty = false;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/* Align the button to the right of the previous button */
|
/* Align the button to the right of the previous button */
|
||||||
lv_obj_align(btn, btn_prev_at_left, LV_ALIGN_OUT_RIGHT_MID, header_inner, 0);
|
lv_obj_align(btn, btn_prev_at_left, LV_ALIGN_OUT_RIGHT_MID, header_inner, 0);
|
||||||
}
|
}
|
||||||
@ -754,11 +756,11 @@ static void lv_win_realign(lv_obj_t * win)
|
|||||||
|
|
||||||
static lv_obj_t * lv_win_btn_create(lv_obj_t * par, const void * img_src)
|
static lv_obj_t * lv_win_btn_create(lv_obj_t * par, const void * img_src)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("win btn create started");
|
LV_LOG_TRACE("win btn create started");
|
||||||
|
|
||||||
lv_obj_t * win_btn;
|
lv_obj_t * win_btn;
|
||||||
|
|
||||||
win_btn = lv_btn_create(par, NULL);
|
win_btn = lv_btn_create(par, NULL);
|
||||||
LV_ASSERT_MEM(win_btn);
|
LV_ASSERT_MEM(win_btn);
|
||||||
if(win_btn == NULL) return NULL;
|
if(win_btn == NULL) return NULL;
|
||||||
|
|
||||||
@ -785,7 +787,7 @@ static lv_obj_t * lv_win_btn_create(lv_obj_t * par, const void * img_src)
|
|||||||
|
|
||||||
LV_LOG_INFO("win btn created");
|
LV_LOG_INFO("win btn created");
|
||||||
|
|
||||||
return win_btn;
|
return win_btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_win_btn_set_alignment(lv_obj_t * win_btn, const uint8_t alignment)
|
static void lv_win_btn_set_alignment(lv_obj_t * win_btn, const uint8_t alignment)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user