Compare commits

...

272 Commits

Author SHA1 Message Date
Gabor Kiss-Vamosi
51f95f3286 Release v7.8.0 2020-12-01 15:08:50 +01:00
Carlos Diaz
bf08ff444e Update Kconfig. (#1917)
* Kconfig: Add missing _HEX to LV_COLOR_TRANSP option.

* lv_conf_checker: Define LV_CONF_SKIP if CONFIG_LV_CONF_SKIP is defined.

* fix(indev): disabled object shouldn't absorb clicks but let the parent to be clicked

* Update README.md

* fix(arabic): support processing again alraedy processed texts with _lv_txt_ap_proc

* fix(textarea): support Arabic letter connections

fixes #1888

* Fix #1924: incorrect date on changelog

December 1st is two weeks from 7.7.2 release.

* Kconfig: Fix LV_CONF_MINIMAL related options.

* fix(arabic): support Arabic letter connections

fixes #1920

* fix(arabic): support Arabic letter connections in value string property

* Update CHANGELOG.md

* Update CHANGELOG.md

* Kconfig: Add Zephyr specific code.

* fix: fix double include in lv_obj.c

fix #1926

* Removed trailing semi-colon from macros (#1928)

* Removed commented out test definition

Removed commented out test definition LV_BUILD_TEST

* Remove blank line

* Fix comment spelling

* Added blank line

* Removed trailing semi-colon in macros

* fix(indev): in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too

Fixes https://forum.lvgl.io/t/bug-in-indev-button-proc-misses-buttons-that-are-pressed-for-a-single-callback/3699

* fix(arc): make arc work with encoder

fixes https://forum.lvgl.io/t/lv-arc-with-encoder-lv-group/3769

* fix(slider): adjusting the left knob too with encoder

https://forum.lvgl.io/t/slider-with-2-knobs-and-encoder-functionality/3770

* fix(arc_draw): remove statments that do nothing

fix #1930

* Change LV_DRAW_BUF_MAX_NUM to LV_MEM_BUF_MAX_NUM (#1931)

* Update CHANGELOG.md

* fix(draw polygon): join adjacent points if they are on the same coordinate

* fix(draw polygon): fix memory leak and vertex joining

* fix(style): invalidate cache on every PART

Inherited properties on parts other than MAIN  needs to be recached on property change beacuse they
are inherted from MAIN

fixes #1933

* fix(anim): fix bounce path

* fix(slider): do not let edit left knob in non-range mode

* Update ROADMAP.md

* Fix hardfault when DCache is disabled with no callback (#1935)

* fix(linemeter): fix invalidation when setting new value

The old complex but more optimal invalidation was buggy in some cases

fixes #1904

* fix(linemeter): fix invalidation when setting new value

The old complex but more optimal invalidation was buggy in some cases

fixes #1904

* fix(table): add missing invalidation when changeing cell type

fixes https://forum.lvgl.io/t/bug-of-table-click-to-change-style/3842

* CMakeLists.txt: Let the user configure whether LV_ATTRIBUTE_FAST_MEM is IRAM_ATTR (#1939)

* fix(slider): fix left/right knob control with encoder

* fix(img): increase the size of invalidated area in lv_img_set_zoom

Becasue of the pivot placement there can be some rounding errors

* feat(perf_monitor): add lv_refr_get_fps_avg()

* Add 8px and 10px montserrat fonts to build (#1941)

* Fix #1942: lv_textarea_set_pwd_mode not changing to bullets

Thanks to @fvanroie for investigating.

* fix(material): make button pressed color darker (#1940)

* simplify touch handling in the Arduino example

* Update ROADMAP.md

* Update ROADMAP.md

* feat(lv_conf_kconfig): add LV_CONF_KCONFIG_EXTERNAL_INCLUDE

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
Co-authored-by: xennex22 <25083624+xennex22@users.noreply.github.com>
Co-authored-by: incity <610455681@qq.com>
Co-authored-by: Andrey <spirit@spirit.re>
Co-authored-by: defogprog <22955033+defogprog@users.noreply.github.com>
2020-12-01 15:04:20 +01:00
Gabor Kiss-Vamosi
41b1a7ea15 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-12-01 12:51:53 +01:00
Gabor Kiss-Vamosi
4e5b262401 refactor(roller): rename LV_ROLLER_MODE_INIFINITE -> LV_ROLLER_MODE_INFINITE 2020-12-01 12:50:42 +01:00
Gabor Kiss-Vamosi
c52482efa2 Update ROADMAP.md 2020-12-01 12:19:45 +01:00
Gabor Kiss-Vamosi
5b09c3879d Update ROADMAP.md 2020-12-01 12:15:59 +01:00
Gabor Kiss-Vamosi
e43d6da389 simplify touch handling in the Arduino example 2020-12-01 11:40:21 +01:00
embeddedt
73f4156aad fix(material): make button pressed color darker (#1940) 2020-12-01 11:25:43 +01:00
embeddedt
bc2ca71bf5 Fix #1942: lv_textarea_set_pwd_mode not changing to bullets
Thanks to @fvanroie for investigating.
2020-11-28 19:57:14 -05:00
defogprog
b1a7dbadcd Add 8px and 10px montserrat fonts to build (#1941) 2020-11-28 12:19:46 -05:00
Gabor Kiss-Vamosi
1b37ee8873 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-28 12:41:23 +01:00
Gabor Kiss-Vamosi
9c5fec9b79 feat(perf_monitor): add lv_refr_get_fps_avg() 2020-11-28 12:41:06 +01:00
Gabor Kiss-Vamosi
65f7ff66d5 fix(img): increase the size of invalidated area in lv_img_set_zoom
Becasue of the pivot placement there can be some rounding errors
2020-11-28 12:38:48 +01:00
Gabor Kiss-Vamosi
dded9b383a fix(slider): fix left/right knob control with encoder 2020-11-28 12:37:26 +01:00
Carlos Diaz
3c55dfb672 CMakeLists.txt: Let the user configure whether LV_ATTRIBUTE_FAST_MEM is IRAM_ATTR (#1939) 2020-11-27 13:17:15 -05:00
Gabor Kiss-Vamosi
9797c555c0 fix conflits 2020-11-27 11:15:08 +01:00
Gabor Kiss-Vamosi
87e26d4997 fix(table): add missing invalidation when changeing cell type
fixes https://forum.lvgl.io/t/bug-of-table-click-to-change-style/3842
2020-11-27 11:14:36 +01:00
Gabor Kiss-Vamosi
6c62a8eeb5 fix(linemeter): fix invalidation when setting new value
The old complex but more optimal invalidation was buggy in some cases

fixes #1904
2020-11-27 09:49:10 +01:00
Gabor Kiss-Vamosi
4853eacfa4 fix(linemeter): fix invalidation when setting new value
The old complex but more optimal invalidation was buggy in some cases

fixes #1904
2020-11-27 09:48:59 +01:00
Andrey
48a676f404 Fix hardfault when DCache is disabled with no callback (#1935) 2020-11-26 19:12:21 -05:00
Gabor Kiss-Vamosi
2f6eaa516c Update ROADMAP.md 2020-11-26 15:54:39 +01:00
Gabor Kiss-Vamosi
5e8581a345 fix(slider): do not let edit left knob in non-range mode 2020-11-26 15:30:50 +01:00
Gabor Kiss-Vamosi
d6d5903be1 fix(anim): fix bounce path 2020-11-26 15:23:50 +01:00
Gabor Kiss-Vamosi
313f7f30a7 fix(style): invalidate cache on every PART
Inherited properties on parts other than MAIN  needs to be recached on property change beacuse they
are inherted from MAIN

fixes #1933
2020-11-26 15:23:50 +01:00
Gabor Kiss-Vamosi
89eca30da8 fix(draw polygon): fix memory leak and vertex joining 2020-11-26 15:23:50 +01:00
Gabor Kiss-Vamosi
819f01c930 fix(draw polygon): join adjacent points if they are on the same coordinate 2020-11-26 15:23:50 +01:00
embeddedt
8cd738eaa1 Update CHANGELOG.md 2020-11-25 12:22:11 -05:00
incity
d6dd6199f3 Change LV_DRAW_BUF_MAX_NUM to LV_MEM_BUF_MAX_NUM (#1931) 2020-11-25 12:21:22 -05:00
Gabor Kiss-Vamosi
9d0335f38c fix(arc_draw): remove statments that do nothing
fix #1930
2020-11-25 11:35:12 +01:00
Gabor Kiss-Vamosi
82fdfb34c0 fix(slider): adjusting the left knob too with encoder
https://forum.lvgl.io/t/slider-with-2-knobs-and-encoder-functionality/3770
2020-11-25 10:12:58 +01:00
Gabor Kiss-Vamosi
a2535fe6f1 fix(arc): make arc work with encoder
fixes https://forum.lvgl.io/t/lv-arc-with-encoder-lv-group/3769
2020-11-25 09:56:24 +01:00
Gabor Kiss-Vamosi
fa49f35b14 fix(indev): in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too
Fixes https://forum.lvgl.io/t/bug-in-indev-button-proc-misses-buttons-that-are-pressed-for-a-single-callback/3699
2020-11-25 09:48:37 +01:00
xennex22
bc369de6fa Removed trailing semi-colon from macros (#1928)
* Removed commented out test definition

Removed commented out test definition LV_BUILD_TEST

* Remove blank line

* Fix comment spelling

* Added blank line

* Removed trailing semi-colon in macros
2020-11-24 18:16:16 +01:00
Gabor Kiss-Vamosi
3d81bb40da fix: fix double include in lv_obj.c
fix #1926
2020-11-24 15:27:42 +01:00
Gabor Kiss-Vamosi
5848aa59e5 Update CHANGELOG.md 2020-11-23 14:06:27 +01:00
Gabor Kiss-Vamosi
68300a5dec Update CHANGELOG.md 2020-11-23 13:24:34 +01:00
Gabor Kiss-Vamosi
07a95b5b33 fix(arabic): support Arabic letter connections in value string property 2020-11-23 13:12:13 +01:00
Gabor Kiss-Vamosi
d90cbe92de fix(arabic): support Arabic letter connections
fixes #1920
2020-11-23 13:12:13 +01:00
embeddedt
45599c2c2a Fix #1924: incorrect date on changelog
December 1st is two weeks from 7.7.2 release.
2020-11-22 15:01:37 -05:00
Gabor Kiss-Vamosi
85b3e8766f Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-21 23:53:15 +01:00
Gabor Kiss-Vamosi
07c63b8ad3 fix(textarea): support Arabic letter connections
fixes #1888
2020-11-21 23:53:05 +01:00
Gabor Kiss-Vamosi
8361d89a55 fix(arabic): support processing again alraedy processed texts with _lv_txt_ap_proc 2020-11-21 23:51:57 +01:00
embeddedt
510bc7ca11 Update README.md 2020-11-21 15:45:11 -05:00
Gabor Kiss-Vamosi
440c79e40c fix(indev): disabled object shouldn't absorb clicks but let the parent to be clicked 2020-11-21 20:54:39 +01:00
Gabor Kiss-Vamosi
baa1f848b1 Update ROADMAP.md 2020-11-19 17:21:52 +01:00
Gabor Kiss-Vamosi
522e975a4e fix(btnmatrix): fix seg. fault with arabic text processing 2020-11-19 11:49:34 +01:00
Gabor Kiss-Vamosi
e511fe53c9 Update ROADMAP.md 2020-11-18 13:52:01 +01:00
Gabor Kiss-Vamosi
4903bdb908 fix(btnmatrix): handle arabic texts in button matrices 2020-11-17 12:12:19 +01:00
Gabor Kiss-Vamosi
6b99545e50 fix(release): minor fixes in the release script 2020-11-17 12:02:32 +01:00
Gabor Kiss-Vamosi
70438d158d Merge branch 'master' into dev 2020-11-17 11:29:58 +01:00
Gabor Kiss-Vamosi
52f52397cb Release v7.7.2 2020-11-17 11:29:58 +01:00
Gabor Kiss-Vamosi
94a25b86a8 fix confilcts 2020-11-17 11:15:14 +01:00
Gabor Kiss-Vamosi
3979024660 fix(spinbox): update cursor position in lv_spinbox_set_step
fix #1907
2020-11-17 10:52:33 +01:00
Carlos Diaz
16567f5705 Add Kconfig (#1875)
* Kconfig: Add first revision of Kconfig.

* Kconfig: Let the user edit LV_COLOR_TRANSP directly.

* Kconfig: Define CONFIG_LV_CONF_SKIP.

* Kconfig: Let the user edit LV_THEME_DEFAULT_COLOR_PRIMARY and LV_THEME_DEFAULT_COLOR_SECONDARY directly.

* Kconfig: add LV_CONF_MINIMAL

* Kconfig: Expose LV_CONF_MINIMAL option.

* Kconfig: Fix LV_CONF_SKIP missing type.

* Remove garbage files

* lv_conf_kconfig: Fix wrong check for LV_THEME_DEFAULT_COLOR_PRIMARY and SECONDARY symbols.

* Add Unscii 16 options.

* Multiply LV_MEM_SIZE by 1024

* Fix message on API compability options

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-11-16 12:49:48 +01:00
github-actions[bot]
0b79b1690f Merge 4f0beee01b into dev 2020-11-15 12:50:02 +00:00
Tim Gates
4f0beee01b docs: fix simple typo, obejct -> object (#1900)
There is a small typo in src/lv_core/lv_obj.c, src/lv_core/lv_obj.h.

Should read `object` rather than `obejct`.
2020-11-15 07:49:31 -05:00
github-actions[bot]
d018558134 Merge 6060d4d1f6 into dev 2020-11-13 22:16:32 +00:00
Gabor Kiss-Vamosi
6060d4d1f6 fix(list): in lv_list remove clean last_sel_btn and act_sel_btn only if arelated button was deleted
related to #1895
2020-11-13 23:15:46 +01:00
github-actions[bot]
0c6a627b92 Merge 54883792e1 into dev 2020-11-13 15:29:55 +00:00
Gabor Kiss-Vamosi
54883792e1 fix(list): fix compiler error if LV_USE_GROUP = 0 2020-11-13 16:29:18 +01:00
github-actions[bot]
e2f96b9007 Merge 20fef93fea into dev 2020-11-13 15:21:10 +00:00
Gabor Kiss-Vamosi
20fef93fea fix(list): fix removing list elements
remove the button from last_sel_btn adn act_sel_btn
related to #1895
2020-11-13 16:20:11 +01:00
Gabor Kiss-Vamosi
63dfe9e8e3 fix(imgbtn): guess a the closest availabe state with valid src 2020-11-13 16:18:34 +01:00
Gabor Kiss-Vamosi
0ae70c027b fix(anim): tune overshoth path 2020-11-13 15:57:38 +01:00
github-actions[bot]
3e404b1583 Merge 43771fa2f7 into dev 2020-11-11 12:22:27 +00:00
Gabor Kiss-Vamosi
43771fa2f7 fix(theme_material): remove the bottom border from tabview header
If the tabs were placed to the bottom the bottom border looked like gap on the bottom

fix #1882
2020-11-11 13:21:40 +01:00
github-actions[bot]
34635da14c Merge b79d615ae8 into dev 2020-11-11 11:30:19 +00:00
iDalink
b79d615ae8 look ahead chars when be in LV_LABEL_LONG_DOT (#1881)
Co-authored-by: Dalink <Dalink@gitee.com>
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-11-11 12:29:51 +01:00
github-actions[bot]
af27c16793 Merge 945f5900d5 into dev 2020-11-10 21:07:35 +00:00
Gabor Kiss-Vamosi
945f5900d5 fix(arc): update knob position when bg_angle(s) changes 2020-11-10 22:06:58 +01:00
github-actions[bot]
24340fa927 Merge a7c4fc410a into dev 2020-11-10 21:00:26 +00:00
Gabor Kiss-Vamosi
a7c4fc410a fix(arc): fix and improve arc dragging
It was difficult to handle the pressed angle on the arc when it crossed the 360 degree boundery.
The solution is to handle the angle relative to the bg_start_angle. This way no angle can be larger than 360.
The other issue was the case when a smaller than min. or larger than max. angle was pressed.
It is handled by introducing 'min_close' flag which stores which end is closer on the last valid press
and prefer this end in uncleary situation.
2020-11-10 21:59:37 +01:00
github-actions[bot]
08fcf03c3f Merge 93138759a9 into dev 2020-11-10 16:26:09 +00:00
Gabor Kiss-Vamosi
93138759a9 fix(btnmatrix): fix setting the same map with modified pointers
fix #1889
2020-11-10 17:25:17 +01:00
Gabor Kiss-Vamosi
380df4578e fix(lv_font_unscii_16) use relative include path to lvgl.h 2020-11-10 10:18:08 +01:00
github-actions[bot]
71619aa8f6 Merge a07583331e into dev 2020-11-09 15:12:28 +00:00
Gabor Kiss-Vamosi
a07583331e docs(changelog): update changelog 2020-11-09 16:11:48 +01:00
github-actions[bot]
2afd887fdf Merge 1bc1d278eb into dev 2020-11-09 15:11:28 +00:00
Gabor Kiss-Vamosi
1bc1d278eb fix(draw_triangle): fix polygon/triangle drawing when the order of points is counter-clockwise 2020-11-09 16:10:46 +01:00
github-actions[bot]
fc5709d04c Merge b3c9096830 into dev 2020-11-09 12:13:49 +00:00
Gabor Kiss-Vamosi
b3c9096830 Use copy of va_list rather than original va_list in txt_set_text_vfmt (#1890)
Fix issue #1886

Co-authored-by: Wenting Zhang <zephray@outlook.com>
2020-11-09 13:13:18 +01:00
github-actions[bot]
74efc2e73e Merge 85c5e786a4 into dev 2020-11-09 09:30:43 +00:00
Gabor Kiss-Vamosi
85c5e786a4 fix(library.json) set the version to the last release
platform.io haven't recognized the last version
https://forum.lvgl.io/t/platformio-repository-for-lvgl-not-updating/3607
2020-11-09 10:30:14 +01:00
github-actions[bot]
8a489b3a8e Merge b19fb8620f into dev 2020-11-06 08:51:06 +00:00
Maureen Helm
b19fb8620f lv_font: Fix compiler warning when compressed fonts are disabled (#1880)
Fixes a compiler warning in lv_font_fmt_txt.c when compressed fonts are
disabled (LV_USE_FONT_COMPRESSED=0):

/home/maureen/zephyrproject/modules/lib/gui/lvgl/src/lv_font/lv_font_fmt_txt.c:349:13: warning: 'decompress' defined but not used [-Wunused-function]
  349 | static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter)
      |             ^~~~~~~~~~

This was found after upgrading Zephyr to use LVGL v7.6.1, building with
the Zephyr SDK 0.11.3 toolchain.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-06 09:50:32 +01:00
Gabor Kiss-Vamosi
2d986871c9 fix(lv_conf_internal): re-generate to add LV_FONT_UNSCII_16 2020-11-05 12:42:20 +01:00
Gabor Kiss-Vamosi
ef81e0fbc3 feat(font): add unscii-16 built-in font
https://forum.lvgl.io/t/more-unscii-font-version/3433
2020-11-05 12:38:44 +01:00
Gabor Kiss-Vamosi
b00628e77d merge master 2020-11-03 11:04:34 +01:00
Gabor Kiss-Vamosi
d110731409 add v7.7.2 to changelog 2020-11-03 11:03:26 +01:00
Gabor Kiss-Vamosi
92c75a6e8c minor release script fixes 2020-11-03 11:02:26 +01:00
Gabor Kiss-Vamosi
2f40ca37df Update master version 2020-11-03 10:02:00 +01:00
Gabor Kiss-Vamosi
112c894e73 Merge branch 'master' into dev 2020-11-03 09:23:29 +01:00
Gabor Kiss-Vamosi
5035c0c780 Release v7.7.1 2020-11-03 09:23:29 +01:00
Gabor Kiss-Vamosi
f42afb1c52 Update lv_conf_kconfig.h 2020-11-02 16:12:24 +01:00
github-actions[bot]
4f9869fc7e Merge f915b4cfb6 into dev 2020-11-02 15:04:17 +00:00
Gabor Kiss-Vamosi
f915b4cfb6 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-02 16:03:37 +01:00
github-actions[bot]
06ae6be9d4 Merge b62ddf8f64 into dev 2020-11-02 15:03:22 +00:00
Gabor Kiss-Vamosi
b62ddf8f64 push test 2020-11-02 16:02:47 +01:00
Gabor Kiss-Vamosi
b05aaaeb6b Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-02 15:55:10 +01:00
Gabor Kiss-Vamosi
47687fc252 Update changelog 2020-11-02 15:54:54 +01:00
github-actions[bot]
a85ed5b949 Merge 929d9f7a57 into dev 2020-11-02 12:13:31 +00:00
Gabor Kiss-Vamosi
929d9f7a57 Update release.yml 2020-11-02 13:13:01 +01:00
github-actions[bot]
20d034c279 Merge 23aec1e1ce into dev 2020-11-02 11:52:32 +00:00
Gabor Kiss-Vamosi
23aec1e1ce Update release.yml 2020-11-02 12:52:03 +01:00
github-actions[bot]
0931bb6cae Merge d487acd7cc into dev 2020-11-02 11:51:39 +00:00
Gabor Kiss-Vamosi
d487acd7cc Create release.yml 2020-11-02 12:51:12 +01:00
github-actions[bot]
380b59fddd Merge 6d92d084f7 into dev 2020-11-02 11:24:52 +00:00
Gabor Kiss-Vamosi
6d92d084f7 group: fix in lv_group_remove_obj to handle deleting hidden obejcts correctly 2020-11-02 12:24:12 +01:00
Carlos Diaz
16678b78bc lv_conf_kconfig: Update (#1870)
* lv_conf_kconfig: Update

* lv_conf_kconfig: Define CONFIG_LV_COLOR_TRANSP with lv_color_hex.
2020-11-02 11:10:33 +01:00
github-actions[bot]
8f14c31bc9 Merge a2b4bbcd2a into dev 2020-10-29 22:05:58 +00:00
Gabor Kiss-Vamosi
a2b4bbcd2a add missing #include <stdarg.h> 2020-10-29 23:05:16 +01:00
github-actions[bot]
20f901f9e3 Merge 85c8014880 into dev 2020-10-28 10:18:12 +00:00
Gabor Kiss-Vamosi
85c8014880 gauge: make the needle images to use the styles from LV_GAUGE_PART_PART 2020-10-28 11:14:05 +01:00
github-actions[bot]
b5ddf8d19d Merge b3cca917df into dev 2020-10-28 09:14:53 +00:00
Ali Rostami
b3cca917df create the fmt version of setting text for msgbox. (#1851)
* create the fmt version of setting text for msgbox.

* define _lv_txt_set_text_vfmt and change the body of lv_msgbox_set_text_fmt.

* make lv_label_refr_text out of static.

* fix a bug in _lv_txt_set_text_vfmt
2020-10-28 10:14:18 +01:00
github-actions[bot]
6bae5c7af5 Merge 4dafa10017 into dev 2020-10-27 12:50:23 +00:00
Gabor Kiss-Vamosi
4dafa10017 fix messed up function introduced in 6e9714c5 2020-10-27 13:49:47 +01:00
github-actions[bot]
622472387c Merge 6e9714c545 into dev 2020-10-27 12:42:40 +00:00
Gabor Kiss-Vamosi
6e9714c545 respect btnmatrix's one_check in lv_btnmatrix_set_btn_ctrl
Related to https://forum.lvgl.io/t/expand-lv-btnmatrix-set-one-check-to-allow-radio-button-functionality/2962
2020-10-27 13:42:01 +01:00
github-actions[bot]
6e12abe015 Merge 8788317bb1 into dev 2020-10-26 14:19:22 +00:00
Gabor Kiss-Vamosi
8788317bb1 chart: remove LV_CHART_SCATTER option which was only an accidental leftover 2020-10-26 15:18:41 +01:00
Carlos Diaz
f9da89d77d Add CMakeLists.txt (#1868) 2020-10-26 10:05:32 -04:00
Carlos Diaz
def8e047af lv_conf_checker: Update lv_conf_checker so it is ESP-IDF aware. (#1864)
* lv_conf_checker: Update lv_conf_checker so it is ESP-IDF aware.

Include ESP-IDF headers and lv_conf_kconfig.h when using the ESP-IDF framework.
Also remove the CONFIG_LV_CONF_SKIP as it is not generated by the Kconfig file.

* lv_conf_checker: Always include lv_conf_kconfig.h.

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-10-26 13:18:06 +01:00
github-actions[bot]
6b59b1f706 Merge cc921dae17 into dev 2020-10-26 11:46:26 +00:00
Gabor Kiss-Vamosi
cc921dae17 Fix infinite loop in lv_imgbtn
Fixes: #1867
2020-10-26 12:45:51 +01:00
github-actions[bot]
ae0d498cf6 Merge 18ae2fe7fb into dev 2020-10-26 11:40:55 +00:00
Gabor Kiss-Vamosi
18ae2fe7fb Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-26 12:40:15 +01:00
Gabor Kiss-Vamosi
c19a4ad568 lv_conf_checker.py: add auto incude of lv_conf.h if available 2020-10-26 12:40:05 +01:00
github-actions[bot]
54a8a4ba33 Merge b3bfa3c58b into dev 2020-10-26 11:02:04 +00:00
iDalink
b3bfa3c58b lv_label effect area clip line space (#1866)
Co-authored-by: Dalink <Dalink@gitee.com>
2020-10-26 12:01:32 +01:00
github-actions[bot]
9d7ba3fcb1 Merge b44ddb5b64 into dev 2020-10-26 08:14:38 +00:00
Gabor Kiss-Vamosi
b44ddb5b64 lv_gpu_nxp_pxp_osa.h include lv_conf_internal.h instead of lv_conf.h
Related to #1860
2020-10-26 09:13:48 +01:00
github-actions[bot]
1a66a485f9 Merge d6c87cb753 into dev 2020-10-24 18:50:24 +00:00
Chris Mumford
d6c87cb753 Initialize lv_color_t::green_l when LV_COLOR_16_SWAP==1 (#1865) 2020-10-24 14:49:55 -04:00
github-actions[bot]
bd59dafa42 Merge 51a522c8d3 into dev 2020-10-24 18:07:52 +00:00
Chris Mumford
51a522c8d3 Fixed a few dangling references to lv_conf_templ.h. (#1863) 2020-10-24 14:07:19 -04:00
github-actions[bot]
120d579c88 Merge 200d3aa26d into dev 2020-10-22 11:57:58 +00:00
Gabor Kiss-Vamosi
200d3aa26d fix build with out lv_conf.h
Fixes: #1860
2020-10-22 13:57:25 +02:00
github-actions[bot]
e6a4860d96 Merge c03160abc2 into dev 2020-10-22 11:55:51 +00:00
Gabor Kiss-Vamosi
c03160abc2 add lv_conf_kvoncfig.h to handle special Kconfig options 2020-10-22 13:55:12 +02:00
Gabor Kiss-Vamosi
232d6a5530 merge master 2020-10-21 14:15:37 +02:00
Gabor Kiss-Vamosi
757df9eb89 Update version to 7.7.1-dev 2020-10-21 14:10:24 +02:00
github-actions[bot]
63ea07c0ab Merge aec831d277 into dev 2020-10-21 12:09:15 +00:00
Gabor Kiss-Vamosi
aec831d277 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-21 14:08:29 +02:00
Gabor Kiss-Vamosi
d3cafedb65 remove pycache files 2020-10-21 14:08:16 +02:00
Gabor Kiss-Vamosi
16a4023abf reorganize release script 2020-10-21 14:06:48 +02:00
Gabor Kiss-Vamosi
9c78f86880 Merge branch 'master' into dev 2020-10-20 13:33:37 +02:00
Gabor Kiss-Vamosi
6fb4235c66 prepare to release v7.7.0 2020-10-20 13:32:57 +02:00
github-actions[bot]
8627389837 Merge 64c68ec25b into dev 2020-10-20 11:28:56 +00:00
Gabor Kiss-Vamosi
64c68ec25b release.py: add lv_sim_emscripten 2020-10-20 13:27:14 +02:00
github-actions[bot]
5e1b08131b Merge 62a21e912c into dev 2020-10-19 10:34:20 +00:00
Gabor Kiss-Vamosi
62a21e912c Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-19 12:33:42 +02:00
Gabor Kiss-Vamosi
df49f8656d fix image transformation
Fixes: #1854
2020-10-19 12:33:34 +02:00
github-actions[bot]
eb2ad01a89 Merge 3d4284b02c into dev 2020-10-18 16:33:09 +00:00
Themba Dube
3d4284b02c stm32: use DSB to ensure GPU clock gets enabled 2020-10-18 12:32:22 -04:00
github-actions[bot]
0dd1dc41be Merge 4ca5d4e86d into dev 2020-10-16 11:13:15 +00:00
Gabor Kiss-Vamosi
4ca5d4e86d Update ROADMAP.md 2020-10-16 13:12:46 +02:00
github-actions[bot]
6f41624b14 Merge 55d78e1f92 into dev 2020-10-16 11:06:54 +00:00
Gabor Kiss-Vamosi
55d78e1f92 Update ROADMAP.md 2020-10-16 13:06:21 +02:00
github-actions[bot]
dcaa2e037f Merge cf8e40fcbe into dev 2020-10-16 09:28:14 +00:00
Gabor Kiss-Vamosi
cf8e40fcbe Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-16 11:27:35 +02:00
Gabor Kiss-Vamosi
8d9c0bd9b2 fix define_set to check define name end too 2020-10-16 11:27:24 +02:00
github-actions[bot]
e32b3bf13b Merge 8c0ab944af into dev 2020-10-15 13:22:29 +00:00
Gabor Kiss-Vamosi
8c0ab944af Update ROADMAP.md 2020-10-15 15:21:55 +02:00
github-actions[bot]
77b4bd597b Merge 79433deeb8 into dev 2020-10-13 10:56:14 +00:00
Gabor Kiss-Vamosi
79433deeb8 Update ROADMAP.md 2020-10-13 12:55:43 +02:00
github-actions[bot]
8a54450984 Merge ddb4ae8685 into dev 2020-10-13 09:53:40 +00:00
Gabor Kiss-Vamosi
ddb4ae8685 fix lv_win_clean() 2020-10-13 11:53:03 +02:00
github-actions[bot]
5a946fc3f4 Merge 489f426b27 into dev 2020-10-12 13:49:28 +00:00
Gabor Kiss-Vamosi
489f426b27 fix rectangle border drawing with large width 2020-10-12 15:48:43 +02:00
Gabor Kiss-Vamosi
8cddd4bdab fix conflicts 2020-10-12 13:16:43 +02:00
Gabor Kiss-Vamosi
b1b233d249 fix warning 2020-10-12 13:15:48 +02:00
Gabor Kiss-Vamosi
c4f8959e65 remove version control text
Fixes #1846
2020-10-12 12:58:04 +02:00
github-actions[bot]
5347779e50 Merge 68629c725a into dev 2020-10-12 10:44:29 +00:00
Gabor Kiss-Vamosi
68629c725a add missing fonts
fixes: #1845
2020-10-12 12:43:51 +02:00
github-actions[bot]
a81a8b8d3e Merge 20363b09e6 into dev 2020-10-12 10:09:46 +00:00
Gabor Kiss-Vamosi
20363b09e6 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-12 12:09:08 +02:00
Gabor Kiss-Vamosi
4d620d3771 fix dropdown selection with RTL basedirection
Related to: #1842
2020-10-12 12:08:49 +02:00
Gabor Kiss-Vamosi
6d120b1f7f Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-10-12 11:55:22 +02:00
Gabor Kiss-Vamosi
5d0c00a201 update CHANGELOG 2020-10-12 11:54:54 +02:00
Gabor Kiss-Vamosi
9a029a1784 make DMA2S non blovking 2020-10-12 11:53:56 +02:00
Sergei Kolotovchenkov
cb5ad1e9d3 Improve compatibility with C++14 (#1843) 2020-10-12 11:53:56 +02:00
Gabor Kiss-Vamosi
4d614e60ef skip objects in groups if they are in disabled state 2020-10-12 11:53:56 +02:00
github-actions[bot]
6fcfe72df6 Merge e1f222d04f into dev 2020-10-09 13:12:06 +00:00
Sergei Kolotovchenkov
e1f222d04f Improve compatibility with C++14 (#1843) 2020-10-09 09:11:34 -04:00
github-actions[bot]
de7cb0fa71 Merge 56c4cab228 into dev 2020-10-09 08:34:38 +00:00
Gabor Kiss-Vamosi
56c4cab228 skip objects in groups if they are in disabled state 2020-10-09 10:34:02 +02:00
github-actions[bot]
0429c501b7 Merge 5d91c24723 into dev 2020-10-08 13:19:22 +00:00
Gabor Kiss-Vamosi
5d91c24723 support RTL in pretty layout (draw columns right to left)
Related to #1833
2020-10-08 15:18:30 +02:00
github-actions[bot]
8ec2030cab Merge 6e48cde2f1 into dev 2020-10-08 12:31:00 +00:00
embeddedt
6e48cde2f1 Fix #1837: remove last designated initializer in lv_color.h 2020-10-08 08:30:29 -04:00
github-actions[bot]
73c0bf6439 Merge 9ec4b61417 into dev 2020-10-07 18:18:09 +00:00
robekras
9ec4b61417 Fix #1798: Use AHB3 enable register for STM32H7 (#1840) 2020-10-07 14:17:38 -04:00
github-actions[bot]
28c9cf0aa5 Merge 6c426aa855 into dev 2020-10-07 12:03:39 +00:00
Gabor Kiss-Vamosi
6c426aa855 fix warnings 2020-10-07 14:03:06 +02:00
github-actions[bot]
2b47542bbd Merge c804fadf40 into dev 2020-10-07 11:55:43 +00:00
Gabor Kiss-Vamosi
c804fadf40 remove the internal usage of LV_HOR/VER_RES_MAX 2020-10-07 13:55:06 +02:00
github-actions[bot]
d9c75f61c5 Merge 1ee9c13a1d into dev 2020-10-07 11:49:04 +00:00
Gabor Kiss-Vamosi
1ee9c13a1d revert debug changes in material theme 2020-10-07 13:48:31 +02:00
github-actions[bot]
0b5f414ca8 Merge 0266244c58 into dev 2020-10-07 11:48:30 +00:00
Gabor Kiss-Vamosi
0266244c58 support RTL in table (draw columns right to left)
Related to #1833
2020-10-07 13:47:49 +02:00
github-actions[bot]
beda277316 Merge f1a198bd93 into dev 2020-10-07 10:45:39 +00:00
Gabor Kiss-Vamosi
f1a198bd93 fix imgbtn state change 2020-10-07 12:44:54 +02:00
github-actions[bot]
63c4b43a57 Merge 1d50bc962d into dev 2020-10-07 10:23:59 +00:00
Gabor Kiss-Vamosi
1d50bc962d theme update to support text selection background
Fixes #1820
2020-10-07 12:23:24 +02:00
github-actions[bot]
ec616da1ac Merge fff3a00de2 into dev 2020-10-06 09:32:55 +00:00
Gabor Kiss-Vamosi
fff3a00de2 fix lv_disp_get_inactive_time if the disp==NULL
Fixes #1836
2020-10-06 11:25:37 +02:00
github-actions[bot]
6f312e34e3 Merge faf50714a1 into dev 2020-10-06 09:24:17 +00:00
Gabor Kiss-Vamosi
faf50714a1 update release script 2020-10-06 11:23:40 +02:00
Gabor Kiss-Vamosi
3c9468a621 Update dev version 2020-10-06 09:54:32 +02:00
Gabor Kiss-Vamosi
e41bc28817 Merge branch 'master' into dev 2020-10-06 09:33:59 +02:00
Gabor Kiss-Vamosi
0de2cc9a8e fix conflicts 2020-10-06 09:30:00 +02:00
Gabor Kiss-Vamosi
bc626dc9d0 update CHANGELOG 2020-10-06 08:59:07 +02:00
github-actions[bot]
38a9426135 Merge 6b24c949f1 into dev 2020-10-05 18:46:45 +00:00
github-actions[bot]
44709caf6f Merge e557b0fbac into dev 2020-10-05 12:31:49 +00:00
github-actions[bot]
b124f4d7e0 Merge 3dabec4cae into dev 2020-10-05 08:53:33 +00:00
github-actions[bot]
4092c71a45 Merge 78ecdd1f1d into dev 2020-10-05 07:44:20 +00:00
Gabor Kiss-Vamosi
4c2c1dd8bd fix conflicts 2020-10-05 09:42:59 +02:00
Gabor Kiss-Vamosi
e33e1df4af Merge branch 'feature/vg-lite-support-dev-7-7' of https://github.com/NXPmicro/lvgl into NXPmicro-feature/vg-lite-support-dev-7-7 2020-10-05 09:23:53 +02:00
github-actions[bot]
4c7a2ae0b7 Merge 96478a0c3e into dev 2020-10-03 12:38:29 +00:00
github-actions[bot]
61437e793a Merge 86ddaf90a7 into dev 2020-10-02 19:46:11 +00:00
Ali Rostami
8394d92fac Cursor (#1789)
* update lv_obj_refresh_style describtion.

* cursor added.

* refresh chart after setting the cursor

* add new direction and a bug fixed.

* fixed the wrong changes for header file.

* rename lv_cursor_direction_t enum members.

* add lv_chart_get_x_from_index and lv_chart_get_y_from_index

* lv_chart_get_x_from_index supports column chart type too.

* fix the error of no lv_coord_t value return.

* fix a bug based on the coord is with respect to the series area.

* make get_series_area function global.

* fix the name of get_series_area function.

* add the description of the added functions.

* chart cursor minor fixes

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-10-02 13:59:05 +02:00
jozba
fc2206105b Fixed include paths (#1823)
Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-10-02 13:12:41 +02:00
jozba
b049b7e1f6 Bugfix/mgg 562 lvgl pxp symbol prefix missing include path update blit limit (#1830)
* PXP: Updated area threshold, fixed symbol names, minor fixes

- Area threshold of 1 left from debugging, changed to 32 for performance
reasons.
- Fixed naming convention of symbols (prefix LV_GPU_)
- Fixed include paths (no need to add src folder into include paths)
- Comments changed to doxygen

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Code formatting

Applied code-format.sh script.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-10-02 13:10:09 +02:00
github-actions[bot]
cf1ca20750 Merge 34e0fefeb3 into dev 2020-10-02 10:26:54 +00:00
Gabor Kiss-Vamosi
a12d54855f Update CHANGELOG.md 2020-10-02 11:35:15 +02:00
ryanpowers
6d1a72b522 Text selection enhancement (#1829)
* Corrected bug in styles of labels with selections

Text selection color (text_selection_color) property was incorrectly
being applied to the text color if there was a selection. The sel_color
property in the label descriptor was initialized to blue. This property
was intended to be the label background color under a selection.

* Add new property for the color of selected text

New property for labels: text_sel_font_color
This property will change the color of the font within selected text.

* Rename text selection color properties

Per feedback from issue #1820, sel_color is now sel_bg_color and
sel_font_color is now sel_color. This results in clearer naming.

Co-authored-by: Ryan Powers <ryan.powers@envision-tek.com>
2020-10-02 11:34:28 +02:00
github-actions[bot]
f37cbafad6 Merge 79d72f9286 into dev 2020-10-02 08:55:42 +00:00
Themba Dube
e7bb0382c4 Merge remote-tracking branch 'origin/master' into dev 2020-10-01 10:34:08 -04:00
Gabor Kiss-Vamosi
5770a09e73 Update CHANGELOG.md 2020-10-01 13:16:52 +02:00
Ali Rostami
c2c130889d use margin in the header part of calendar. (#1817)
* use margin in the header part of calendar.

* make calendar_init same as before based on new changes of pad and margin in calendar_header.
2020-10-01 13:16:00 +02:00
Jozef Bastek
ed90f36984 VG-Lite: Added support for fill and BLIT
VG-Lite accelerated features:
  - fill (+ transparency)
  - BLIT (+ transparency)

Limitation:
  Image width must be aligned to 16 for VG-Lite to process the buffer.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-09-30 17:38:25 +02:00
github-actions[bot]
540856a8bc Merge 8c824b265e into dev 2020-09-30 04:55:39 +00:00
github-actions[bot]
f1690be7fc Merge 5a0006cd3c into dev 2020-09-29 07:34:27 +00:00
github-actions[bot]
25bd804724 Merge 07746a78d5 into dev 2020-09-28 13:32:34 +00:00
github-actions[bot]
03c526514d Merge 8ff5e23378 into dev 2020-09-28 09:08:17 +00:00
github-actions[bot]
ef0c8690e4 Merge ce11b4c71c into dev 2020-09-28 08:51:58 +00:00
github-actions[bot]
0d62025e2c Merge f0fc45eb52 into dev 2020-09-28 08:43:39 +00:00
github-actions[bot]
115314b140 Merge ffd9b872d9 into dev 2020-09-27 12:47:45 +00:00
github-actions[bot]
22fbde4501 Merge 71669c252c into dev 2020-09-23 17:59:22 +00:00
github-actions[bot]
a45ff2c574 Merge 6b06ac4b72 into dev 2020-09-23 17:24:37 +00:00
github-actions[bot]
2f7369e771 Merge b2d201dba7 into dev 2020-09-23 10:42:07 +00:00
github-actions[bot]
695d8e5462 Merge 2b49a7eb28 into dev 2020-09-23 09:00:53 +00:00
Gabor Kiss-Vamosi
0b3759201f Update CHANGELOG.md 2020-09-23 10:23:45 +02:00
Ali Rostami
23f5a11340 Table fmt (#1803)
* update lv_obj_refresh_style describtion.

* fmt version of lv_table_set_cell_value added.

* fix a bug.

* add include lv_printf.h

* fix a bug for LV_USE_BIDI in lv_table_set_cell_value_fmt

* fix a missed part for arabic_persian chars in lv_table_set_cell_value
2020-09-23 10:23:37 +02:00
github-actions[bot]
a590f91fd0 Merge 686a3b5271 into dev 2020-09-23 08:14:44 +00:00
Gabor Kiss-Vamosi
27eb84667f Update CHANGELOG.md 2020-09-23 09:59:09 +02:00
jozba
1508320aa8 PXP support for NXP RTxxx MCUs (#1702)
* PXP: Added basic PXP acceleration

PXP accelerated features:
 - fill (+ opacity)
 - BLIT (+ opacity)
 - recoloring (+ opacity)
 - color keying (+ opacity)

Recoloring + color keying simultaneously not supported.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Added abstraction for interrupt handling

Previous imlpementation used IRQ polling on PXP, which doesn't allow
real CPU offload. Therefore added set of callbacks for interrupt
handling that should be implemented by user, with possible RTOS
integration.

Default/example implementation of callbacks for bare metal and FreeRTOS
provided (lv_gpu_nxp_pxp_osa.c), enabled by
LV_USE_GPU_NXP_PXP_DEFAULT_OSA switch, accesible via pxp_default_cfg
structure.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Optimized cache flushing

Previous implementation flushed areas of (LCD width * object height)
size. Cache flush is expensive operation and flushing line by line,
smallest possible area, boost performance by shortening time spent on
cache flushes.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Added documentation for NXP PXP accelerator

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: added missing extern c in header files

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Fixed ifdefs - Removed LV_USE_GPU, fixed internal config

LV_USE_GPU is not intended as a global GPU enable switch. It's used only
for gpu_blend_cb and gpu_fill_cb callbacks, which are obsolete. This
patch removes LV_USE_GPU dependency for PXP code, so it's enabled only
with LV_USE_GPU_NXP_PXP symbol.

Added missing symbols to internal conf, so automatic testd can pass
build step.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Default OSA changed to PXP auto-initialization

Auto init feature added so if user run FreeRTOS or bare-metal, no PXP
Init code is required. Renamed symbol to be more clear.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Documentation moved to docs repo

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Fixed alpha configuration

- Coverity issue: AS blend config used uninitialized structure. No
impact on functionality, as blend module is not used (porter-duff blends
in this case)
- Alpha config fixed - swapped alpha values produced different result
from SW render

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-09-23 09:57:38 +02:00
github-actions[bot]
ea16ce5dd0 Merge eb056315c3 into dev 2020-09-22 13:54:10 +00:00
github-actions[bot]
64a4fff635 Merge ddf33b2fd9 into dev 2020-09-22 09:24:13 +00:00
Gabor Kiss-Vamosi
e9476f4767 Merge branch 'dev' of https://github.com/lvgl/lvgl into dev 2020-09-22 10:51:09 +02:00
Gabor Kiss-Vamosi
04e2b94c06 Merge branch 'master' into dev 2020-09-22 10:46:38 +02:00
github-actions[bot]
39f4c15876 Merge 783dc6be9a into dev 2020-09-22 08:37:22 +00:00
github-actions[bot]
39f1b363fd Merge 18db4d83bc into dev 2020-09-22 07:27:24 +00:00
Gabor Kiss-Vamosi
458046b9b0 add v7.7 to changelog 2020-09-22 09:24:59 +02:00
github-actions[bot]
23ba19d068 Merge 4d87007c95 into dev 2020-09-22 04:21:17 +00:00
github-actions[bot]
0576300981 Merge 2415f99a20 into dev 2020-09-22 04:21:00 +00:00
github-actions[bot]
77fd862b3f Merge 1c930dc8fb into dev 2020-09-22 04:20:10 +00:00
github-actions[bot]
259907b788 Merge 83c9145072 into dev 2020-09-22 04:18:24 +00:00
github-actions[bot]
02afe7f82c Merge 94a6dc08d8 into dev 2020-09-21 22:05:35 +00:00
tosriram
5ef1df9357 Extend maximum number of table cell styles from 4 to 16 (#1800) 2020-09-21 11:50:54 -04:00
github-actions[bot]
a81574543b Merge cbd3393d7c into dev 2020-09-21 09:58:26 +00:00
github-actions[bot]
b09d5a846c Merge 2820cf897f into dev 2020-09-17 13:09:42 +00:00
github-actions[bot]
33dbc82a0c Merge 18a4869e62 into dev 2020-09-17 13:09:41 +00:00
github-actions[bot]
adce9d72fc Merge d90f5d0144 into dev 2020-09-17 11:26:04 +00:00
github-actions[bot]
9461e48998 Merge 565643e883 into dev 2020-09-16 17:55:03 +00:00
github-actions[bot]
132e6d11b4 Merge 7756d70705 into dev 2020-09-16 13:23:52 +00:00
github-actions[bot]
dbbf4a406f Merge be4f7a76d4 into dev 2020-09-16 13:22:05 +00:00
github-actions[bot]
537456cea5 Merge d547d8afe1 into dev 2020-09-16 09:51:23 +00:00
github-actions[bot]
fb6e3518ea Merge 2614d1342e into dev 2020-09-15 10:30:09 +00:00
github-actions[bot]
0287b759ac Merge 3c6741b11c into dev 2020-09-15 10:20:27 +00:00
Gabor Kiss-Vamosi
9b953abbd2 Update dev version 2020-09-15 11:56:57 +02:00
99 changed files with 9240 additions and 1588 deletions

27
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
See the [CHANGELOG](https://github.com/lvgl/lvgl/blob/master/CHANGELOG.md)
draft: false
prerelease: false

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
scripts/release/__pycache__
**/*.o
**/*bin
**/*.swp

View File

@@ -1,5 +1,65 @@
# Changelog
## v7.8.0 (Planned to 01.12.2020)
### New features
- make DMA2D non blocking
- add unscii-16 built-in font
- add KConfig
- add lv_refr_get_fps_avg()
### Bugfixes
- fix(btnmatrix) handle arabic texts in button matrices
- fix(indev) disabled object shouldn't absorb clicks but let the parent to be clicked
- fix(arabic) support processing again already processed texts with _lv_txt_ap_proc
- fix(textarea) support Arabic letter connections
- fix(dropdown) support Arabic letter connections
- fix(value_str) support Arabic letter connections in value string property
- fix(indev) in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too
- fix(arc) make arc work with encoder
- fix(slider) adjusting the left knob too with encoder
- fix reference to LV_DRAW_BUF_MAX_NUM in lv_mem.c
- fix(polygon draw) join adjacent points if they are on the same coordinate
- fix(linemeter) fix invalidation when setting new value
- fix(table) add missing invalidation when changeing cell type
- refactor(roller) rename LV_ROLLER_MODE_INIFINITE -> LV_ROLLER_MODE_INFINITE
## v7.7.2 (17.11.2020)
### Bugfixes
- fix(draw_triangle): fix polygon/triangle drawing when the order of points is counter-clockwise
- fix(btnmatrix): fix setting the same map with modified pointers
- fix(arc) fix and improve arc dragging
- label: Repair calculate back `dot` character logical error which cause infinite loop.
- fix(theme_material): remove the bottom border from tabview header
- fix(imgbtn) guess a the closest availabe state with valid src
- fix(spinbox) update cursor position in lv_spinbox_set_step
## v7.7.1 (03.11.2020)
### Bugfixes
- Respect btnmatrix's `one_check` in `lv_btnmatrix_set_btn_ctrl`
- Gauge: make the needle images to use the styles from `LV_GAUGE_PART_PART`
- Group: fix in `lv_group_remove_obj` to handle deleting hidden obejcts correctly
## v7.7.0 (20.10.2020)
### New features
- Add PXP GPU support (for NXP MCUs)
- Add VG-Lite GPU support (for NXP MCUs)
- Allow max. 16 cell types for table
- Add `lv_table_set_text_fmt()`
- Use margin on calendar header to set distances and padding to the size of the header
- Add `text_sel_bg` style proeprty
### Bugfixes
- Theme update to support text selection background
- Fix imgbtn state change
- Support RTL in table (draw columns right to left)
- Support RTL in pretty layout (draw columns right to left)
- Skip objects in groups if they are in disabled state
- Fix dropdown selection with RTL basedirection
- Fix rectangle border drawing with large width
- Fix `lv_win_clean()`
## v7.6.1 (06.10.2020)
### Bugfixes
@@ -11,6 +71,7 @@
- Fix imgbtn image switching with empty style
- Material theme: do not set the text font to allow easy global font change
## v7.6.0 (22.09.2020)
### New features
@@ -288,7 +349,7 @@ The following object types are renamed:
- Merge new features and fixes directly into `master` and release a patch or minor releases every 2 weeks.
### Migrating from v6 to v7
- First and foremost, create a new `lv_conf.h` based on `lv_conf_templ.h`.
- First and foremost, create a new `lv_conf.h` based on `lv_conf_template.h`.
- To try the new version it suggested using a simulator project and see the examples.
- If you have a running project, the most difficult part of the migration is updating to the new style system. Unfortunately, there is no better way than manually updating to the new format.
- The other parts are mainly minor renames and refactoring as described above.

17
CMakeLists.txt Normal file
View File

@@ -0,0 +1,17 @@
if(ESP_PLATFORM)
file(GLOB_RECURSE SOURCES src/*.c)
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS . src)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE")
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_SKIP")
if (CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR")
endif()
else()
message(FATAL_ERROR "Unknown platform.")
endif()

1129
Kconfig Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
<h1 align="center"> LVGL - Light and Versatile Graphics Library</h1>
<h1 align="center"> LVGL - Light and Versatile Graphics Library</h1>
<p align="center">
<img src="https://lvgl.io/assets/images/img_1.png">
@@ -11,6 +11,7 @@ LVGL provides everything you need to create embedded GUI with easy-to-use graphi
<h4 align="center">
<a href="https://lvgl.io">Website </a> &middot;
<a href="https://lvgl.io/demos">Online demo</a> &middot;
<a href="https://lvgl.github.io/lv_examples/">Nightly demos</a> &middot;
<a href="https://docs.lvgl.io/">Docs</a> &middot;
<a href="https://forum.lvgl.io">Forum</a>
</h4>

View File

@@ -5,7 +5,11 @@ This is a summary for thenew fatures of the major releases and a collection of i
This list indicates only the current intention and can be changed.
## v8
Planned to September/October 2020
Planned to November/December 2020
- Create an `lv_components` repository for compley widgets
- It makes the core LVGL leaner
- In `lv_components` we can have a lot and specific widgets
- Good place for contribution
- New scrolling:
- See [feat/new-scroll](https://github.com/lvgl/lvgl/tree/feat/new-scroll) branch and [#1614](https://github.com/lvgl/lvgl/issues/1614)) issue.
- Remove `lv_page` and support scrolling on `lv_obj`
@@ -18,25 +22,40 @@ Planned to September/October 2020
- New layouts:
- See [#1615](https://github.com/lvgl/lvgl/issues/1615) issue
- [CSS Grid](https://css-tricks.com/snippets/css/a-guide-to-grid/)-like layout support
- Work in progress
- [CSS Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)-like layout support
- Remove `lv_cont` and support layouts on `lv_obj`
- Simplified File system interface ([feat/new_fs_api](https://github.com/lvgl/lvgl/tree/feat/new-fs-api) branch) to make porting easier
- Work in progress
- Remove the align parameter from `lv_canvas_draw_text`
- Remove the copy paramter from create functions
- Style selectors and style-based states See [#1832](https://github.com/lvgl/lvgl/issues/1832)
- Add Object Orianted system [#1919](https://github.com/lvgl/lvgl/issues/1919)
## v8.1
- Add radio button widget
## v9
- Simplify `group`s. Discussion is [here](https://forum.lvgl.io/t/lv-group-tabindex/2927/3).
## v8.x
- Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658)
- Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660)
## v9
- Simplify `group`s. Discussion is [here](https://forum.lvgl.io/t/lv-group-tabindex/2927/3).
- Consider direct binary font format support
- Remove the copy paramter from create functions
- Optimize line and cirle drawing and masking
- Reconsider color format management for run time color format setting, and custom color format usage. (Also [RGB888](https://github.com/lvgl/lvgl/issues/1722))
- 9-patch support for `lv_imgbtn`.
- Handle stride. See [#1858](https://github.com/lvgl/lvgl/issues/1858)
- Make gradients more versatile
- Make image transformations more versatile
- Allow snapshoting object to tranfrom them as images
## v10
- Remove property level states
## Ideas
- lv_mem_alloc_aligned(size, align)
- Text node. See [#1701](https://github.com/lvgl/lvgl/issues/1701#issuecomment-699479408)
- RGB888 support [#1722](https://github.com/lvgl/lvgl/issues/1722)
- CPP binding. See [Forum](https://forum.lvgl.io/t/is-it-possible-to-officially-support-optional-cpp-api/2736)
- Optmize font decompression
- Switch to RGBA colors in styles
@@ -44,3 +63,4 @@ Planned to September/October 2020
- Need static analize (via coverity.io or somehing else)
- Support dot_begin and dot_middle long modes for labels
- Add new label alignment modes. [#1656](https://github.com/lvgl/lvgl/issues/1656)
- Support larger images: [#1892](https://github.com/lvgl/lvgl/issues/1892)

View File

@@ -36,26 +36,11 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
bool touched = tft.getTouch(&touchX, &touchY, 600);
if(!touched)
{
if(!touched) {
data->state = LV_INDEV_STATE_REL;
return false;
}
else
{
} else {
data->state = LV_INDEV_STATE_PR;
}
if(touchX>screenWidth || touchY > screenHeight)
{
Serial.println("Y or y outside of expected parameters..");
Serial.print("y:");
Serial.print(touchX);
Serial.print(" x:");
Serial.print(touchY);
}
else
{
/*Set the coordinates*/
data->point.x = touchX;
data->point.y = touchY;
@@ -65,7 +50,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
Serial.print("Data y");
Serial.println(touchY);
}
return false; /*Return `false` because we are not buffering and no more data to read*/

View File

@@ -1,6 +1,6 @@
{
"name": "lvgl",
"version": "7.6.1",
"version": "7.8.0",
"keywords": "graphics, gui, embedded, tft, lvgl",
"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": {

View File

@@ -1,5 +1,5 @@
name=lvgl
version=7.6.1
version=7.8.0
author=kisvegabor
maintainer=kisvegabor,embeddedt,pete-pjb
sentence=Full-featured Graphics Library for Embedded Systems

View File

@@ -1,6 +1,6 @@
/**
* @file lv_conf.h
* Configuration file for v7.6.1-dev
* Configuration file for v7.8.0-dev
*/
/*
@@ -195,6 +195,19 @@ typedef void * lv_group_user_data_t;
e.g. "stm32f769xx.h" or "stm32f429xx.h" */
#define LV_GPU_DMA2D_CMSIS_INCLUDE
/*1: Use PXP for CPU off-load on NXP RTxxx platforms */
#define LV_USE_GPU_NXP_PXP 0
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
* */
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
/*1: Use VG-Lite for CPU offload on NXP RTxxx platforms */
#define LV_USE_GPU_NXP_VG_LITE 0
/* 1: Enable file system (might be required for images */
#define LV_USE_FILESYSTEM 1
#if LV_USE_FILESYSTEM
@@ -249,9 +262,14 @@ typedef void * lv_img_decoder_user_data_t;
/* Define a custom attribute to `lv_disp_flush_ready` function */
#define LV_ATTRIBUTE_FLUSH_READY
/* Required alignment size for buffers */
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE
/* With size optimization (-Os) the compiler might not align data to
* 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
* E.g. __attribute__((aligned(4))) */
* 4 or 8 byte boundary. Some HW may need even 32 or 64 bytes.
* This alignment will be explicitly applied where needed.
* LV_ATTRIBUTE_MEM_ALIGN_SIZE should be used to specify required align size.
* E.g. __attribute__((aligned(LV_ATTRIBUTE_MEM_ALIGN_SIZE))) */
#define LV_ATTRIBUTE_MEM_ALIGN
/* Attribute to mark large constant arrays for example
@@ -392,6 +410,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
/*Pixel perfect monospace font
* http://pelulamu.net/unscii/ */
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/* Optionally declare your custom fonts here.
* You can use these fonts as default font too
@@ -709,8 +728,10 @@ typedef void * lv_obj_user_data_t;
#define LV_USE_TABLE 1
#if LV_USE_TABLE
# define LV_TABLE_COL_MAX 12
# define LV_TABLE_CELL_STYLE_CNT 4
#endif
/*Tab (dependencies: lv_page, lv_btnm)*/
#define LV_USE_TABVIEW 1
# if LV_USE_TABVIEW != 0

8
lvgl.h
View File

@@ -14,9 +14,9 @@ extern "C" {
/***************************
* CURRENT VERSION OF LVGL
***************************/
#define LVGL_VERSION_MAJOR 7
#define LVGL_VERSION_MINOR 6
#define LVGL_VERSION_PATCH 1
#define LVGL_VERSION_MAJOR 7
#define LVGL_VERSION_MINOR 8
#define LVGL_VERSION_PATCH 0
#define LVGL_VERSION_INFO ""
/*********************
@@ -82,8 +82,6 @@ extern "C" {
#include "src/lv_api_map.h"
//#define LV_BUILD_TEST 1
/*********************
* DEFINES
*********************/

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
'''
Generates a checker file for lv_conf.h from lv_conf_templ.h define all the not defined values
Generates a checker file for lv_conf.h from lv_conf_template.h define all the not defined values
'''
@@ -29,8 +29,30 @@ fout.write(
#include <stdint.h>
/* Add ESP-IDF related includes */
#if defined (ESP_PLATFORM)
# include "sdkconfig.h"
# include "esp_attr.h"
#endif
/* Handle special Kconfig options */
#include "lv_conf_kconfig.h"
#ifdef CONFIG_LV_CONF_SKIP
#define LV_CONF_SKIP
#endif
/* If "lv_conf.h" is available from here try to use it later.*/
#if defined __has_include
# if __has_include("lv_conf.h")
# ifndef LV_CONF_INCLUDE_SIMPLE
# define LV_CONF_INCLUDE_SIMPLE
# endif
# endif
#endif
/*If lv_conf.h is not skipped include it*/
#if !defined(LV_CONF_SKIP) && !defined(CONFIG_LV_CONF_SKIP)
#if !defined(LV_CONF_SKIP)
# if defined(LV_CONF_PATH) /*If there is a path defined for lv_conf.h use it*/
# define __LV_TO_STR_AUX(x) #x
# define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
@@ -94,7 +116,7 @@ fout.write(
'''
/*If running without lv_conf.h add typdesf with default value*/
#if defined(LV_CONF_SKIP) || defined(CONFIG_LV_CONF_SKIP)
#if defined(LV_CONF_SKIP)
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
typedef int16_t lv_coord_t;

View File

@@ -1,518 +0,0 @@
#!/usr/bin/env python
# Release lvgl, lv_examples, lv_drivers. docs, blog and prepare the development of the next major, minoror bugfix release
# Usage: ./release,py bugfix | minor | major
# The option means what type of versin to prepare for development after release
#
# STEPS:
# - clone all 5 repos
# - get the version numnber from lvgl.h
# - set release branch (e.g. "release/v7")
# - prepare lvgl
# - run lv_conf_internal.py
# - run code formatter
# - clear LVGL_VERSION_INFO (set to "")
# - run Doxygen
# - update the version in lvgl's library.json, library.properties, lv_conf_template.h
# - update CHANGELOG.md
# - commit changes
# - prepare lv_examples
# - upadte the required LVGL version in lv_examples.h (LV_VERSION_CHECK)
# - update the version in lv_ex_conf_template.h
# - prepare lv_drivers
# - update the version in library.json, lv_drv_conf_template.h
# - prepare docs
# - update API XML
# - clear the versiopn info (should be plain vx.y.z)
# - tag all repos with the new version
# - merge to release branches
# - blog: add release post
# - push tags and commits
# - docs: run ./updade.py release/vX
#
# If --patch
# - merge master to dev branches
# - increment patch version by 1 and append "-dev". E.g. "vX.Y.(Z+1)-dev"
# - update version numbers in lvgl and docs
# - commit and push
# - docs: run ./updade.py latest dev
#
# Else (not --patch)
# - merge master to dev
# - merge the dev to master
# - increment version number like "vX.(Y+1).0-dev"
# - apply the new version in dev branches of lvgl, lv_examples, lv_drivers, docs
# - commit and push to dev branches
# - docs: run ./updade.py latest dev
import re
import os, fnmatch
import os.path
from os import path
from datetime import date
import sys
upstream_org_url = "https://github.com/lvgl/"
workdir = "./release_tmp"
proj_list = [ "lv_sim_eclipse_sdl"]
ver_major = -1
ver_minor = -1
ver_patch = -1
dev_ver_major = -1
dev_ver_minor = -1
dev_ver_patch = -1
ver_str = ""
dev_ver_str = ""
release_br = ""
release_note = ""
prepare_type = ['major', 'minor', 'bugfix']
dev_prepare = 'minor'
def upstream(repo):
return upstream_org_url + repo + ".git"
def cmd(c, exit_on_err = True):
print("\n" + c)
r = os.system(c)
if r:
print("### Error: " + str(r))
if exit_on_err: exit(int(r))
def define_set(fn, name, value):
print("In " + fn + " set " + name + " to " + value)
new_content = ""
s = r'^ *# *define +' + str(name).rstrip()
f = open(fn, "r")
for i in f.read().splitlines():
r = re.search(s, i)
if r:
d = i.split("define")
i = d[0] + "define " + name + " " + value
new_content += i + '\n'
f.close()
f = open(fn, "w")
f.write(new_content)
f.close()
def clone_repos():
cmd("rm -fr " + workdir)
cmd("mkdir " + workdir)
os.chdir(workdir)
#For debuging just copy the repos
#cmd("cp -a ../repos/. .")
#return
cmd("git clone " + upstream("lvgl") + "; cd lvgl; git checkout master; git remote update origin --prune; ")
cmd("git clone " + upstream("lv_examples") + "; cd lv_examples; git checkout master; git remote update origin --prune; ")
cmd("git clone " + upstream("lv_drivers") + "; cd lv_drivers; git checkout master; git remote update origin --prune; ")
cmd("git clone --recurse-submodules " + upstream("docs") + "; cd docs; git checkout master; git remote update origin --prune; ")
cmd("git clone " + upstream("blog") + "; cd blog; git checkout master; git remote update origin --prune; ")
for p in proj_list:
cmd("git clone " + upstream(p) + " --recurse-submodules ; cd " + p + "; git checkout master; git remote update origin --prune; ")
def get_lvgl_version(br):
print("Get LVGL's version")
global ver_str, ver_major, ver_minor, ver_patch, release_br
os.chdir("./lvgl")
cmd("git checkout " + br)
f = open("./lvgl.h", "r")
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
for i in f.read().splitlines():
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
if r:
m = lastNum.search(i)
if m: ver_major = m.group(1)
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
if r:
m = lastNum.search(i)
if m: ver_minor = m.group(1)
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
if r:
m = lastNum.search(i)
if m: ver_patch = m.group(1)
f.close()
cmd("git checkout master")
ver_str = "v" + str(ver_major) + "." + str(ver_minor) + "." + str(ver_patch)
print("New version:" + ver_str)
release_br = "release/v" + ver_major
os.chdir("../")
def update_version():
templ = fnmatch.filter(os.listdir('.'), '*templ*')
if templ[0]:
print("Updating version in " + templ[0])
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' " + templ[0])
if os.path.exists("library.json"):
print("Updating version in library.json")
cmd("sed -i -r 's/[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str[1:] +"/' library.json")
if path.exists("library.properties"):
print("Updating version in library.properties")
cmd("sed -i -r 's/version=[0-9]+\.[0-9]+\.[0-9]+/"+ "version=" + ver_str[1:] + "/' library.properties")
def lvgl_prepare():
print("Prepare lvgl")
global ver_str, ver_major, ver_minor, ver_patch
os.chdir("./lvgl")
define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"')
# Run some scripts
os.chdir("./scripts")
cmd("./code-format.sh")
cmd("./lv_conf_checker.py")
cmd("doxygen")
os.chdir("../")
update_version()
#update CHANGLELOG
new_content = ""
f = open("./CHANGELOG.md", "r")
global release_note
release_note = ""
note_state = 0
for i in f.read().splitlines():
if note_state == 0:
r = re.search(r'^## ' + ver_str, i)
if r:
i = i.replace("planned on ", "")
note_state+=1
elif note_state == 1:
r = re.search(r'^## ', i)
if r:
note_state+=1
else:
release_note += i + '\n'
new_content += i + '\n'
f.close()
f = open("./CHANGELOG.md", "w")
f.write(new_content)
f.close()
cmd('git commit -am "prepare to release ' + ver_str + '"')
os.chdir("../")
def lv_examples_prepare():
print("Prepare lv_examples")
global ver_str, ver_major, ver_minor, ver_patch
os.chdir("./lv_examples")
update_version()
cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK(" + ver_major + ", " + ver_minor + ", " + ver_patch + ")/' lv_examples.h")
cmd('git commit -am "prepare to release ' + ver_str + '"')
os.chdir("../")
def lv_drivers_prepare():
print("Prepare lv_drivers")
global ver_str, ver_major, ver_minor, ver_patch
os.chdir("./lv_drivers")
update_version()
cmd('git commit -am "prepare to release ' + ver_str + '"')
os.chdir("../")
def docs_prepare():
print("Prepare docs")
global ver_str, ver_major, ver_minor, ver_patch
os.chdir("./docs")
cmd("git co latest --")
cmd("rm -rf xml");
cmd("cp -r ../lvgl/docs/api_doc/xml .");
cmd("git add xml");
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
cmd('git commit -am "prepare to release ' + ver_str + '"')
os.chdir("../")
def blog_add_post():
global ver_str, release_note
os.chdir("./blog/_posts")
post = "---\nlayout: post\ntitle: " + ver_str + " is released\nauthor: \"kisvegabor\"\ncover: /assets/release_cover.png\n---\n\n"
post += release_note
today = date.today()
d = today.strftime("%Y-%m-%d")
f = open(d + "-release_" + ver_str + ".md", "w")
f.write(post)
f.close()
cmd("git add .")
cmd("git commit -am 'Add " + ver_str + " release post'")
os.chdir("../../")
def add_tags():
global ver_str
tag_cmd = " git tag -a " + ver_str + " -m 'Release " + ver_str + "' "
cmd("cd lvgl; " + tag_cmd)
cmd("cd lv_examples; " + tag_cmd)
cmd("cd lv_drivers; " + tag_cmd)
cmd("cd docs; " + tag_cmd)
def update_release_branches():
global release_br
merge_cmd = " git checkout " + release_br + "; git pull origin " + release_br + "; git merge master -X ours; git push origin " + release_br + "; git checkout master"
cmd("cd lvgl; " + merge_cmd)
cmd("cd lv_examples; " + merge_cmd)
cmd("cd lv_drivers; " + merge_cmd)
merge_cmd = " git checkout " + release_br + "; git pull origin " + release_br + "; git merge latest -X ours; git push origin " + release_br + "; git checkout latest"
cmd("cd docs; " + merge_cmd)
def publish_master():
#Merge LVGL master to dev first to avoid "merge-to-dev.yml" running asynchronous
os.chdir("./lvgl")
cmd("git checkout dev")
cmd("git merge master -X ours")
cmd("git add .")
cmd("git commit -am 'Merge master'", False)
cmd("git push origin dev")
cmd("git checkout master")
os.chdir("../")
pub_cmd = "git push origin master; git push origin " + ver_str
cmd("cd lvgl; " + pub_cmd)
cmd("cd lv_examples; " + pub_cmd)
cmd("cd lv_drivers; " + pub_cmd)
pub_cmd = "git push origin master"
cmd("cd blog; " + pub_cmd)
def merge_from_dev():
merge_cmd = "git checkout master; git merge dev;"
cmd("cd lvgl; " + merge_cmd)
merge_cmd = "git checkout latest -- ; git merge dev -X theirs --no-edit;"
cmd("cd docs; " + merge_cmd)
def lvgl_update_master_version():
global ver_major, ver_minor, ver_patch, ver_str
os.chdir("./lvgl")
cmd("git checkout master")
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", ver_major)
define_set("./lvgl.h", "LVGL_VERSION_MINOR", ver_minor)
define_set("./lvgl.h", "LVGL_VERSION_PATCH", ver_patch)
define_set("./lvgl.h", "LVGL_VERSION_INFO", "dev")
templ = fnmatch.filter(os.listdir('.'), '*templ*')
if templ[0]:
print("Updating version in " + templ[0])
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ ver_str +"/' " + templ[0])
cmd("git commit -am 'Update version'")
os.chdir("../")
def docs_update_latest_version():
global ver_str
os.chdir("./docs")
cmd("git checkout latest --")
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
cmd("git commit -am 'Update version'")
cmd("git checkout master --")
os.chdir("../")
def lvgl_update_dev_version():
global ver_major, ver_minor, ver_patch, dev_ver_str
os.chdir("./lvgl")
cmd("git checkout dev")
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", str(ver_major))
define_set("./lvgl.h", "LVGL_VERSION_MINOR", str(ver_minor))
define_set("./lvgl.h", "LVGL_VERSION_PATCH", str(ver_patch))
define_set("./lvgl.h", "LVGL_VERSION_INFO", "\"dev\"")
templ = fnmatch.filter(os.listdir('.'), '*templ*')
if templ[0]:
print("Updating version in " + templ[0])
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ dev_ver_str +"/' " + templ[0])
cmd("git commit -am 'Update dev version'")
cmd("git checkout master")
os.chdir("../")
def docs_update_dev_version():
global dev_ver_str
os.chdir("./docs")
cmd("git checkout dev --")
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + dev_ver_str + "'/\" conf.py")
cmd("git commit -am 'Update dev version'")
cmd("git checkout master --")
os.chdir("../")
def publish_dev_and_master():
pub_cmd = "git checkout dev; git push origin dev"
cmd("cd lvgl; " + pub_cmd)
pub_cmd = "git checkout master; git push origin master"
cmd("cd lvgl; " + pub_cmd)
def projs_update():
global proj_list, release_br, ver_str
for p in proj_list:
os.chdir("./" + p)
cmd('git checkout master')
print(p + ": upadte lvgl");
cmd("cd lvgl; git co " + release_br + "; git pull origin " + release_br)
cmd("cp -f lvgl/lv_conf_template.h lv_conf.h")
cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h
d = {}
with open("confdef.txt") as f:
for line in f:
(key, val) = line.rstrip().split('\t')
d[key] = val
for k,v in d.items():
define_set("lv_conf.h", str(k), str(v))
if os.path.exists("lv_examples"):
print(p + ": upadte lv_examples");
cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
if os.path.exists("lv_drivers"):
print(p + ": upadte lv_drivers");
cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
msg = 'Update to ' + ver_str
cmd("git add .")
cmd('git commit -am "' + msg + '"')
cmd('git push origin master')
cmd("git tag -a " + ver_str + " -m '" + msg + "' " )
cmd('git push origin ' + ver_str)
os.chdir("../")
def docs_update_all():
cmd("cd docs; git checkout master; python 2.7 ./update.py master dev " + release_br)
def cleanup():
os.chdir("../")
cmd("rm -fr " + workdir)
if __name__ == '__main__':
dev_prepare = 'bugfix'
if(len(sys.argv) != 2):
print("Missing argument. Usage ./release.py bugfix | minor | major")
print("Use minor by deafult")
else:
dev_prepare = sys.argv[1]
if not (dev_prepare in prepare_type):
print("Invalid argument. Usage ./release.py bugfix | minor | major")
exit(1)
clone_repos()
get_lvgl_version("dev")
dev_ver_major = ver_major
dev_ver_minor = ver_minor
dev_ver_patch = ver_patch
dev_ver_str = ver_str
get_lvgl_version("master")
lvgl_prepare()
lv_examples_prepare()
lv_drivers_prepare()
docs_prepare()
blog_add_post()
add_tags()
update_release_branches()
publish_master()
projs_update()
if dev_prepare == 'bugfix':
ver_patch = str(int(ver_patch) + 1)
ver_str = "v" + ver_major + "." + ver_minor + "." + ver_patch + "-dev"
print("Prepare bugfix version " + ver_str)
lvgl_update_master_version()
docs_update_latest_version()
else:
#merge_from_dev()
get_lvgl_version("master")
if dev_prepare == 'minor':
ver_minor = str(int(ver_minor) + 1)
ver_patch = "0"
else:
ver_major = str(int(ver_major) + 1)
ver_minor = "0"
ver_patch = "0"
dev_ver_str = "v" + str(ver_major) + "." + str(ver_minor) + "." + str(ver_patch) + "-dev"
print("Prepare minor version " + dev_ver_str)
lvgl_update_dev_version()
docs_update_dev_version()
publish_dev_and_master()
docs_update_all();
cleanup()

108
scripts/release/com.py Executable file
View File

@@ -0,0 +1,108 @@
#!/usr/bin/env python
import sys
import os.path
from os import path
import os, fnmatch
import re
import subprocess
import com
def cmd(c, ask_on_err = True):
print("\n" + c)
r = os.system(c)
if r:
print("### Error: " + str(r))
if ask_on_err:
input("Press Enter to continue exectution...")
def define_set(fn, name, value):
print("In " + fn + " set " + name + " to " + value)
new_content = ""
s = r'^ *# *define +' + str(name).rstrip() + ' +'
f = open(fn, "r")
for i in f.read().splitlines():
r = re.search(s, i)
if r:
d = i.split("define")
i = d[0] + "define " + name + " " + value
new_content += i + '\n'
f.close()
f = open(fn, "w")
f.write(new_content)
f.close()
def ver_format(ver):
s = "v" + str(ver[0]) + "." + str(ver[1]) + "." + str(ver[2])
if(ver[3] != ""): s = s + "-" + ver[3]
return s
def get_lvgl_version(br):
print("Get LVGL's version")
ver = [0, 0, 0, ""]
os.chdir("./lvgl")
com.cmd("git checkout " + br)
f = open("./lvgl.h", "r")
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
for i in f.read().splitlines():
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
if r:
m = lastNum.search(i)
if m: ver[0] = m.group(1)
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
if r:
m = lastNum.search(i)
if m: ver[1] = m.group(1)
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
if r:
m = lastNum.search(i)
if m: ver[2] = m.group(1)
f.close()
com.cmd("git checkout master")
os.chdir("../")
return ver
def push(c):
cmd("git push " + c)
def update_version(ver):
ver_str = ver_format(ver)
ver_num = ver[0] + "." + ver[1] + "." + ver[2]
templ = fnmatch.filter(os.listdir('.'), '*_templ*.h')
if len(templ) > 0 and templ[0]:
print("Updating version in " + templ[0])
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ "v" + ver_num + "/' " + templ[0])
if os.path.exists("library.json"):
print("Updating version in library.json")
cmd("sed -i -r 's/[0-9]+\.[0-9]+\.[0-9]+/"+ ver_num +"/' library.json")
if path.exists("library.properties"):
print("Updating version in library.properties")
cmd("sed -i -r 's/version=[0-9]+\.[0-9]+\.[0-9]+/"+ "version=" + ver_num + "/' library.properties")
if path.exists("conf.py"):
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
if path.exists("lvgl.h"):
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", str(ver[0]))
define_set("./lvgl.h", "LVGL_VERSION_MINOR", str(ver[1]))
define_set("./lvgl.h", "LVGL_VERSION_PATCH", str(ver[2]))
define_set("./lvgl.h", "LVGL_VERSION_INFO", "\"" + ver[3] + "\"")

74
scripts/release/dev.py Executable file
View File

@@ -0,0 +1,74 @@
#!/usr/bin/env python
import re
import os, fnmatch
import os.path
from os import path
from datetime import date
import com
def lvgl_update_ver(ver, br):
os.chdir("./lvgl")
com.cmd("git checkout " + br)
com.update_version(ver)
com.cmd("git commit -am 'Update " + br + " version'")
com.push("origin " + br)
com.cmd("git checkout master")
os.chdir("../")
def docs_update_ver(ver, br):
os.chdir("./docs")
com.cmd("git checkout " + br + " --")
com.update_version(ver)
com.cmd("git commit -am 'Update " + br + " version'")
com.push("origin " + br)
com.cmd("git checkout master --")
os.chdir("../")
def merge_dev_to_master():
os.chdir("./lvgl")
com.cmd("git checkout master")
com.cmd("git merge dev")
com.push("origin master")
os.chdir("../")
os.chdir("./docs")
com.cmd("git checkout dev -- ") #'dev' sometimes is not recognized so switch to it first
com.cmd("git checkout latest --")
com.cmd("git merge dev -X theirs --no-edit;")
com.push("origin latest")
os.chdir("../")
def make(mode):
if(mode == "bugfix"):
ver = com.get_lvgl_version("master")
ver[3] = "dev"
ver[2] = str(int(ver[2]) + 1)
lvgl_update_ver(ver, "master")
docs_update_ver(ver, "latest")
else:
ver = com.get_lvgl_version("dev")
ver[3] = "dev"
merge_dev_to_master()
if(mode == "major"):
ver[0] = str(int(ver[0]) + 1)
ver[1] = '0'
ver[2] = '0'
if(mode == "minor"):
ver[1] = str(int(ver[1]) + 1)
ver[2] = '0'
lvgl_update_ver(ver, "dev")
docs_update_ver(ver, "dev")
if __name__ == '__main__':
if(len(sys.argv) != 2):
print("Missing argument. Usage ./dev.py major | minor | bugfix")
print("E.g. ./dev.py minor")
else:
make(sys.argv[1])

65
scripts/release/main.py Executable file
View File

@@ -0,0 +1,65 @@
#!/usr/bin/env python
import os.path
from os import path
from datetime import date
import sys
import com
import release
import dev
import proj
upstream_org_url = "https://github.com/lvgl/"
workdir = "./release_tmp"
proj_list = [ "lv_sim_eclipse_sdl", "lv_sim_emscripten"]
def upstream(repo):
return upstream_org_url + repo + ".git"
def clone(repo):
com.cmd("git clone --recurse-submodules " + upstream(repo))
os.chdir("./" + repo)
com.cmd("git checkout master")
com.cmd("git remote update origin --prune")
com.cmd("git pull origin --tags")
os.chdir("..")
def clone_repos():
com.cmd("rm -fr " + workdir)
com.cmd("mkdir " + workdir)
os.chdir(workdir)
clone("lvgl")
clone("lv_examples")
clone("lv_drivers")
clone("docs")
clone("blog")
for p in proj_list:
clone(p)
def cleanup():
os.chdir("../")
com.cmd("rm -fr " + workdir)
if __name__ == '__main__':
prepare_type = ['major', 'minor', 'bugfix']
dev_prepare = 'minor'
# if(len(sys.argv) != 2):
# print("Missing argument. Usage ./release.py bugfix | minor | major")
# print("Use minor by deafult")
# else:
# dev_prepare = sys.argv[1]
if not (dev_prepare in prepare_type):
print("Invalid argument. Usage ./release.py bugfix | minor | major")
exit(1)
os.chdir(workdir)
clone_repos()
release.make()
for p in proj_list:
proj.make(p, True)
dev.make(dev_prepare)
#cleanup()

64
scripts/release/proj.py Executable file
View File

@@ -0,0 +1,64 @@
#!/usr/bin/env python
import sys
import os.path
from os import path
import re
import subprocess
import com
def make(repo_path, auto_push = False):
os.chdir("./" + repo_path)
com.cmd('git checkout master')
print("Upadte lvgl");
os.chdir("./lvgl")
com.cmd("git checkout master")
com.cmd("git pull origin --tags")
out = subprocess.Popen(['git', 'tag', '--sort=-creatordate'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout,stderr = out.communicate()
ver_str = stdout.decode("utf-8").split('\n')[0]
release_br = ver_str[1:] #trim "v"
release_br = release_br.split('.')[0] # get the first number
release_br = "release/v" + release_br
com.cmd("git checkout " + release_br + "; git pull origin " + release_br)
os.chdir("..")
com.cmd("cp -f lvgl/lv_conf_template.h lv_conf.h")
com.cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h
with open("confdef.txt") as f:
for line in f:
(key, val) = line.rstrip().split('\t')
com.define_set("lv_conf.h", str(key), str(val))
if os.path.exists("lv_examples"):
print("Upadte lv_examples");
com.cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
if os.path.exists("lv_drivers"):
print("upadte lv_drivers");
com.cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
msg = 'Update to ' + ver_str
com.cmd("git add .")
com.cmd('git commit -am "' + msg + '"')
com.cmd("git tag -a " + ver_str + " -m '" + msg + "' " )
if auto_push:
com.push("origin --tags")
com.push("origin master")
os.chdir("../")
if __name__ == '__main__':
if(len(sys.argv) != 2):
print("Missing argument. Usage ./projs_update.py repo_path")
print("E.g. ./projs_update.py ./lv_sim_eclipse_sdl")
else:
make(sys.argv[1], sys.argv[2])

173
scripts/release/release.py Executable file
View File

@@ -0,0 +1,173 @@
#!/usr/bin/env python
import os.path
from os import path
from datetime import date
import sys
import com
import re
def update_release_branch(release_br, master_br = "master"):
com.cmd("git checkout " + release_br)
com.cmd("git pull origin " + release_br)
com.cmd("git merge "+ master_br +" -X ours");
com.push("origin " + release_br);
com.cmd("git checkout master");
def lvgl_release(ver):
print("Release lvgl")
ver_str = com.ver_format(ver)
release_br = "release/v" + str(ver[0])
os.chdir("./lvgl")
com.define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"')
# Run some scripts
os.chdir("./scripts")
com.cmd("./code-format.sh")
com.cmd("./lv_conf_checker.py")
com.cmd("doxygen")
os.chdir("../")
com.update_version(ver)
#update CHANGLELOG
new_content = ""
f = open("./CHANGELOG.md", "r")
release_note = ""
note_state = 0
for i in f.read().splitlines():
if note_state == 0:
r = re.search(r'^## ' + ver_str, i)
if r:
i = i.replace("planned on ", "")
note_state+=1
elif note_state == 1:
r = re.search(r'^## ', i)
if r:
note_state+=1
else:
release_note += i + '\n'
new_content += i + '\n'
f.close()
f = open("./CHANGELOG.md", "w")
f.write(new_content)
f.close()
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd('git checkout dev')
com.cmd("git merge master -X ours")
com.cmd("git add .")
com.cmd("git commit -am 'Merge master'", False)
com.push('origin dev')
com.cmd('git checkout master')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
update_release_branch(release_br)
os.chdir("../")
return release_note
def lv_examples_release(ver):
print("Release lv_examples")
os.chdir("./lv_examples")
release_br = "release/v" + str(ver[0])
ver_str = com.ver_format(ver)
com.update_version(ver)
com.cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK(" + str(ver[0]) + ", " + str(ver[1]) + ", " + str(ver[2]) + ")/' lv_examples.h")
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
os.chdir("../")
def lv_drivers_release(ver):
print("Release lv_drivers")
os.chdir("./lv_drivers")
release_br = "release/v" + str(ver[0])
ver_str = com.ver_format(ver)
com.update_version(ver)
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
update_release_branch(release_br)
os.chdir("../")
def docs_release(ver):
print("Release docs")
os.chdir("./docs")
release_br = "release/v" + str(ver[0])
ver_str = com.ver_format(ver)
com.cmd("git co latest --")
com.cmd("rm -rf xml");
com.cmd("cp -r ../lvgl/docs/api_doc/xml .");
com.cmd("git add xml");
com.update_version(ver)
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
update_release_branch(release_br, "latest")
os.chdir("../")
def blog_release(ver, release_note):
os.chdir("./blog/_posts")
ver_str = com.ver_format(ver)
post = "---\nlayout: post\ntitle: " + ver_str + " is released\nauthor: \"kisvegabor\"\ncover: /assets/release_cover.png\n---\n\n"
post += release_note
today = date.today()
d = today.strftime("%Y-%m-%d")
f = open(d + "-release_" + ver_str + ".md", "w")
f.write(post)
f.close()
com.cmd("git add .")
com.cmd("git commit -am 'Add " + ver_str + " release post'")
com.push('origin master')
os.chdir("../../")
def make():
ver = com.get_lvgl_version("master")
release_note = lvgl_release(ver)
lv_examples_release(ver)
lv_drivers_release(ver)
docs_release(ver)
blog_release(ver, release_note)
if __name__ == '__main__':
make()

View File

@@ -186,6 +186,11 @@ static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
* V7.0 COMPATIBILITY
*--------------------*/
#if LV_USE_API_EXTENSION_V7
#if LV_USE_ROLLER
#define LV_ROLLER_MODE_INFINITE LV_ROLLER_MODE_INIFINITE
#endif
#if LV_USE_WIN
static inline lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * img_src)

View File

@@ -10,8 +10,30 @@
#include <stdint.h>
/* Add ESP-IDF related includes */
#if defined (ESP_PLATFORM)
# include "sdkconfig.h"
# include "esp_attr.h"
#endif
/* Handle special Kconfig options */
#include "lv_conf_kconfig.h"
#ifdef CONFIG_LV_CONF_SKIP
#define LV_CONF_SKIP
#endif
/* If "lv_conf.h" is available from here try to use it later.*/
#if defined __has_include
# if __has_include("lv_conf.h")
# ifndef LV_CONF_INCLUDE_SIMPLE
# define LV_CONF_INCLUDE_SIMPLE
# endif
# endif
#endif
/*If lv_conf.h is not skipped include it*/
#if !defined(LV_CONF_SKIP) && !defined(CONFIG_LV_CONF_SKIP)
#if !defined(LV_CONF_SKIP)
# if defined(LV_CONF_PATH) /*If there is a path defined for lv_conf.h use it*/
# define __LV_TO_STR_AUX(x) #x
# define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
@@ -476,6 +498,37 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
# endif
#endif
/*1: Use PXP for CPU off-load on NXP RTxxx platforms */
#ifndef LV_USE_GPU_NXP_PXP
# ifdef CONFIG_LV_USE_GPU_NXP_PXP
# define LV_USE_GPU_NXP_PXP CONFIG_LV_USE_GPU_NXP_PXP
# else
# define LV_USE_GPU_NXP_PXP 0
# endif
#endif
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
* */
#ifndef LV_USE_GPU_NXP_PXP_AUTO_INIT
# ifdef CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
# define LV_USE_GPU_NXP_PXP_AUTO_INIT CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
# else
# define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
# endif
#endif
/*1: Use VG-Lite for CPU offload on NXP RTxxx platforms */
#ifndef LV_USE_GPU_NXP_VG_LITE
# ifdef CONFIG_LV_USE_GPU_NXP_VG_LITE
# define LV_USE_GPU_NXP_VG_LITE CONFIG_LV_USE_GPU_NXP_VG_LITE
# else
# define LV_USE_GPU_NXP_VG_LITE 0
# endif
#endif
/* 1: Enable file system (might be required for images */
#ifndef LV_USE_FILESYSTEM
# ifdef CONFIG_LV_USE_FILESYSTEM
@@ -600,9 +653,20 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
# endif
#endif
/* Required alignment size for buffers */
#ifndef LV_ATTRIBUTE_MEM_ALIGN_SIZE
# ifdef CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE
# define LV_ATTRIBUTE_MEM_ALIGN_SIZE CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE
# else
# define LV_ATTRIBUTE_MEM_ALIGN_SIZE
# endif
#endif
/* With size optimization (-Os) the compiler might not align data to
* 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
* E.g. __attribute__((aligned(4))) */
* 4 or 8 byte boundary. Some HW may need even 32 or 64 bytes.
* This alignment will be explicitly applied where needed.
* LV_ATTRIBUTE_MEM_ALIGN_SIZE should be used to specify required align size.
* E.g. __attribute__((aligned(LV_ATTRIBUTE_MEM_ALIGN_SIZE))) */
#ifndef LV_ATTRIBUTE_MEM_ALIGN
# ifdef CONFIG_LV_ATTRIBUTE_MEM_ALIGN
# define LV_ATTRIBUTE_MEM_ALIGN CONFIG_LV_ATTRIBUTE_MEM_ALIGN
@@ -1005,6 +1069,13 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
# define LV_FONT_UNSCII_8 0
# endif
#endif
#ifndef LV_FONT_UNSCII_16
# ifdef CONFIG_LV_FONT_UNSCII_16
# define LV_FONT_UNSCII_16 CONFIG_LV_FONT_UNSCII_16
# else
# define LV_FONT_UNSCII_16 0
# endif
#endif
/* Optionally declare your custom fonts here.
* You can use these fonts as default font too
@@ -1848,7 +1919,15 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
# define LV_TABLE_COL_MAX 12
# endif
#endif
#ifndef LV_TABLE_CELL_STYLE_CNT
# ifdef CONFIG_LV_TABLE_CELL_STYLE_CNT
# define LV_TABLE_CELL_STYLE_CNT CONFIG_LV_TABLE_CELL_STYLE_CNT
# else
# define LV_TABLE_CELL_STYLE_CNT 4
# endif
#endif
#endif
/*Tab (dependencies: lv_page, lv_btnm)*/
#ifndef LV_USE_TABVIEW
@@ -1914,7 +1993,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
/*If running without lv_conf.h add typdesf with default value*/
#if defined(LV_CONF_SKIP) || defined(CONFIG_LV_CONF_SKIP)
#if defined(LV_CONF_SKIP)
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
typedef int16_t lv_coord_t;

407
src/lv_conf_kconfig.h Normal file
View File

@@ -0,0 +1,407 @@
/**
* @file lv_conf_kconfig.h
* Configs that needs special handling when LVGL is used with Kconfig
*/
#ifndef LV_CONF_KCONFIG_H
#define LV_CONF_KCONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef LV_CONF_KCONFIG_EXTERNAL_INCLUDE
# include LV_CONF_KCONFIG_EXTERNAL_INCLUDE
#else
# if defined ESP_PLATFORM
# include "sdkconfig.h"
# include "esp_attr.h"
# endif
# ifdef __NuttX__
# include <nuttx/config.h>
# endif
#endif /*LV_CONF_KCONFIG_EXTERNAL_INCLUDE*/
/*******************
* LV_MEM_SIZE
*******************/
#ifndef LV_MEM_SIZE
#if defined (CONFIG_LV_MEM_SIZE_BYTES)
#define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_BYTES * 1024U)
#endif
#endif
/*******************
* LV COLOR TRANSP
*******************/
#ifndef LV_COLOR_TRANSP
#if defined (CONFIG_LV_COLOR_TRANSP_HEX)
#define CONFIG_LV_COLOR_TRANSP lv_color_hex(CONFIG_LV_COLOR_TRANSP_HEX)
#else
#define CONFIG_LV_COLOR_TRANSP LV_COLOR_LIME
#endif
#endif
/*******************
* THEME SELECTION
*******************/
#ifndef LV_THEME_DEFAULT_INIT
#if defined (CONFIG_LV_THEME_DEFAULT_INIT_EMPTY)
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_empty_init
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_TEMPLATE)
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_template_init
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_MATERIAL)
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_material_init
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_MONO)
#define LV_THEME_DEFAULT_INIT lv_theme_mono_init
#endif
#endif
/*******************
* COLOR SELECTION
*******************/
#ifndef LV_THEME_DEFAULT_COLOR_PRIMARY
#ifdef CONFIG_LV_THEME_DEFAULT_COLOR_PRIMARY
#define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(CONFIG_LV_THEME_DEFAULT_COLOR_PRIMARY)
#endif
#endif
#ifndef LV_THEME_DEFAULT_COLOR_SECONDARY
#ifdef CONFIG_LV_THEME_DEFAULT_COLOR_SECONDARY
#define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(CONFIG_LV_THEME_DEFAULT_COLOR_SECONDARY)
#endif
#endif
/********************
* FONT SELECTION
*******************/
/* NOTE: In Kconfig instead of `LV_THEME_DEFAULT_FONT_SMALL`
* `CONFIG_LV_THEME_DEFAULT_FONT_SMALL_<font_name>` is defined
* hence the large selection with if-s
*/
/*------------------
* SMALL FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_SMALL
#if defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* NORMAL FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_NORMAL
#if defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* SUBTITLE FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_SUBTITLE
#if defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* TITLE FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_TITLE
#if defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* TEXT ENCODING
*-----------------*/
#ifndef LV_TEXT_ENC
#ifdef CONFIG_LV_TXT_ENC_UTF8
#define CONFIG_LV_TXT_ENC LV_TXT_ENC_UTF8
#elif defined CONFIG_LV_TXT_ENC_ASCII
#define CONFIG_LV_TXT_ENC LV_TXT_ENC_ASCII
#endif
#endif
/*------------------
* BIDI DIRECTION
*-----------------*/
#ifndef LV_BIDI_BASE_DIR_DEF
#ifdef CONFIG_LV_BIDI_DIR_LTR
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_LTR
#elif defined CONFIG_LV_BIDI_DIR_RTL
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_RTL
#elif defined CONFIG_LV_BIDI_DIR_AUTO
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO
#endif
#endif
/*------------------
* EXT CLICK AREA
*-----------------*/
#ifndef LV_USE_EXT_CLICK_AREA
#ifdef CONFIG_LV_USE_EXT_CLICK_AREA_OFF
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF
#elif defined CONFIG_LV_USE_EXT_CLICK_AREA_TINY
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_TINY
#elif defined CONFIG_LV_USE_EXT_CLICK_AREA_FULL
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_FULL
#endif
#endif
/*------------------
* LINEMETER PRECISE
*-----------------*/
#ifndef LV_LINEMETER_PRECISE
#ifdef CONFIG_LV_LINEMETER_PRECISE_NO_EXTRA_PRECISION
#define CONFIG_LV_LINEMETER_PRECISE 0
#elif defined CONFIG_LV_LINEMETER_PRECISE_SOME_EXTRA_PRECISION
#define CONFIG_LV_LINEMETER_PRECISE 1
#elif defined CONFIG_LV_LINEMETER_PRECISE_BEST_PRECISION
#define CONFIG_LV_LINEMETER_PRECISE 2
#endif
#endif
/*------------------
* SPINNER DEF ANIM
*-----------------*/
#ifndef LV_SPINNER_DEF_ANIM
#ifdef CONFIG_LV_SPINNER_TYPE_SPINNING_ARC
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_SPINNING_ARC
#elif defined CONFIG_LV_SPINNER_TYPE_FILLSPIN_ARC
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_FILLSPIN_ARC
#elif defined CONFIG_LV_SPINNER_TYPE_CONSTANT_ARC
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_CONSTANT_ARC
#endif
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_CONF_KCONFIG_H*/

49
src/lv_conf_zephyr.h Normal file
View File

@@ -0,0 +1,49 @@
/*
* Copyright (c) 2020 Jan Van Winkel <jan.van_winkel@dxplore.eu>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifdef __ZEPHYR__
#include <autoconf.h>
#define LV_MEM_CUSTOM 1
#define LV_MEMCPY_MEMSET_STD 1
#ifdef CONFIG_LVGL_MEM_POOL_HEAP_KERNEL
#define LV_MEM_CUSTOM_INCLUDE "kernel.h"
#define LV_MEM_CUSTOM_ALLOC k_malloc
#define LV_MEM_CUTOM_FREE k_free
#elif defined(CONFIG_LVGL_MEM_POOL_HEAP_LIB_C)
#define LV_MEM_CUSTOM_INCLUDE "stdlib.h"
#define LV_MEM_CUSTOM_ALLOC malloc
#define LV_MEM_CUTOM_FREE free
#else
#define LV_MEM_CUSTOM_INCLUDE "lvgl_mem.h"
#define LV_MEM_CUSTOM_ALLOC lvgl_malloc
#define LV_MEM_CUTOM_FREE lvgl_free
#endif
#define LV_ENABLE_GC 0
#define LV_TICK_CUSTOM 1
#define LV_TICK_CUSTOM_INCLUDE "kernel.h"
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (k_uptime_get_32())
#define LV_SPRINTF_CUSTOM 1
#if LV_SPRINTF_CUSTOM
#define LV_SPRINTF_INCLUDE "stdio.h"
#define lv_snprintf snprintf
#define lv_vsnprintf vsnprintf
#endif
#endif

View File

@@ -316,12 +316,6 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
*/
uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("lv_disp_get_inactive_time: no display registered");
return 0;
}
if(disp) return lv_tick_elaps(disp->last_activity_time);
lv_disp_t * d;

View File

@@ -149,7 +149,6 @@ void lv_group_remove_obj(lv_obj_t * obj)
{
lv_group_t * g = obj->group_p;
if(g == NULL) return;
if(g->obj_focus == NULL) return; /*Just to be sure (Not possible if there is at least one object in the group)*/
/*Focus on the next object*/
if(*g->obj_focus == obj) {
@@ -488,8 +487,9 @@ static void focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *)
can_move = true;
if(obj_next == NULL) continue;
if(lv_obj_get_state(*obj_next, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) continue;
/*Hidden objects don't receive focus*/
/*Hidden and disabled objects don't receive focus*/
if(!lv_obj_get_hidden(*obj_next)) break;
}

View File

@@ -807,19 +807,28 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
return;
}
i->proc.types.pointer.act_point.x = i->btn_points[data->btn_id].x;
i->proc.types.pointer.act_point.y = i->btn_points[data->btn_id].y;
lv_coord_t x = i->btn_points[data->btn_id].x;
lv_coord_t y = i->btn_points[data->btn_id].y;
/*Still the same point is pressed*/
if(i->proc.types.pointer.last_point.x == i->proc.types.pointer.act_point.x &&
i->proc.types.pointer.last_point.y == i->proc.types.pointer.act_point.y && data->state == LV_INDEV_STATE_PR) {
indev_proc_press(&i->proc);
}
else {
/*If a new point comes always make a release*/
indev_proc_release(&i->proc);
/*If a new point comes always make a release*/
if(data->state == LV_INDEV_STATE_PR) {
if(i->proc.types.pointer.last_point.x != x ||
i->proc.types.pointer.last_point.y != y) {
indev_proc_release(&i->proc);
}
}
if(indev_reset_check(&i->proc)) return;
/*Save the new points*/
i->proc.types.pointer.act_point.x = x;
i->proc.types.pointer.act_point.y = y;
if(data->state == LV_INDEV_STATE_PR) indev_proc_press(&i->proc);
else indev_proc_release(&i->proc);
if(indev_reset_check(&i->proc)) return;
i->proc.types.pointer.last_point.x = i->proc.types.pointer.act_point.x;
i->proc.types.pointer.last_point.y = i->proc.types.pointer.act_point.y;
}
@@ -868,11 +877,6 @@ static void indev_proc_press(lv_indev_proc_t * proc)
indev_drag_throw(proc);
}
/*Do not use disabled objects*/
if(indev_obj_act && (lv_obj_get_state(indev_obj_act, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED)) {
indev_obj_act = proc->types.pointer.act_obj;
}
/*If a new object was found reset some variables and send a pressed signal*/
if(indev_obj_act != proc->types.pointer.act_obj) {
proc->types.pointer.last_point.x = proc->types.pointer.act_point.x;
@@ -1144,7 +1148,7 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point)
hidden_i = lv_obj_get_parent(hidden_i);
}
/*No parent found with hidden == true*/
if(hidden_i == NULL) found_p = obj;
if(hidden_i == NULL && (lv_obj_get_state(obj, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) == false) found_p = obj;
}
}

View File

@@ -20,13 +20,16 @@
#include "../lv_misc/lv_fs.h"
#include "../lv_misc/lv_gc.h"
#include "../lv_misc/lv_math.h"
#include "../lv_misc/lv_gc.h"
#include "../lv_misc/lv_math.h"
#include "../lv_misc/lv_log.h"
#include "../lv_hal/lv_hal.h"
#include <stdint.h>
#include <string.h>
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
#include "../lv_gpu/lv_gpu_nxp_pxp_osa.h"
#endif
#if defined(LV_GC_INCLUDE)
#include LV_GC_INCLUDE
#endif /* LV_ENABLE_GC */
@@ -194,6 +197,13 @@ void lv_init(void)
lv_gpu_stm32_dma2d_init();
#endif
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
if(lv_gpu_nxp_pxp_init(&pxp_default_cfg) != LV_RES_OK) {
LV_LOG_ERROR("PXP init error. STOP.\n");
for(; ;) ;
}
#endif
_lv_ll_init(&LV_GC_ROOT(_lv_obj_style_trans_ll), sizeof(lv_style_trans_t));
_lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t));
@@ -1888,7 +1898,7 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data)
/**
* Send LV_EVENT_REFRESH event to an object
* @param obj point to an obejct. (Can NOT be NULL)
* @param obj point to an object. (Can NOT be NULL)
* @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event.
*/
lv_res_t lv_event_send_refresh(lv_obj_t * obj)
@@ -3514,7 +3524,8 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_
draw_dsc->font = lv_obj_get_style_text_font(obj, part);
if(draw_dsc->sel_start != LV_DRAW_LABEL_NO_TXT_SEL && draw_dsc->sel_end != LV_DRAW_LABEL_NO_TXT_SEL) {
draw_dsc->color = lv_obj_get_style_text_sel_color(obj, part);
draw_dsc->sel_color = lv_obj_get_style_text_sel_color(obj, part);
draw_dsc->sel_bg_color = lv_obj_get_style_text_sel_bg_color(obj, part);
}
#if LV_USE_BIDI
@@ -4076,8 +4087,9 @@ static void report_style_mod_core(void * style, lv_obj_t * obj)
uint8_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
if(class == style || style == NULL) {
/* changed class to _class to allow compilation as c++ */
lv_style_t * _class = lv_style_list_get_style(list, ci);
if(_class == style || style == NULL) {
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
break;
}
@@ -4615,7 +4627,7 @@ static bool style_prop_is_cacheble(lv_style_property_t prop)
/**
* Update the cache of style list
* @param obj pointer to an obejct
* @param obj pointer to an object
* @param part the part of the object
* @param prop the property which triggered the update
*/
@@ -4747,25 +4759,19 @@ static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_proper
{
if(style_prop_is_cacheble(prop) == false) return;
if(part != LV_OBJ_PART_ALL) {
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
if(list == NULL) return;
if(list == NULL) break;
list->valid_cache = 0;
}
else {
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
if(list == NULL) break;
list->valid_cache = 0;
}
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
if(list == NULL) break;
list->valid_cache = 0;
}
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
if(list == NULL) break;
list->valid_cache = 0;
}
lv_obj_t * child = lv_obj_get_child(obj, NULL);
while(child) {
update_style_cache_children(child);

View File

@@ -850,7 +850,7 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data);
/**
* Send LV_EVENT_REFRESH event to an object
* @param obj point to an obejct. (Can NOT be NULL)
* @param obj point to an object. (Can NOT be NULL)
* @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event.
*/
lv_res_t lv_event_send_refresh(lv_obj_t * obj);

View File

@@ -163,6 +163,7 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_DECOR, text_decor, lv_text_decor_t, _int, sca
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_BLEND_MODE, text_blend_mode, lv_blend_mode_t, _int, scalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_COLOR, text_color, lv_color_t, _color, nonscalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_COLOR, text_sel_color, lv_color_t, _color, nonscalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_BG_COLOR, text_sel_bg_color, lv_color_t, _color, nonscalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_OPA, text_opa, lv_opa_t, _opa, scalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_FONT, text_font, const lv_font_t *, _ptr, scalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(LINE_WIDTH, line_width, lv_style_int_t, _int, scalar)

View File

@@ -54,6 +54,10 @@ static void lv_refr_vdb_flush(void);
**********************/
static uint32_t px_num;
static lv_disp_t * disp_refr; /*Display being refreshed*/
#if LV_USE_PERF_MONITOR
static uint32_t fps_sum_cnt;
static uint32_t fps_sum_all;
#endif
/**********************
* MACROS
@@ -290,17 +294,28 @@ void _lv_disp_refr_task(lv_task_t * task)
}
static uint32_t perf_last_time = 0;
static uint32_t elaps_max = 1;
static uint32_t elaps_sum = 0;
static uint32_t frame_cnt = 0;
if(lv_tick_elaps(perf_last_time) < 300) {
elaps_max = LV_MATH_MAX(elaps, elaps_max);
if(px_num > 5000) {
elaps_sum += elaps;
frame_cnt ++;
}
}
else {
perf_last_time = lv_tick_get();
uint32_t fps = 1000 / (elaps_max == 0 ? 1 : elaps_max);
elaps_max = 1;
uint32_t fps_limit = 1000 / disp_refr->refr_task->period;
uint32_t fps;
if(elaps_sum == 0) elaps_sum = 1;
if(frame_cnt == 0) fps = fps_limit;
else fps = (1000 * frame_cnt) / elaps_sum;
elaps_sum = 0;
frame_cnt = 0;
if(fps > fps_limit) fps = fps_limit;
fps_sum_all += fps;
fps_sum_cnt ++;
uint32_t cpu = 100 - lv_task_get_idle();
lv_label_set_text_fmt(perf_label, "%d FPS\n%d%% CPU", fps, cpu);
lv_obj_align(perf_label, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
@@ -310,6 +325,13 @@ void _lv_disp_refr_task(lv_task_t * task)
LV_LOG_TRACE("lv_refr_task: ready");
}
#if LV_USE_PERF_MONITOR
uint32_t lv_refr_get_fps_avg(void)
{
return fps_sum_all / fps_sum_cnt;
}
#endif
/**********************
* STATIC FUNCTIONS
**********************/
@@ -381,7 +403,7 @@ static void lv_refr_areas(void)
disp_refr->driver.buffer->last_part = 0;
lv_refr_area(&disp_refr->inv_areas[i]);
if(disp_refr->driver.monitor_cb) px_num += lv_area_get_size(&disp_refr->inv_areas[i]);
px_num += lv_area_get_size(&disp_refr->inv_areas[i]);
}
}
}

View File

@@ -78,6 +78,14 @@ lv_disp_t * _lv_refr_get_disp_refreshing(void);
*/
void _lv_refr_set_disp_refreshing(lv_disp_t * disp);
#if LV_USE_PERF_MONITOR
/**
* Get the average FPS since start up
* @return the average FPS
*/
uint32_t lv_refr_get_fps_avg(void);
#endif
/**
* Called periodically to handle the refreshing
* @param task pointer to the task itself

View File

@@ -827,8 +827,9 @@ lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_int(class, prop, &value_act);
/* changed class to _class to allow compilation as c++ */
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_int(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
@@ -880,8 +881,8 @@ lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t pr
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_color(class, prop, &value_act);
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_color(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
*res = value_act;
@@ -930,8 +931,8 @@ lv_res_t _lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_opa(class, prop, &value_act);
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_opa(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
*res = value_act;
@@ -980,8 +981,8 @@ lv_res_t _lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_ptr(class, prop, &value_act);
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_ptr(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
*res = value_act;

View File

@@ -159,14 +159,15 @@ enum {
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_FONT, 0x7, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_NONE),
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_STR, 0x7, LV_STYLE_ID_PTR + 1, LV_STYLE_ATTR_NONE),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LETTER_SPACE, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LINE_SPACE, 0x8, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_DECOR, 0x8, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x8, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_FONT, 0x8, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LETTER_SPACE, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LINE_SPACE, 0x8, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_DECOR, 0x8, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x8, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_BG_COLOR, 0x8, LV_STYLE_ID_COLOR + 2, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_FONT, 0x8, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_LINE_WIDTH, 0x9, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
LV_STYLE_PROP_INIT(LV_STYLE_LINE_BLEND_MODE, 0x9, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),

View File

@@ -394,20 +394,11 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness,
int32_t thick_half = tickness / 2;
uint8_t thick_corr = (tickness & 0x01) ? 0 : 1;
int32_t rx_corr;
int32_t ry_corr;
if(angle > 90 && angle < 270) rx_corr = 0;
else rx_corr = 0;
if(angle > 0 && angle < 180) ry_corr = 0;
else ry_corr = 0;
int32_t cir_x;
int32_t cir_y;
cir_x = ((radius - rx_corr - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
cir_y = ((radius - ry_corr - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
cir_x = ((radius - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
cir_y = ((radius - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
/* Actually the center of the pixel need to be calculated so apply 1/2 px offset*/
if(cir_x > 0) {

View File

@@ -12,7 +12,13 @@
#include "../lv_hal/lv_hal_disp.h"
#include "../lv_core/lv_refr.h"
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#if LV_USE_GPU_NXP_PXP
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
#elif LV_USE_GPU_NXP_VG_LITE
#include "../lv_gpu/lv_gpu_nxp_vglite.h"
#elif LV_USE_GPU_STM32_DMA2D
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#endif
/*********************
* DEFINES
@@ -335,9 +341,19 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
return;
}
#endif
#if LV_USE_GPU_STM32_DMA2D
#elif LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_FILL_SIZE_LIMIT) {
lv_gpu_nxp_pxp_fill(disp_buf, disp_w, draw_area, color, opa);
return;
}
#elif LV_USE_GPU_NXP_VG_LITE
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT) {
if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU_STM32_DMA2D
if(lv_area_get_size(draw_area) >= 240) {
lv_gpu_stm32_dma2d_fill(disp_buf_first, disp_w, color, draw_area_w, draw_area_h);
return;
@@ -351,7 +367,20 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
}
/*No mask with opacity*/
else {
#if LV_USE_GPU
#if LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT) {
lv_gpu_nxp_pxp_fill(disp_buf, disp_w, draw_area, color, opa);
return;
}
#elif LV_USE_GPU_NXP_VG_LITE
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT) {
if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU
if(disp->driver.gpu_blend_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
for(x = 0; x < draw_area_w ; x++) blend_buf[x].full = color.full;
@@ -371,6 +400,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
lv_coord_t line_h = LV_HOR_RES_MAX / draw_area_w;
for(y = 0; y <= draw_area_h - line_h; y += line_h) {
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, blend_buf, opa, draw_area_w, draw_area_w, line_h);
lv_gpu_stm32_dma2d_wait_cb(NULL);
disp_buf_first += disp_w * line_h;
}
@@ -726,7 +756,43 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
#endif
if(opa > LV_OPA_MAX) {
#if LV_USE_GPU_STM32_DMA2D
#if LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= GPU_NXP_PXP_BLIT_SIZE_LIMIT) {
lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa);
return;
}
#elif (LV_USE_GPU_NXP_VG_LITE)
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT) {
lv_gpu_nxp_vglite_blit_info_t blit;
blit.src = map_buf;
blit.src_width = draw_area_w;
blit.src_height = draw_area_h;
blit.src_stride = lv_area_get_width(map_area) * sizeof(lv_color_t);
blit.src_area.x1 = (draw_area->x1 - (map_area->x1 - disp_area->x1));
blit.src_area.y1 = (draw_area->y1 - (map_area->y1 - disp_area->y1));
blit.src_area.x2 = blit.src_area.x1 + draw_area_w;
blit.src_area.y2 = blit.src_area.y1 + draw_area_h;
blit.dst = disp_buf;
blit.dst_width = lv_area_get_width(disp_area);
blit.dst_height = lv_area_get_height(disp_area);
blit.dst_stride = lv_area_get_width(disp_area) * sizeof(lv_color_t);
blit.dst_area.x1 = draw_area->x1;
blit.dst_area.y1 = draw_area->y1;
blit.dst_area.x2 = blit.dst_area.x1 + draw_area_w;
blit.dst_area.y2 = blit.dst_area.y1 + draw_area_h;
blit.opa = opa;
if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU_STM32_DMA2D
if(lv_area_get_size(draw_area) >= 240) {
lv_gpu_stm32_dma2d_copy(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h);
return;
@@ -741,7 +807,43 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
}
}
else {
#if LV_USE_GPU_STM32_DMA2D
#if LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT) {
lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa);
return;
}
#elif (LV_USE_GPU_NXP_VG_LITE)
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT) {
lv_gpu_nxp_vglite_blit_info_t blit;
blit.src = map_buf;
blit.src_width = lv_area_get_width(map_area);
blit.src_height = lv_area_get_height(map_area);
blit.src_stride = lv_area_get_width(map_area) * sizeof(lv_color_t);
blit.src_area.x1 = (draw_area->x1 - (map_area->x1 - disp_area->x1));
blit.src_area.y1 = (draw_area->y1 - (map_area->y1 - disp_area->y1));
blit.src_area.x2 = blit.src_area.x1 + draw_area_w;
blit.src_area.y2 = blit.src_area.y1 + draw_area_h;
blit.dst = disp_buf;
blit.dst_width = lv_area_get_width(disp_area);
blit.dst_height = lv_area_get_height(disp_area);
blit.dst_stride = lv_area_get_width(disp_area) * sizeof(lv_color_t);
blit.dst_area.x1 = draw_area->x1;
blit.dst_area.y1 = draw_area->y1;
blit.dst_area.x2 = blit.dst_area.x1 + draw_area_w;
blit.dst_area.y2 = blit.dst_area.y1 + draw_area_h;
blit.opa = opa;
if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU_STM32_DMA2D
if(lv_area_get_size(draw_area) >= 240) {
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, map_buf_first, opa, map_w, draw_area_w, draw_area_h);
return;

View File

@@ -13,8 +13,11 @@
#include "../lv_core/lv_refr.h"
#include "../lv_misc/lv_mem.h"
#include "../lv_misc/lv_math.h"
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#if LV_USE_GPU_STM32_DMA2D
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#elif LV_USE_GPU_NXP_PXP
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
#endif
/*********************
* DEFINES
@@ -355,6 +358,23 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
draw_dsc->blend_mode);
}
#if LV_USE_GPU_NXP_PXP
/* Simple case without masking and transformations */
else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false &&
chroma_key == true && draw_dsc->recolor_opa == LV_OPA_TRANSP) { /* copy with color keying (+ alpha) */
lv_gpu_nxp_pxp_enable_color_key();
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
draw_dsc->blend_mode);
lv_gpu_nxp_pxp_disable_color_key();
}
else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false &&
chroma_key == false && draw_dsc->recolor_opa != LV_OPA_TRANSP) { /* copy with recolor (+ alpha) */
lv_gpu_nxp_pxp_enable_recolor(draw_dsc->recolor, draw_dsc->recolor_opa);
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
draw_dsc->blend_mode);
lv_gpu_nxp_pxp_disable_recolor();
}
#endif
/*In the other cases every pixel need to be checked one-by-one*/
else {
/*The pixel size in byte is different if an alpha byte is added too*/
@@ -399,7 +419,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
return;
}
#endif
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : lv_area_get_size(&draw_area);
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > (uint32_t) hor_res ? hor_res : lv_area_get_size(&draw_area);
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
@@ -449,7 +470,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
/*Most complicated case: transform or other mask or chroma keyed*/
else {
/*Build the image and a mask line-by-line*/
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : lv_area_get_size(&draw_area);
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > hor_res ? hor_res : lv_area_get_size(&draw_area);
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);

View File

@@ -98,7 +98,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
dsc->font = LV_THEME_DEFAULT_FONT_NORMAL;
dsc->sel_start = LV_DRAW_LABEL_NO_TXT_SEL;
dsc->sel_end = LV_DRAW_LABEL_NO_TXT_SEL;
dsc->sel_color = LV_COLOR_BLUE;
dsc->sel_color = LV_COLOR_BLACK;
dsc->sel_bg_color = LV_COLOR_BLUE;
dsc->bidi_dir = LV_BIDI_DIR_LTR;
}
@@ -234,7 +235,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
lv_draw_rect_dsc_t draw_dsc_sel;
lv_draw_rect_dsc_init(&draw_dsc_sel);
draw_dsc_sel.bg_color = dsc->sel_color;
draw_dsc_sel.bg_color = dsc->sel_bg_color;
int32_t pos_x_start = pos.x;
/*Write out all lines*/
@@ -320,6 +321,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
sel_coords.x2 = pos.x + letter_w + dsc->letter_space - 1;
sel_coords.y2 = pos.y + line_height - 1;
lv_draw_rect(&sel_coords, mask, &draw_dsc_sel);
color = dsc->sel_color;
}
}
@@ -522,7 +524,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
uint32_t col_bit;
col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */
uint32_t mask_buf_size = box_w * box_h > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : box_w * box_h;
lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing());
uint32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : box_w * box_h;
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
int32_t mask_p = 0;

View File

@@ -29,6 +29,7 @@ extern "C" {
typedef struct {
lv_color_t color;
lv_color_t sel_color;
lv_color_t sel_bg_color;
const lv_font_t * font;
lv_opa_t opa;
lv_style_int_t line_space;

View File

@@ -424,7 +424,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
/*Draw the background line by line*/
int32_t h;
size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), LV_HOR_RES_MAX);
uint32_t hor_res = (uint32_t)lv_disp_get_hor_res(disp);
size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), hor_res);
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
lv_area_t fill_area;

View File

@@ -10,6 +10,7 @@
#include "lv_draw_blend.h"
#include "lv_draw_mask.h"
#include "../lv_misc/lv_math.h"
#include "../lv_misc/lv_txt_ap.h"
#include "../lv_core/lv_refr.h"
#include "../lv_misc/lv_debug.h"
@@ -51,7 +52,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc);
#endif
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
lv_coord_t radius, bool radius_is_in, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(const lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
/**********************
@@ -410,7 +411,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
area_inner.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : - (dsc->border_width + rout));
if(dsc->border_side == LV_BORDER_SIDE_FULL) {
draw_full_border(&area_inner, coords, clip, dsc->radius, dsc->border_color, dsc->border_opa, dsc->border_blend_mode);
draw_full_border(&area_inner, coords, clip, dsc->radius, false, dsc->border_color, dsc->border_opa,
dsc->border_blend_mode);
}
else {
lv_opa_t opa = dsc->border_opa;
@@ -1176,7 +1178,7 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, const
area_outer.y1 -= dsc->outline_width;
area_outer.y2 += dsc->outline_width;
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, dsc->outline_color, dsc->outline_opa,
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, true, dsc->outline_color, dsc->outline_opa,
dsc->outline_blend_mode);
}
#endif
@@ -1294,8 +1296,16 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, con
if(dsc->value_str == NULL) return;
if(dsc->value_opa <= LV_OPA_MIN) return;
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
const char * str = dsc->value_str;
#else
uint32_t str_len = _lv_txt_ap_calc_bytes_cnt(dsc->value_str);
char * str = _lv_mem_buf_get(str_len + 1);
_lv_txt_ap_proc(dsc->value_str, str);
#endif
lv_point_t s;
_lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
_lv_txt_get_size(&s, str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
LV_TXT_FLAG_NONE);
lv_area_t value_area;
@@ -1320,12 +1330,12 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, con
label_dsc.color = dsc->value_color;
label_dsc.opa = dsc->value_opa;
lv_draw_label(&value_area, clip, &label_dsc, dsc->value_str, NULL);
lv_draw_label(&value_area, clip, &label_dsc, str, NULL);
}
#endif
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
lv_coord_t radius, bool radius_is_in, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
{
uint8_t other_mask_cnt = lv_draw_mask_get_cnt();
bool simple_mode = true;
@@ -1334,18 +1344,30 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are
int32_t inner_w = lv_area_get_width(area_inner);
int32_t inner_h = lv_area_get_height(area_inner);
lv_coord_t border_width = area_outer->x2 - area_inner->x2;
int32_t rin = radius;
int32_t short_side = LV_MATH_MIN(inner_w, inner_h);
if(rin > short_side >> 1) rin = short_side >> 1;
/*Get the outer area*/
int32_t rout = rin + border_width;
int32_t coords_out_w = lv_area_get_width(area_outer);
int32_t coords_out_h = lv_area_get_height(area_outer);
short_side = LV_MATH_MIN(coords_out_w, coords_out_h);
if(rout > short_side >> 1) rout = short_side >> 1;
int32_t rin;
int32_t rout;
if(radius_is_in) {
rin = radius;
int32_t short_side = LV_MATH_MIN(inner_w, inner_h);
if(rin > short_side >> 1) rin = short_side >> 1;
/*Get the outer area*/
rout = rin + border_width;
}
else {
rout = radius;
int32_t short_side = LV_MATH_MIN(coords_out_w, coords_out_h);
if(rout > short_side >> 1) rout = short_side >> 1;
/*Get the outer area*/
rin = rout - border_width;
if(rin < 0) rin = 0;
}
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
lv_disp_buf_t * vdb = lv_disp_get_buf(disp);

View File

@@ -58,29 +58,53 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
if(point_cnt < 3) return;
if(points == NULL) return;
int16_t i;
/*Join adjacent points if they are on the same coordinate*/
lv_point_t * p = _lv_mem_buf_get(point_cnt * sizeof(lv_point_t));
if(p == NULL) return;
uint16_t i;
uint16_t pcnt = 0;
p[0] = points[0];
for(i = 0; i < point_cnt - 1; i++) {
if(points[i].x != points[i + 1].x || points[i].y != points[i + 1].y) {
p[pcnt] = points[i];
pcnt++;
}
}
/*The first and the last points are also adjacent */
if(points[0].x != points[point_cnt - 1].x || points[0].y != points[point_cnt - 1].y) {
p[pcnt] = points[point_cnt - 1];
pcnt++;
}
point_cnt = pcnt;
if(point_cnt < 3) {
_lv_mem_buf_release(p);
return;
}
lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN};
for(i = 0; i < point_cnt; i++) {
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, points[i].x);
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, points[i].y);
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, points[i].x);
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, points[i].y);
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, p[i].x);
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, p[i].y);
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, p[i].x);
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, p[i].y);
}
bool is_common;
lv_area_t poly_mask;
is_common = _lv_area_intersect(&poly_mask, &poly_coords, clip_area);
if(!is_common) return;
if(!is_common) {
_lv_mem_buf_release(p);
return;
}
/*Find the lowest point*/
lv_coord_t y_min = points[0].y;
lv_coord_t y_min = p[0].y;
int16_t y_min_i = 0;
for(i = 1; i < point_cnt; i++) {
if(points[i].y < y_min) {
y_min = points[i].y;
if(p[i].y < y_min) {
y_min = p[i].y;
y_min_i = i;
}
}
@@ -94,16 +118,28 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
int32_t i_next_right;
uint32_t mask_cnt = 0;
/* Check if the order of points is inverted or not.
* The normal case is when the left point is on `y_min_i - 1`*/
/*Get the index of the left and right points*/
i_next_left = y_min_i - 1;
if(i_next_left < 0) i_next_left = point_cnt + i_next_left;
i_next_right = y_min_i + 1;
if(i_next_right > point_cnt - 1) i_next_right = 0;
/* Check if the order of points is inverted or not.
* The normal case is when the left point is on `y_min_i - 1`
* Explanation:
* if angle(p_left) < angle(p_right) -> inverted
* dy_left/dx_left < dy_right/dx_right
* dy_left * dx_right < dy_right * dx_left
*/
lv_coord_t dxl = p[i_next_left].x - p[y_min_i].x;
lv_coord_t dxr = p[i_next_right].x - p[y_min_i].x;
lv_coord_t dyl = p[i_next_left].y - p[y_min_i].y;
lv_coord_t dyr = p[i_next_right].y - p[y_min_i].y;
bool inv = false;
if(points[i_next_left].x > points[i_next_right].x && points[i_next_left].y < points[i_next_right].y) inv = true;
if(dyl * dxr < dyr * dxl) inv = true;
do {
if(!inv) {
@@ -121,11 +157,11 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
if(i_next_right < 0) i_next_right = point_cnt + i_next_right;
}
if(points[i_next_left].y >= points[i_prev_left].y) {
if(points[i_next_left].y != points[i_prev_left].y &&
points[i_next_left].x != points[i_prev_left].x) {
lv_draw_mask_line_points_init(mp_next, points[i_prev_left].x, points[i_prev_left].y,
points[i_next_left].x, points[i_next_left].y,
if(p[i_next_left].y >= p[i_prev_left].y) {
if(p[i_next_left].y != p[i_prev_left].y &&
p[i_next_left].x != p[i_prev_left].x) {
lv_draw_mask_line_points_init(mp_next, p[i_prev_left].x, p[i_prev_left].y,
p[i_next_left].x, p[i_next_left].y,
LV_DRAW_MASK_LINE_SIDE_RIGHT);
lv_draw_mask_add(mp_next, mp);
mp_next++;
@@ -136,12 +172,12 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
if(mask_cnt == point_cnt) break;
if(points[i_next_right].y >= points[i_prev_right].y) {
if(points[i_next_right].y != points[i_prev_right].y &&
points[i_next_right].x != points[i_prev_right].x) {
if(p[i_next_right].y >= p[i_prev_right].y) {
if(p[i_next_right].y != p[i_prev_right].y &&
p[i_next_right].x != p[i_prev_right].x) {
lv_draw_mask_line_points_init(mp_next, points[i_prev_right].x, points[i_prev_right].y,
points[i_next_right].x, points[i_next_right].y,
lv_draw_mask_line_points_init(mp_next, p[i_prev_right].x, p[i_prev_right].y,
p[i_next_right].x, p[i_next_right].y,
LV_DRAW_MASK_LINE_SIDE_LEFT);
lv_draw_mask_add(mp_next, mp);
mp_next++;
@@ -157,6 +193,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
lv_draw_mask_remove_custom(mp);
_lv_mem_buf_release(mp);
_lv_mem_buf_release(p);
}

View File

@@ -24,11 +24,6 @@ extern "C" {
/*********************
* DEFINES
*********************/
/*Number of fractional digits in the advanced width (`adv_w`) field of `lv_font_glyph_dsc_t`*/
#define LV_FONT_WIDTH_FRACT_DIGIT 4
#define LV_FONT_KERN_POSITIVE 0
#define LV_FONT_KERN_NEGATIVE 1
/**********************
* TYPEDEFS
@@ -227,6 +222,10 @@ LV_FONT_DECLARE(lv_font_montserrat_12_subpx)
LV_FONT_DECLARE(lv_font_unscii_8)
#endif
#if LV_FONT_UNSCII_16
LV_FONT_DECLARE(lv_font_unscii_16)
#endif
#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW
LV_FONT_DECLARE(lv_font_dejavu_16_persian_hebrew)
#endif

View File

@@ -1,6 +1,8 @@
CSRCS += lv_font.c
CSRCS += lv_font_fmt_txt.c
CSRCS += lv_font_loader.c
CSRCS += lv_font_montserrat_8.c
CSRCS += lv_font_montserrat_10.c
CSRCS += lv_font_montserrat_12.c
CSRCS += lv_font_montserrat_14.c
CSRCS += lv_font_montserrat_16.c

View File

@@ -42,22 +42,26 @@ static int32_t unicode_list_compare(const void * ref, const void * element);
static int32_t kern_pair_8_compare(const void * ref, const void * element);
static int32_t kern_pair_16_compare(const void * ref, const void * element);
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter);
static inline void decompress_line(uint8_t * out, lv_coord_t w);
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
static inline void rle_init(const uint8_t * in, uint8_t bpp);
static inline uint8_t rle_next(void);
#if LV_USE_FONT_COMPRESSED
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter);
static inline void decompress_line(uint8_t * out, lv_coord_t w);
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
static inline void rle_init(const uint8_t * in, uint8_t bpp);
static inline uint8_t rle_next(void);
#endif /* LV_USE_FONT_COMPRESSED */
/**********************
* STATIC VARIABLES
**********************/
static uint32_t rle_rdp;
static const uint8_t * rle_in;
static uint8_t rle_bpp;
static uint8_t rle_prev_v;
static uint8_t rle_cnt;
static rle_state_t rle_state;
#if LV_USE_FONT_COMPRESSED
static uint32_t rle_rdp;
static const uint8_t * rle_in;
static uint8_t rle_bpp;
static uint8_t rle_prev_v;
static uint8_t rle_cnt;
static rle_state_t rle_state;
#endif /* LV_USE_FONT_COMPRESSED */
/**********************
* GLOBAL PROTOTYPES
@@ -338,6 +342,7 @@ static int32_t kern_pair_16_compare(const void * ref, const void * element)
else return (int32_t) ref16_p[1] - element16_p[1];
}
#if LV_USE_FONT_COMPRESSED
/**
* The compress a glyph's bitmap
* @param in the compressed bitmap
@@ -567,6 +572,7 @@ static inline uint8_t rle_next(void)
return ret;
}
#endif /* LV_USE_FONT_COMPRESSED */
/** Code Comparator.
*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,635 @@
#include "../../lvgl.h"
/*******************************************************************************
* Size: 16 px
* Bpp: 1
* Opts:
******************************************************************************/
#ifndef LV_FONT_UNSCII_16
#define LV_FONT_UNSCII_16 1
#endif
#if LV_FONT_UNSCII_16
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
/* U+20 " " */
0x0,
/* U+21 "!" */
0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff,
/* U+22 "\"" */
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf,
/* U+23 "#" */
0x3c, 0xf0, 0xf3, 0xc3, 0xcf, 0xf, 0x3c, 0xff,
0xff, 0xff, 0xf3, 0xcf, 0xf, 0x3c, 0xff, 0xff,
0xff, 0xf3, 0xcf, 0xf, 0x3c, 0x3c, 0xf0, 0xf3,
0xc0,
/* U+24 "$" */
0xf, 0x0, 0xf0, 0x3f, 0xf3, 0xff, 0xf0, 0xf,
0x0, 0x3f, 0xc3, 0xfc, 0x0, 0xf0, 0xf, 0xff,
0xcf, 0xfc, 0xf, 0x0, 0xf0,
/* U+25 "%" */
0xf0, 0x3f, 0xc0, 0xff, 0xf, 0x3c, 0x3c, 0x3,
0xc0, 0xf, 0x0, 0xf0, 0x3, 0xc0, 0x3c, 0x3c,
0xf0, 0xff, 0x3, 0xfc, 0xf,
/* U+26 "&" */
0xf, 0xc0, 0x3f, 0x3, 0xcf, 0xf, 0x3c, 0xf,
0xc0, 0x3f, 0x3, 0xf3, 0xcf, 0xcf, 0xf3, 0xf3,
0xcf, 0xcf, 0xf, 0x3c, 0x3c, 0x3f, 0x3c, 0xfc,
0xf0,
/* U+27 "'" */
0x3c, 0xf3, 0xcf, 0xf3, 0xc0,
/* U+28 "(" */
0xf, 0xf, 0x3c, 0x3c, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf,
/* U+29 ")" */
0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf, 0xf, 0xf,
0xf, 0xf, 0x3c, 0x3c, 0xf0, 0xf0,
/* U+2A "*" */
0x3c, 0x3c, 0x3c, 0x3c, 0xf, 0xf0, 0xf, 0xf0,
0xff, 0xff, 0xff, 0xff, 0xf, 0xf0, 0xf, 0xf0,
0x3c, 0x3c, 0x3c, 0x3c,
/* U+2B "+" */
0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xff, 0xff,
0xff, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
/* U+2C "," */
0x3c, 0xf3, 0xcf, 0xf3, 0xc0,
/* U+2D "-" */
0xff, 0xff, 0xff,
/* U+2E "." */
0xff, 0xff,
/* U+2F "/" */
0x0, 0xf, 0x0, 0xf, 0x0, 0x3c, 0x0, 0x3c,
0x0, 0xf0, 0x0, 0xf0, 0x3, 0xc0, 0x3, 0xc0,
0xf, 0x0, 0xf, 0x0, 0x3c, 0x0, 0x3c, 0x0,
0xf0, 0x0, 0xf0, 0x0,
/* U+30 "0" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf3, 0xff,
0x3f, 0xfc, 0xff, 0xcf, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+31 "1" */
0xf, 0x0, 0xf0, 0x3f, 0x3, 0xf0, 0xf, 0x0,
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xf0, 0xff, 0xff, 0xff,
/* U+32 "2" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0x3, 0xc0,
0x3c, 0xf, 0x0, 0xf0, 0x3c, 0x3, 0xc0, 0xf0,
0xf, 0x0, 0xff, 0xff, 0xff,
/* U+33 "3" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0x0, 0xf0,
0xf, 0xf, 0xc0, 0xfc, 0x0, 0xf0, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+34 "4" */
0x3, 0xf0, 0xf, 0xc0, 0xff, 0x3, 0xfc, 0x3c,
0xf0, 0xf3, 0xcf, 0xf, 0x3c, 0x3c, 0xff, 0xff,
0xff, 0xf0, 0xf, 0x0, 0x3c, 0x0, 0xf0, 0x3,
0xc0,
/* U+35 "5" */
0xff, 0xff, 0xff, 0xf0, 0xf, 0x0, 0xff, 0xcf,
0xfc, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+36 "6" */
0xf, 0xc0, 0xfc, 0x3c, 0x3, 0xc0, 0xf0, 0xf,
0x0, 0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+37 "7" */
0xff, 0xff, 0xff, 0x0, 0xf0, 0xf, 0x0, 0xf0,
0xf, 0x3, 0xc0, 0x3c, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xf0, 0xf, 0x0, 0xf0,
/* U+38 "8" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+39 "9" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0x3,
0xc0, 0x3c, 0x3f, 0x3, 0xf0,
/* U+3A ":" */
0xff, 0xff, 0x0, 0x0, 0xff, 0xff,
/* U+3B ";" */
0x3c, 0xf3, 0xcf, 0x0, 0x0, 0x0, 0x3c, 0xf3,
0xcf, 0xf3, 0xc0,
/* U+3C "<" */
0x3, 0xc0, 0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf,
0x3, 0xc0, 0x3c, 0xf, 0x0, 0xf0, 0x3c, 0x3,
0xc0, 0xf0,
/* U+3D "=" */
0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0xff, 0xff,
0xff,
/* U+3E ">" */
0xf0, 0x3c, 0x3, 0xc0, 0xf0, 0xf, 0x3, 0xc0,
0x3c, 0xf, 0xf, 0x3, 0xc3, 0xc0, 0xf0, 0xf0,
0x3c, 0x0,
/* U+3F "?" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0x0, 0xf0,
0xf, 0x3, 0xc0, 0x3c, 0xf, 0x0, 0xf0, 0x0,
0x0, 0x0, 0xf, 0x0, 0xf0,
/* U+40 "@" */
0x3f, 0xf0, 0xff, 0xcf, 0x3, 0xfc, 0xf, 0xf3,
0xff, 0xcf, 0xff, 0x3f, 0xfc, 0xff, 0xf3, 0xff,
0xcf, 0xff, 0x0, 0x3c, 0x0, 0x3f, 0xf0, 0xff,
0xc0,
/* U+41 "A" */
0xf, 0x0, 0xf0, 0x3f, 0xc3, 0xfc, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0xff, 0xff, 0xff, 0xf0,
0xff, 0xf, 0xf0, 0xff, 0xf,
/* U+42 "B" */
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0xff, 0xcf, 0xfc,
/* U+43 "C" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+44 "D" */
0xff, 0xf, 0xf0, 0xf3, 0xcf, 0x3c, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf3,
0xcf, 0x3c, 0xff, 0xf, 0xf0,
/* U+45 "E" */
0xff, 0xff, 0xff, 0xf0, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
0xf, 0x0, 0xff, 0xff, 0xff,
/* U+46 "F" */
0xff, 0xff, 0xff, 0xf0, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
0xf, 0x0, 0xf0, 0xf, 0x0,
/* U+47 "G" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
0x0, 0xf3, 0xff, 0x3f, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xf3, 0xff,
/* U+48 "H" */
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0xf0, 0xff, 0xf,
/* U+49 "I" */
0xff, 0xff, 0xff, 0xf, 0x0, 0xf0, 0xf, 0x0,
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xf0, 0xff, 0xff, 0xff,
/* U+4A "J" */
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+4B "K" */
0xf0, 0x3f, 0xc0, 0xff, 0xf, 0x3c, 0x3c, 0xf3,
0xc3, 0xcf, 0xf, 0xf0, 0x3f, 0xc0, 0xf3, 0xc3,
0xcf, 0xf, 0xf, 0x3c, 0x3c, 0xf0, 0x3f, 0xc0,
0xf0,
/* U+4C "L" */
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
0xf, 0x0, 0xff, 0xff, 0xff,
/* U+4D "M" */
0xf0, 0x3f, 0xc0, 0xff, 0xcf, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0x33, 0xfc, 0xcf, 0xf0, 0x3f,
0xc0, 0xff, 0x3, 0xfc, 0xf, 0xf0, 0x3f, 0xc0,
0xf0,
/* U+4E "N" */
0xf0, 0x3f, 0xc0, 0xff, 0xc3, 0xff, 0xf, 0xff,
0x3f, 0xfc, 0xff, 0x3f, 0xfc, 0xff, 0xf0, 0xff,
0xc3, 0xff, 0x3, 0xfc, 0xf, 0xf0, 0x3f, 0xc0,
0xf0,
/* U+4F "O" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+50 "P" */
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
0xf, 0x0, 0xf0, 0xf, 0x0,
/* U+51 "Q" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf3,
0xcf, 0x3c, 0x3c, 0xf3, 0xcf,
/* U+52 "R" */
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xff, 0xcf, 0xfc, 0xf3, 0xcf, 0x3c, 0xf0,
0xff, 0xf, 0xf0, 0xff, 0xf,
/* U+53 "S" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
0x0, 0x3f, 0xc3, 0xfc, 0x0, 0xf0, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+54 "T" */
0xff, 0xff, 0xff, 0xf, 0x0, 0xf0, 0xf, 0x0,
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xf0, 0xf, 0x0, 0xf0,
/* U+55 "U" */
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+56 "V" */
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0x3f,
0xc3, 0xfc, 0xf, 0x0, 0xf0,
/* U+57 "W" */
0xf0, 0x3f, 0xc0, 0xff, 0x3, 0xfc, 0xf, 0xf0,
0x3f, 0xc0, 0xff, 0x33, 0xfc, 0xcf, 0xff, 0xff,
0xff, 0xff, 0xcf, 0xff, 0x3f, 0xf0, 0x3f, 0xc0,
0xf0,
/* U+58 "X" */
0xf0, 0xf, 0xf0, 0xf, 0x3c, 0x3c, 0x3c, 0x3c,
0xf, 0xf0, 0xf, 0xf0, 0x3, 0xc0, 0x3, 0xc0,
0xf, 0xf0, 0xf, 0xf0, 0x3c, 0x3c, 0x3c, 0x3c,
0xf0, 0xf, 0xf0, 0xf,
/* U+59 "Y" */
0xf0, 0xf, 0xf0, 0xf, 0x3c, 0x3c, 0x3c, 0x3c,
0xf, 0xf0, 0xf, 0xf0, 0x3, 0xc0, 0x3, 0xc0,
0x3, 0xc0, 0x3, 0xc0, 0x3, 0xc0, 0x3, 0xc0,
0x3, 0xc0, 0x3, 0xc0,
/* U+5A "Z" */
0xff, 0xff, 0xff, 0x0, 0xf0, 0xf, 0x3, 0xc0,
0x3c, 0xf, 0x0, 0xf0, 0x3c, 0x3, 0xc0, 0xf0,
0xf, 0x0, 0xff, 0xff, 0xff,
/* U+5B "[" */
0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff,
/* U+5C "\\" */
0xf0, 0x0, 0xf0, 0x0, 0x3c, 0x0, 0x3c, 0x0,
0xf, 0x0, 0xf, 0x0, 0x3, 0xc0, 0x3, 0xc0,
0x0, 0xf0, 0x0, 0xf0, 0x0, 0x3c, 0x0, 0x3c,
0x0, 0xf, 0x0, 0xf,
/* U+5D "]" */
0xff, 0xff, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf,
0xf, 0xf, 0xf, 0xf, 0xff, 0xff,
/* U+5E "^" */
0x3, 0x0, 0xc, 0x0, 0xfc, 0x3, 0xf0, 0x3c,
0xf0, 0xf3, 0xcf, 0x3, 0xfc, 0xf,
/* U+5F "_" */
0xff, 0xff, 0xff, 0xff,
/* U+60 "`" */
0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf,
/* U+61 "a" */
0x3f, 0xc3, 0xfc, 0x0, 0xf0, 0xf, 0x3f, 0xf3,
0xff, 0xf0, 0xff, 0xf, 0x3f, 0xf3, 0xff,
/* U+62 "b" */
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xff, 0xcf,
0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0xff, 0xcf, 0xfc,
/* U+63 "c" */
0x3f, 0xcf, 0xff, 0x3, 0xc0, 0xf0, 0x3c, 0xf,
0x3, 0xc0, 0x3f, 0xcf, 0xf0,
/* U+64 "d" */
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x3f, 0xf3,
0xff, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0x3f, 0xf3, 0xff,
/* U+65 "e" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xff, 0xff,
0xff, 0xf0, 0xf, 0x0, 0x3f, 0xc3, 0xfc,
/* U+66 "f" */
0xf, 0xc3, 0xf3, 0xc0, 0xf0, 0xff, 0xff, 0xf3,
0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3c,
0xf, 0x0,
/* U+67 "g" */
0x3f, 0xf3, 0xff, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0xff,
0xcf, 0xfc,
/* U+68 "h" */
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xff, 0xcf,
0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
0xff, 0xf, 0xf0, 0xff, 0xf,
/* U+69 "i" */
0x3c, 0xf, 0x0, 0x0, 0x0, 0xfc, 0x3f, 0x3,
0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3f,
0xcf, 0xf0,
/* U+6A "j" */
0x3, 0xc0, 0xf0, 0x0, 0x0, 0x3, 0xc0, 0xf0,
0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3c, 0xf, 0x3,
0xc0, 0xff, 0xf3, 0xfc,
/* U+6B "k" */
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xff,
0xf, 0xf3, 0xcf, 0x3c, 0xff, 0xf, 0xf0, 0xf3,
0xcf, 0x3c, 0xf0, 0xff, 0xf,
/* U+6C "l" */
0xfc, 0x3f, 0x3, 0xc0, 0xf0, 0x3c, 0xf, 0x3,
0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3f,
0xcf, 0xf0,
/* U+6D "m" */
0xf0, 0xf3, 0xc3, 0xcf, 0xff, 0xff, 0xff, 0xf3,
0x3f, 0xcc, 0xff, 0x33, 0xfc, 0xcf, 0xf0, 0x3f,
0xc0, 0xf0,
/* U+6E "n" */
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf,
/* U+6F "o" */
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0x3f, 0xc3, 0xfc,
/* U+70 "p" */
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
0xf, 0x0,
/* U+71 "q" */
0x3f, 0xf3, 0xff, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0x0,
0xf0, 0xf,
/* U+72 "r" */
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0,
/* U+73 "s" */
0x3f, 0xf3, 0xff, 0xf0, 0xf, 0x0, 0x3f, 0xc3,
0xfc, 0x0, 0xf0, 0xf, 0xff, 0xcf, 0xfc,
/* U+74 "t" */
0x3c, 0x3, 0xc0, 0x3c, 0x3, 0xc0, 0xff, 0xff,
0xff, 0x3c, 0x3, 0xc0, 0x3c, 0x3, 0xc0, 0x3c,
0x3, 0xc0, 0xf, 0xf0, 0xff,
/* U+75 "u" */
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0xf0, 0xff, 0xf, 0x3f, 0xf3, 0xff,
/* U+76 "v" */
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0x3f, 0xc3, 0xfc, 0xf, 0x0, 0xf0,
/* U+77 "w" */
0xf0, 0x3f, 0xc0, 0xff, 0x3, 0xfc, 0xf, 0xf3,
0x3f, 0xcc, 0xf3, 0xff, 0xf, 0xfc, 0x3c, 0xf0,
0xf3, 0xc0,
/* U+78 "x" */
0xf0, 0x3f, 0xc0, 0xf3, 0xcf, 0xf, 0x3c, 0xf,
0xc0, 0x3f, 0x3, 0xcf, 0xf, 0x3c, 0xf0, 0x3f,
0xc0, 0xf0,
/* U+79 "y" */
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0x3f,
0xc3, 0xfc,
/* U+7A "z" */
0xff, 0xff, 0xff, 0x3, 0xc0, 0x3c, 0xf, 0x0,
0xf0, 0x3c, 0x3, 0xc0, 0xff, 0xff, 0xff,
/* U+7B "{" */
0x3, 0xf0, 0x3f, 0xf, 0x0, 0xf0, 0xf, 0x0,
0xf0, 0xfc, 0xf, 0xc0, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xf0, 0x3, 0xf0, 0x3f,
/* U+7C "|" */
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
/* U+7D "}" */
0xfc, 0xf, 0xc0, 0xf, 0x0, 0xf0, 0xf, 0x0,
0xf0, 0x3, 0xf0, 0x3f, 0xf, 0x0, 0xf0, 0xf,
0x0, 0xf0, 0xfc, 0xf, 0xc0,
/* U+7E "~" */
0x3f, 0x3c, 0xfc, 0xff, 0x3f, 0x3c, 0xfc,
/* U+7F "" */
0xf0, 0x3, 0xc0, 0xc, 0xc0, 0x33, 0x0, 0xcc,
0xff, 0x33, 0xfc, 0xc3, 0x33, 0xc, 0xf0, 0x33,
0xc0, 0xc0, 0x3, 0x0, 0xc, 0x0, 0x30, 0x0,
0xc0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 256, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 16},
{.bitmap_index = 1, .adv_w = 256, .box_w = 4, .box_h = 14, .ofs_x = 6, .ofs_y = 2},
{.bitmap_index = 8, .adv_w = 256, .box_w = 12, .box_h = 6, .ofs_x = 2, .ofs_y = 10},
{.bitmap_index = 17, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 42, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 63, .adv_w = 256, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 84, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 109, .adv_w = 256, .box_w = 6, .box_h = 6, .ofs_x = 4, .ofs_y = 10},
{.bitmap_index = 114, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
{.bitmap_index = 128, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
{.bitmap_index = 142, .adv_w = 256, .box_w = 16, .box_h = 10, .ofs_x = 0, .ofs_y = 4},
{.bitmap_index = 162, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 4},
{.bitmap_index = 177, .adv_w = 256, .box_w = 6, .box_h = 6, .ofs_x = 4, .ofs_y = 0},
{.bitmap_index = 182, .adv_w = 256, .box_w = 12, .box_h = 2, .ofs_x = 2, .ofs_y = 8},
{.bitmap_index = 185, .adv_w = 256, .box_w = 4, .box_h = 4, .ofs_x = 6, .ofs_y = 2},
{.bitmap_index = 187, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 215, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 236, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 257, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 278, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 299, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 324, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 345, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 366, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 387, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 408, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 429, .adv_w = 256, .box_w = 4, .box_h = 12, .ofs_x = 6, .ofs_y = 2},
{.bitmap_index = 435, .adv_w = 256, .box_w = 6, .box_h = 14, .ofs_x = 4, .ofs_y = 0},
{.bitmap_index = 446, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 464, .adv_w = 256, .box_w = 12, .box_h = 6, .ofs_x = 2, .ofs_y = 6},
{.bitmap_index = 473, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 491, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 512, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 537, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 558, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 579, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 600, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 621, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 642, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 663, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 684, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 705, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 726, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 747, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 772, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 793, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 818, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 843, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 864, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 885, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 906, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 927, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 948, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 969, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 990, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1011, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1036, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1064, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1092, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1113, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
{.bitmap_index = 1127, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1155, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
{.bitmap_index = 1169, .adv_w = 256, .box_w = 14, .box_h = 8, .ofs_x = 0, .ofs_y = 8},
{.bitmap_index = 1183, .adv_w = 256, .box_w = 16, .box_h = 2, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1187, .adv_w = 256, .box_w = 8, .box_h = 6, .ofs_x = 6, .ofs_y = 10},
{.bitmap_index = 1193, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1208, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1229, .adv_w = 256, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1242, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1263, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1278, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1296, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1314, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1335, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
{.bitmap_index = 1353, .adv_w = 256, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1373, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1394, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
{.bitmap_index = 1412, .adv_w = 256, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1430, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1445, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1460, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1478, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1496, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1511, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1526, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1547, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1562, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1577, .adv_w = 256, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1595, .adv_w = 256, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1613, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1631, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1646, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1667, .adv_w = 256, .box_w = 4, .box_h = 14, .ofs_x = 6, .ofs_y = 2},
{.bitmap_index = 1674, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
{.bitmap_index = 1695, .adv_w = 256, .box_w = 14, .box_h = 4, .ofs_x = 0, .ofs_y = 12},
{.bitmap_index = 1702, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] = {
{
.range_start = 32, .range_length = 96, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
/*Store all the custom data of the font*/
static lv_font_fmt_txt_dsc_t font_dsc = {
.glyph_bitmap = gylph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = NULL,
.kern_scale = 0,
.cmap_num = 1,
.bpp = 1,
.kern_classes = 0,
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
lv_font_t lv_font_unscii_16 = {
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 17, /*The maximum line height required by the font*/
.base_line = 0, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = 0,
.underline_thickness = 0,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_UNSCII_16*/

View File

@@ -19,288 +19,289 @@
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
/* U+20 " " */
0x0,
/* U+21 "!" */
0xf2,
0xff, 0xcc,
/* U+22 "\"" */
0x99, 0x90,
0xcf, 0x3c, 0xc0,
/* U+23 "#" */
0x49, 0x2f, 0xd2, 0xfd, 0x24, 0x80,
0x6c, 0xdb, 0xfb, 0x6f, 0xed, 0x9b, 0x0,
/* U+24 "$" */
0x23, 0xe8, 0xe2, 0xf8, 0x80,
0x31, 0xfc, 0x1e, 0xf, 0xe3, 0x0,
/* U+25 "%" */
0xc7, 0x21, 0x8, 0x4e, 0x30,
0xc7, 0x98, 0x61, 0x86, 0x78, 0xc0,
/* U+26 "&" */
0x62, 0x49, 0x18, 0x96, 0x27, 0x40,
0x38, 0xd8, 0xe3, 0xbd, 0xd9, 0x9d, 0x80,
/* U+27 "'" */
0x2a, 0x0,
0x6f, 0x0,
/* U+28 "(" */
0x2a, 0x48, 0x88,
0x36, 0xcc, 0xc6, 0x30,
/* U+29 ")" */
0x88, 0x92, 0xa0,
0xc6, 0x33, 0x36, 0xc0,
/* U+2A "*" */
0x25, 0x5c, 0x47, 0x54, 0x80,
0x66, 0x3c, 0xff, 0x3c, 0x66,
/* U+2B "+" */
0x21, 0x3e, 0x42, 0x0,
0x30, 0xcf, 0xcc, 0x30,
/* U+2C "," */
0x58,
0x6f, 0x0,
/* U+2D "-" */
0xf8,
0xfc,
/* U+2E "." */
0x80,
0xf0,
/* U+2F "/" */
0x2, 0x8, 0x20, 0x82, 0x8, 0x20, 0x0,
0x3, 0x6, 0xc, 0x18, 0x30, 0x60, 0xc0,
/* U+30 "0" */
0x74, 0x67, 0x5c, 0xc5, 0xc0,
0x7b, 0x3d, 0xfb, 0xcf, 0x37, 0x80,
/* U+31 "1" */
0x23, 0x28, 0x42, 0x13, 0xe0,
0x31, 0xc3, 0xc, 0x30, 0xcf, 0xc0,
/* U+32 "2" */
0x74, 0x42, 0x26, 0x43, 0xe0,
0x7b, 0x31, 0x8c, 0x63, 0xf, 0xc0,
/* U+33 "3" */
0x74, 0x42, 0x60, 0xc5, 0xc0,
0x7b, 0x30, 0xce, 0xf, 0x37, 0x80,
/* U+34 "4" */
0x11, 0x95, 0x2f, 0x88, 0x40,
0x1c, 0x79, 0xb6, 0x6f, 0xe1, 0x83, 0x0,
/* U+35 "5" */
0xfc, 0x3c, 0x10, 0xc5, 0xc0,
0xff, 0xf, 0x83, 0xf, 0x37, 0x80,
/* U+36 "6" */
0x3a, 0x21, 0xe8, 0xc5, 0xc0,
0x39, 0x8c, 0x3e, 0xcf, 0x37, 0x80,
/* U+37 "7" */
0xf8, 0x44, 0x44, 0x21, 0x0,
0xfc, 0x30, 0xc6, 0x30, 0xc3, 0x0,
/* U+38 "8" */
0x74, 0x62, 0xe8, 0xc5, 0xc0,
0x7b, 0x3c, 0xde, 0xcf, 0x37, 0x80,
/* U+39 "9" */
0x74, 0x62, 0xf0, 0x8b, 0x80,
0x7b, 0x3c, 0xdf, 0xc, 0x67, 0x0,
/* U+3A ":" */
0x90,
0xf0, 0xf0,
/* U+3B ";" */
0x41, 0x60,
0x6c, 0x6, 0xf0,
/* U+3C "<" */
0x12, 0x48, 0x42, 0x10,
0x19, 0x99, 0x86, 0x18, 0x60,
/* U+3D "=" */
0xf8, 0x3e,
0xfc, 0xf, 0xc0,
/* U+3E ">" */
0x84, 0x21, 0x24, 0x80,
0xc3, 0xc, 0x33, 0x33, 0x0,
/* U+3F "?" */
0x7a, 0x10, 0x84, 0x10, 0x1, 0x0,
0x7b, 0x30, 0xc6, 0x30, 0x3, 0x0,
/* U+40 "@" */
0x7a, 0x19, 0x6b, 0x9a, 0x7, 0x80,
0x7d, 0x8f, 0x7e, 0xfd, 0xf8, 0x1f, 0x0,
/* U+41 "A" */
0x31, 0x28, 0x7f, 0x86, 0x18, 0x40,
0x31, 0xec, 0xf3, 0xff, 0x3c, 0xc0,
/* U+42 "B" */
0xfa, 0x18, 0x7e, 0x86, 0x1f, 0x80,
0xfb, 0x3c, 0xfe, 0xcf, 0x3f, 0x80,
/* U+43 "C" */
0x7a, 0x18, 0x20, 0x82, 0x17, 0x80,
0x7b, 0x3c, 0x30, 0xc3, 0x37, 0x80,
/* U+44 "D" */
0xf2, 0x28, 0x61, 0x86, 0x2f, 0x0,
0xf3, 0x6c, 0xf3, 0xcf, 0x6f, 0x0,
/* U+45 "E" */
0xfe, 0x8, 0x3c, 0x82, 0xf, 0xc0,
0xff, 0xc, 0x3e, 0xc3, 0xf, 0xc0,
/* U+46 "F" */
0xfe, 0x8, 0x3c, 0x82, 0x8, 0x0,
0xff, 0xc, 0x3e, 0xc3, 0xc, 0x0,
/* U+47 "G" */
0x7a, 0x18, 0x27, 0x86, 0x17, 0x80,
0x7b, 0x3c, 0x37, 0xcf, 0x37, 0xc0,
/* U+48 "H" */
0x86, 0x18, 0x7f, 0x86, 0x18, 0x40,
0xcf, 0x3c, 0xff, 0xcf, 0x3c, 0xc0,
/* U+49 "I" */
0xe9, 0x24, 0xb8,
0xfc, 0xc3, 0xc, 0x30, 0xcf, 0xc0,
/* U+4A "J" */
0x8, 0x42, 0x10, 0xc5, 0xc0,
0xc, 0x30, 0xc3, 0xf, 0x37, 0x80,
/* U+4B "K" */
0x86, 0x29, 0x38, 0x92, 0x28, 0x40,
0xc7, 0x9b, 0x67, 0x8d, 0x99, 0xb1, 0x80,
/* U+4C "L" */
0x82, 0x8, 0x20, 0x82, 0xf, 0xc0,
0xc3, 0xc, 0x30, 0xc3, 0xf, 0xc0,
/* U+4D "M" */
0x87, 0x3b, 0x61, 0x86, 0x18, 0x40,
0xc7, 0xdf, 0xfe, 0xbc, 0x78, 0xf1, 0x80,
/* U+4E "N" */
0x87, 0x1a, 0x65, 0x8e, 0x18, 0x40,
0xc7, 0xcf, 0xde, 0xfc, 0xf8, 0xf1, 0x80,
/* U+4F "O" */
0x7a, 0x18, 0x61, 0x86, 0x17, 0x80,
0x7b, 0x3c, 0xf3, 0xcf, 0x37, 0x80,
/* U+50 "P" */
0xfa, 0x18, 0x7e, 0x82, 0x8, 0x0,
0xfb, 0x3c, 0xfe, 0xc3, 0xc, 0x0,
/* U+51 "Q" */
0x7a, 0x18, 0x61, 0x96, 0x27, 0x40,
0x7b, 0x3c, 0xf3, 0xcf, 0x66, 0xc0,
/* U+52 "R" */
0xfa, 0x18, 0x7e, 0x92, 0x28, 0x40,
0xfb, 0x3c, 0xfe, 0xdb, 0x3c, 0xc0,
/* U+53 "S" */
0x7a, 0x18, 0x1e, 0x6, 0x17, 0x80,
0x7b, 0x3c, 0x1e, 0xf, 0x37, 0x80,
/* U+54 "T" */
0xf9, 0x8, 0x42, 0x10, 0x80,
0xfc, 0xc3, 0xc, 0x30, 0xc3, 0x0,
/* U+55 "U" */
0x86, 0x18, 0x61, 0x86, 0x17, 0x80,
0xcf, 0x3c, 0xf3, 0xcf, 0x37, 0x80,
/* U+56 "V" */
0x86, 0x18, 0x61, 0x85, 0x23, 0x0,
0xcf, 0x3c, 0xf3, 0xcd, 0xe3, 0x0,
/* U+57 "W" */
0x86, 0x18, 0x61, 0xb7, 0x38, 0x40,
0xc7, 0x8f, 0x1e, 0xbf, 0xfd, 0xf1, 0x80,
/* U+58 "X" */
0x86, 0x14, 0x8c, 0x4a, 0x18, 0x40,
0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
/* U+59 "Y" */
0x8c, 0x62, 0xe2, 0x10, 0x80,
0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18,
/* U+5A "Z" */
0xf8, 0x44, 0x44, 0x43, 0xe0,
0xfc, 0x31, 0x8c, 0x63, 0xf, 0xc0,
/* U+5B "[" */
0xf2, 0x49, 0x38,
0xfc, 0xcc, 0xcc, 0xf0,
/* U+5C "\\" */
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0xc0, 0x60, 0x30, 0x18, 0xc, 0x6, 0x3,
/* U+5D "]" */
0xe4, 0x92, 0x78,
0xf3, 0x33, 0x33, 0xf0,
/* U+5E "^" */
0x22, 0xa2,
0x10, 0x71, 0xb6, 0x30,
/* U+5F "_" */
0xf8,
/* U+60 "`" */
0x88, 0x80,
/* U+61 "a" */
0x70, 0x5f, 0x17, 0x80,
/* U+62 "b" */
0x84, 0x3d, 0x18, 0xc7, 0xc0,
/* U+63 "c" */
0x74, 0x61, 0x17, 0x0,
/* U+64 "d" */
0x8, 0x5f, 0x18, 0xc5, 0xe0,
/* U+65 "e" */
0x74, 0x7f, 0x7, 0x0,
/* U+66 "f" */
0x18, 0x92, 0x3e, 0x20, 0x82, 0x0,
/* U+67 "g" */
0x7c, 0x62, 0xf0, 0xb8,
/* U+68 "h" */
0x84, 0x3d, 0x18, 0xc6, 0x20,
/* U+69 "i" */
0x43, 0x24, 0xb8,
/* U+6A "j" */
0x10, 0x31, 0x11, 0x96,
/* U+6B "k" */
0x84, 0x23, 0x2e, 0x4a, 0x20,
/* U+6C "l" */
0xc9, 0x24, 0xb8,
/* U+6D "m" */
0xd5, 0x6b, 0x5a, 0x80,
/* U+6E "n" */
0xf4, 0x63, 0x18, 0x80,
/* U+6F "o" */
0x74, 0x63, 0x17, 0x0,
/* U+70 "p" */
0xf4, 0x63, 0xe8, 0x40,
/* U+71 "q" */
0x7c, 0x62, 0xf0, 0x84,
/* U+72 "r" */
0xbe, 0x21, 0x8, 0x0,
/* U+73 "s" */
0x7c, 0x1c, 0x1f, 0x0,
/* U+74 "t" */
0x42, 0x3c, 0x84, 0x24, 0xc0,
/* U+75 "u" */
0x8c, 0x63, 0x17, 0x0,
/* U+76 "v" */
0x8c, 0x62, 0xa2, 0x0,
/* U+77 "w" */
0x8d, 0x6b, 0x55, 0x0,
/* U+78 "x" */
0x8a, 0x88, 0xa8, 0x80,
/* U+79 "y" */
0x8c, 0x62, 0xf0, 0xb8,
/* U+7A "z" */
0xf8, 0x88, 0x8f, 0x80,
/* U+7B "{" */
0x34, 0x48, 0x44, 0x30,
/* U+7C "|" */
0xff,
/* U+60 "`" */
0xc6, 0x30,
/* U+61 "a" */
0x78, 0x37, 0xf3, 0x7c,
/* U+62 "b" */
0xc3, 0xf, 0xb3, 0xcf, 0x3f, 0x80,
/* U+63 "c" */
0x7e, 0x31, 0x87, 0x80,
/* U+64 "d" */
0xc, 0x37, 0xf3, 0xcf, 0x37, 0xc0,
/* U+65 "e" */
0x7b, 0x3f, 0xf0, 0x78,
/* U+66 "f" */
0x3b, 0x3e, 0xc6, 0x31, 0x80,
/* U+67 "g" */
0x7f, 0x3c, 0xdf, 0xf, 0xe0,
/* U+68 "h" */
0xc3, 0xf, 0xb3, 0xcf, 0x3c, 0xc0,
/* U+69 "i" */
0x60, 0x38, 0xc6, 0x31, 0xe0,
/* U+6A "j" */
0x18, 0x6, 0x31, 0x8c, 0x7e,
/* U+6B "k" */
0xc3, 0xc, 0xf6, 0xf3, 0x6c, 0xc0,
/* U+6C "l" */
0xe3, 0x18, 0xc6, 0x31, 0xe0,
/* U+6D "m" */
0xcd, 0xff, 0x5e, 0xbc, 0x60,
/* U+6E "n" */
0xfb, 0x3c, 0xf3, 0xcc,
/* U+6F "o" */
0x7b, 0x3c, 0xf3, 0x78,
/* U+70 "p" */
0xfb, 0x3c, 0xfe, 0xc3, 0x0,
/* U+71 "q" */
0x7f, 0x3c, 0xdf, 0xc, 0x30,
/* U+72 "r" */
0xfb, 0x3c, 0x30, 0xc0,
/* U+73 "s" */
0x7f, 0x7, 0x83, 0xf8,
/* U+74 "t" */
0x61, 0x8f, 0xd8, 0x61, 0x83, 0xc0,
/* U+75 "u" */
0xcf, 0x3c, 0xf3, 0x7c,
/* U+76 "v" */
0xcf, 0x3c, 0xde, 0x30,
/* U+77 "w" */
0xc7, 0x8f, 0x5b, 0xe6, 0xc0,
/* U+78 "x" */
0xc6, 0xd8, 0xe3, 0x6c, 0x60,
/* U+79 "y" */
0xcf, 0x3c, 0xdf, 0xd, 0xe0,
/* U+7A "z" */
0xfc, 0x63, 0x18, 0xfc,
/* U+7B "{" */
0x1c, 0xc3, 0x38, 0x30, 0xc1, 0xc0,
/* U+7C "|" */
0xff, 0xfc,
/* U+7D "}" */
0xc2, 0x21, 0x22, 0xc0,
0xe0, 0xc3, 0x7, 0x30, 0xce, 0x0,
/* U+7E "~" */
0x45, 0x44,
0x77, 0xb8,
/* U+7F "" */
0xc1, 0x42, 0xbd, 0x2c, 0x40, 0x81, 0x0
@@ -312,103 +313,103 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 128, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 0, .adv_w = 128, .box_h = 7, .box_w = 1, .ofs_x = 3, .ofs_y = -1},
{.bitmap_index = 1, .adv_w = 128, .box_h = 3, .box_w = 4, .ofs_x = 2, .ofs_y = 3},
{.bitmap_index = 3, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 9, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 14, .adv_w = 128, .box_h = 6, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 19, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 25, .adv_w = 128, .box_h = 3, .box_w = 3, .ofs_x = 2, .ofs_y = 3},
{.bitmap_index = 27, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 30, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 33, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 38, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 42, .adv_w = 128, .box_h = 3, .box_w = 2, .ofs_x = 3, .ofs_y = -2},
{.bitmap_index = 43, .adv_w = 128, .box_h = 1, .box_w = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 44, .adv_w = 128, .box_h = 1, .box_w = 1, .ofs_x = 3, .ofs_y = -1},
{.bitmap_index = 45, .adv_w = 128, .box_h = 7, .box_w = 7, .ofs_x = 0, .ofs_y = -1},
{.bitmap_index = 52, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 57, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 62, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 67, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 72, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 77, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 82, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 87, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 92, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 97, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 102, .adv_w = 128, .box_h = 4, .box_w = 1, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 103, .adv_w = 128, .box_h = 6, .box_w = 2, .ofs_x = 2, .ofs_y = -2},
{.bitmap_index = 105, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 109, .adv_w = 128, .box_h = 3, .box_w = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 111, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 115, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 121, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 127, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 133, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 139, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 145, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 151, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 157, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 163, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 169, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 175, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 178, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 183, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 189, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 195, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 201, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 207, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 213, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 219, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 225, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 231, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 237, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 242, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 248, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 254, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 260, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 266, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 271, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 276, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 279, .adv_w = 128, .box_h = 7, .box_w = 7, .ofs_x = 0, .ofs_y = -1},
{.bitmap_index = 286, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 289, .adv_w = 128, .box_h = 3, .box_w = 5, .ofs_x = 1, .ofs_y = 3},
{.bitmap_index = 291, .adv_w = 128, .box_h = 1, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
{.bitmap_index = 292, .adv_w = 128, .box_h = 3, .box_w = 3, .ofs_x = 2, .ofs_y = 3},
{.bitmap_index = 294, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 298, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 303, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 307, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 312, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 316, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 322, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
{.bitmap_index = 326, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 331, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 334, .adv_w = 128, .box_h = 8, .box_w = 4, .ofs_x = 2, .ofs_y = -2},
{.bitmap_index = 338, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 343, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 346, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 350, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 354, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 358, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
{.bitmap_index = 362, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
{.bitmap_index = 366, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 370, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 374, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 379, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 383, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 387, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 391, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 395, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
{.bitmap_index = 399, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 403, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 407, .adv_w = 128, .box_h = 8, .box_w = 1, .ofs_x = 3, .ofs_y = -2},
{.bitmap_index = 408, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 2, .ofs_y = -1},
{.bitmap_index = 412, .adv_w = 128, .box_h = 3, .box_w = 5, .ofs_x = 1, .ofs_y = 3},
{.bitmap_index = 414, .adv_w = 128, .box_h = 7, .box_w = 7, .ofs_x = 0, .ofs_y = -1}
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 128, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 8},
{.bitmap_index = 1, .adv_w = 128, .box_w = 2, .box_h = 7, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 3, .adv_w = 128, .box_w = 6, .box_h = 3, .ofs_x = 1, .ofs_y = 5},
{.bitmap_index = 6, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 13, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 19, .adv_w = 128, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 25, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 32, .adv_w = 128, .box_w = 3, .box_h = 3, .ofs_x = 2, .ofs_y = 5},
{.bitmap_index = 34, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 38, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 42, .adv_w = 128, .box_w = 8, .box_h = 5, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 47, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 2},
{.bitmap_index = 51, .adv_w = 128, .box_w = 3, .box_h = 3, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 53, .adv_w = 128, .box_w = 6, .box_h = 1, .ofs_x = 1, .ofs_y = 4},
{.bitmap_index = 54, .adv_w = 128, .box_w = 2, .box_h = 2, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 55, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 62, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 68, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 74, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 80, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 86, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 93, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 99, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 105, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 111, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 117, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 123, .adv_w = 128, .box_w = 2, .box_h = 6, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 125, .adv_w = 128, .box_w = 3, .box_h = 7, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 128, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 133, .adv_w = 128, .box_w = 6, .box_h = 3, .ofs_x = 1, .ofs_y = 3},
{.bitmap_index = 136, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 141, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 147, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 154, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 160, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 166, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 172, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 178, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 184, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 190, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 196, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 202, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 208, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 214, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 221, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 227, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 234, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 241, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 247, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 253, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 259, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 265, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 271, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 277, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 283, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 289, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 296, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 303, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 310, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 316, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 320, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 327, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 331, .adv_w = 128, .box_w = 7, .box_h = 4, .ofs_x = 0, .ofs_y = 4},
{.bitmap_index = 335, .adv_w = 128, .box_w = 8, .box_h = 1, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 336, .adv_w = 128, .box_w = 4, .box_h = 3, .ofs_x = 3, .ofs_y = 5},
{.bitmap_index = 338, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 342, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 348, .adv_w = 128, .box_w = 5, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 352, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 358, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 362, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 367, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 372, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 378, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 383, .adv_w = 128, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 388, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 394, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 399, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 404, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 408, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 412, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 417, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 422, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 426, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 430, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 436, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 440, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 444, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 449, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 454, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 459, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 463, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 469, .adv_w = 128, .box_w = 2, .box_h = 7, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 471, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 477, .adv_w = 128, .box_w = 7, .box_h = 2, .ofs_x = 0, .ofs_y = 6},
{.bitmap_index = 479, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1}
};
/*---------------------
@@ -420,8 +421,8 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] = {
{
.range_start = 32, .range_length = 96, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
.glyph_id_start = 1, .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0
.range_start = 32, .range_length = 96, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
@@ -436,12 +437,12 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.glyph_bitmap = gylph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = NULL,
.kern_scale = 0,
.cmap_num = 1,
.bpp = 1,
.kern_scale = 0,
.kern_dsc = NULL,
.kern_classes = 0,
.bitmap_format = 0
};
@@ -451,11 +452,20 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
/*Initialize a public general font descriptor*/
lv_font_t lv_font_unscii_8 = {
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.line_height = 8, /*The maximum line height required by the font*/
.base_line = 2, /*Baseline measured from the bottom of the line*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 9, /*The maximum line height required by the font*/
.base_line = 0, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = 0,
.underline_thickness = 0,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_UNSCII_8*/

480
src/lv_gpu/lv_gpu_nxp_pxp.c Normal file
View File

@@ -0,0 +1,480 @@
/**
* @file lv_gpu_nxp_pxp.c
*
*/
/**
* MIT License
*
* Copyright (c) 2020 NXP
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next paragraph)
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
/*********************
* INCLUDES
*********************/
#include "../lv_conf_internal.h"
#if LV_USE_GPU_NXP_PXP
#include "lvgl.h"
#include "lv_gpu_nxp_pxp.h"
#include "../lv_misc/lv_mem.h"
#include "../lv_misc/lv_log.h"
#include "fsl_pxp.h"
#include "fsl_cache.h"
/*********************
* DEFINES
*********************/
#if LV_COLOR_16_SWAP
#error Color swap not implemented. Disable LV_COLOR_16_SWAP feature.
#endif
#if LV_COLOR_DEPTH==16
#define PXP_OUT_PIXEL_FORMAT kPXP_OutputPixelFormatRGB565
#define PXP_AS_PIXEL_FORMAT kPXP_AsPixelFormatRGB565
#define PXP_PS_PIXEL_FORMAT kPXP_PsPixelFormatRGB565
#elif
#error Only 16bit color depth is supported. Set LV_COLOR_DEPTH to 16.
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void lv_gpu_nxp_pxp_run(void);
static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width, const lv_color_t * src,
lv_coord_t src_width,
lv_coord_t copy_width, lv_coord_t copy_height, lv_opa_t opa, lv_color_t recolor, lv_opa_t recolorOpa);
static void lv_gpu_nxp_invalidate_cache(uint32_t address, uint32_t width, uint32_t height, uint32_t stride,
uint32_t pxSize);
/**********************
* STATIC VARIABLES
**********************/
static bool colorKeyEnabled = false;
static uint32_t colorKey = 0x0;
static bool recolorEnabled = false;
static lv_color_t recolor = {.full = 0x0};
static lv_opa_t recolorOpa = 0x0;
static lv_nxp_pxp_cfg_t pxp_cfg;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Reset and initialize PXP device. This function should be called as a part
* of display init sequence.
*
* @return LV_RES_OK: PXP init ok; LV_RES_INV: init error. See error log for more information.
*/
lv_res_t lv_gpu_nxp_pxp_init(lv_nxp_pxp_cfg_t * cfg)
{
if(!cfg || !cfg->pxp_interrupt_deinit || !cfg->pxp_interrupt_init || !cfg->pxp_run) {
LV_LOG_ERROR("PXP configuration error. Check callback pointers.");
return LV_RES_INV;
}
PXP_Init(PXP);
PXP_EnableCsc1(PXP, false); /* Disable CSC1, it is enabled by default. */
PXP_EnableInterrupts(PXP, kPXP_CompleteInterruptEnable);
pxp_cfg = *cfg;
if(pxp_cfg.pxp_interrupt_init() != LV_RES_OK) {
PXP_Deinit(PXP);
LV_LOG_ERROR("PXP interrupt init error. Check pxp_interrupt_init callback.");
return LV_RES_INV;
}
colorKey = lv_color_to32(LV_COLOR_TRANSP);
return LV_RES_OK;
}
/**
* Disable PXP device. Should be called during display deinit sequence.
*/
void lv_gpu_nxp_pxp_deinit(void)
{
pxp_cfg.pxp_interrupt_deinit();
PXP_DisableInterrupts(PXP, kPXP_CompleteInterruptEnable);
PXP_Deinit(LV_GPU_NXP_PXP_ID);
}
/**
* Fill area, with optional opacity.
*
* @param[in/out] dest_buf destination buffer
* @param[in] dest_width width (stride) of destination buffer in pixels
* @param[in] fill_area area to fill
* @param[in] color color
* @param[in] opa transparency of the color
*/
void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_area_t * fill_area, lv_color_t color,
lv_opa_t opa)
{
PXP_Init(LV_GPU_NXP_PXP_ID);
PXP_EnableCsc1(LV_GPU_NXP_PXP_ID, false); /* Disable CSC1, it is enabled by default. */
PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /* Block size 16x16 for higher performance */
/* OUT buffer configure */
pxp_output_buffer_config_t outputConfig = {
.pixelFormat = PXP_OUT_PIXEL_FORMAT,
.interlacedMode = kPXP_OutputProgressive,
.buffer0Addr = (uint32_t)(dest_buf + dest_width * fill_area->y1 + fill_area->x1),
.buffer1Addr = (uint32_t)NULL,
.pitchBytes = dest_width * sizeof(lv_color_t),
.width = fill_area->x2 - fill_area->x1 + 1,
.height = fill_area->y2 - fill_area->y1 + 1,
};
lv_gpu_nxp_invalidate_cache(outputConfig.buffer0Addr, outputConfig.width, outputConfig.height, outputConfig.pitchBytes,
sizeof(lv_color_t));
PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputConfig);
if(opa > LV_OPA_MAX) {
/* Simple color fill without opacity - AS disabled, PS as color generator */
PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); /* Disable AS. */
PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); /* Disable PS. */
PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(color));
}
else {
/* Fill with opacity - AS used as source (same as OUT), PS used as color generator, blended together */
pxp_as_buffer_config_t asBufferConfig;
pxp_porter_duff_config_t pdConfig;
/* Set AS to OUT */
asBufferConfig.pixelFormat = PXP_AS_PIXEL_FORMAT;
asBufferConfig.bufferAddr = (uint32_t)outputConfig.buffer0Addr;
asBufferConfig.pitchBytes = outputConfig.pitchBytes;
PXP_SetAlphaSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &asBufferConfig);
PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, fill_area->x2 - fill_area->x1 + 1,
fill_area->y2 - fill_area->y1 + 1);
/* Disable PS, use as color generator */
PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U);
PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(color));
/* Configure Porter-Duff blending - For RGB 565 only! */
pdConfig.enable = 1;
pdConfig.dstColorMode = kPXP_PorterDuffColorStraight;
pdConfig.srcColorMode = kPXP_PorterDuffColorStraight;
pdConfig.dstGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha;
pdConfig.srcGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha;
pdConfig.srcFactorMode = kPXP_PorterDuffFactorStraight;
pdConfig.dstFactorMode = kPXP_PorterDuffFactorStraight;
pdConfig.srcGlobalAlpha = opa;
pdConfig.dstGlobalAlpha = 255 - opa;
pdConfig.srcAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */
pdConfig.dstAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */
PXP_SetPorterDuffConfig(LV_GPU_NXP_PXP_ID, &pdConfig);
}
lv_gpu_nxp_pxp_run(); /* Start PXP task */
}
/**
* @brief BLock Image Transfer - copy rectangular image from src buffer to dst buffer with effects.
*
* By default, image is copied directly, with optional opacity configured by \p opa.
* Color keying can be enabled by calling lv_gpu_nxp_pxp_enable_color_key() before calling this function.
* Recoloring can be enabled by calling lv_gpu_nxp_pxp_enable_recolor() before calling this function.
* Note that color keying and recoloring at the same time is not supported and black rectangle is rendered.
*
* @param[in/out] dest destination buffer
* @param[in] dest_width width (stride) of destination buffer in pixels
* @param[in] src source buffer
* @param[in] src_with width (stride) of source buffer in pixels
* @param[in] copy_w width of area to be copied from src to dest
* @param[in] copy_h height of area to be copied from src to dest
* @param[in] opa opacity of the result
*/
void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_color_t * src, lv_coord_t src_width,
lv_coord_t copy_width, lv_coord_t copy_height, lv_opa_t opa)
{
if(recolorEnabled) { /* switch to recolor version of blit */
lv_gpu_nxp_pxp_blit_recolor(dest, dest_width, src, src_width, copy_width, copy_height, opa, recolor, recolorOpa);
return;
};
PXP_Init(PXP);
PXP_EnableCsc1(PXP, false); /* Disable CSC1, it is enabled by default. */
PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /* block size 16x16 for higher performance */
pxp_output_buffer_config_t outputBufferConfig;
pxp_as_buffer_config_t asBufferConfig;
pxp_as_blend_config_t asBlendConfig;
asBlendConfig.alpha = opa;
asBlendConfig.invertAlpha = false;
asBlendConfig.alphaMode = kPXP_AlphaRop;
asBlendConfig.ropMode = kPXP_RopMergeAs;
if(opa >= LV_OPA_MAX && !colorKeyEnabled) {
/* Simple blit, no effect - Disable PS buffer */
PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U);
}
else {
/* Alpha blending or color keying enabled - PS must be enabled to fetch background pixels
PS and OUT buffers are the same, blend will be done in-place */
pxp_ps_buffer_config_t psBufferConfig = {
.pixelFormat = PXP_PS_PIXEL_FORMAT,
.swapByte = false,
.bufferAddr = (uint32_t)dest,
.bufferAddrU = 0U,
.bufferAddrV = 0U,
.pitchBytes = dest_width * sizeof(lv_color_t)
};
asBlendConfig.alphaMode = kPXP_AlphaOverride;
PXP_SetProcessSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &psBufferConfig);
PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, copy_width - 1, copy_height - 1);
}
/* AS buffer - source image */
asBufferConfig.pixelFormat = PXP_AS_PIXEL_FORMAT;
asBufferConfig.bufferAddr = (uint32_t)src;
asBufferConfig.pitchBytes = src_width * sizeof(lv_color_t);
PXP_SetAlphaSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &asBufferConfig);
PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, copy_width - 1U, copy_height - 1U);
PXP_SetAlphaSurfaceBlendConfig(LV_GPU_NXP_PXP_ID, &asBlendConfig);
lv_gpu_nxp_invalidate_cache(asBufferConfig.bufferAddr, copy_width, copy_height, asBufferConfig.pitchBytes,
sizeof(lv_color_t));
if(colorKeyEnabled) {
PXP_SetAlphaSurfaceOverlayColorKey(LV_GPU_NXP_PXP_ID, colorKey, colorKey);
}
PXP_EnableAlphaSurfaceOverlayColorKey(LV_GPU_NXP_PXP_ID, colorKeyEnabled);
/* Output buffer. */
outputBufferConfig.pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT;
outputBufferConfig.interlacedMode = kPXP_OutputProgressive;
outputBufferConfig.buffer0Addr = (uint32_t)dest;
outputBufferConfig.buffer1Addr = (uint32_t)0U;
outputBufferConfig.pitchBytes = dest_width * sizeof(lv_color_t);
outputBufferConfig.width = copy_width;
outputBufferConfig.height = copy_height;
PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputBufferConfig);
lv_gpu_nxp_invalidate_cache(outputBufferConfig.buffer0Addr, outputBufferConfig.width, outputBufferConfig.height,
outputBufferConfig.pitchBytes, sizeof(lv_color_t));
lv_gpu_nxp_pxp_run(); /* Start PXP task */
}
/**
* @brief Enable color keying for subsequent calls to lv_gpu_nxp_pxp_blit()
*
* Color key is defined by LV_COLOR_TRANSP symbol in lv_conf.h
*/
void lv_gpu_nxp_pxp_enable_color_key(void)
{
colorKeyEnabled = true;
}
/**
* @brief Disable color keying for subsequent calls to lv_gpu_nxp_pxp_blit()
*
*/
void lv_gpu_nxp_pxp_disable_color_key(void)
{
colorKeyEnabled = false;
}
/**
* @brief Enable recolor feature for subsequent calls to lv_gpu_nxp_pxp_blit()
*
* @param[in] color recolor value
* @param[in] opa effect opacity
*/
void lv_gpu_nxp_pxp_enable_recolor(lv_color_t color, lv_opa_t opa)
{
recolorEnabled = true;
recolor = color;
recolorOpa = opa;
}
/**
* @brief Disable recolor feature for subsequent calls to lv_gpu_nxp_pxp_blit()
*/
void lv_gpu_nxp_pxp_disable_recolor(void)
{
recolorEnabled = false;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* @brief Start PXP job and wait for results
*
* Function used internally to start PXP task according current device
* configuration.
*/
static void lv_gpu_nxp_pxp_run(void)
{
pxp_cfg.pxp_run();
}
/**
* @brief BLock Image Transfer - copy rectangular image from src buffer to dst buffer with recoloring.
*
* Note that color keying and recoloring at the same time is not supported and black rectangle is rendered.
*
* @param[in/out] dest destination buffer
* @param[in] dest_width width (stride) of destination buffer in pixels
* @param[in] src source buffer
* @param[in] src_with width (stride) of source buffer in pixels
* @param[in] copy_w width of area to be copied from src to dest
* @param[in] copy_h height of area to be copied from src to dest
* @param[in] opa opacity of the result
* @param[in] recolor recolor value
* @param[in] recolorOpa effect opacity
*/
static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width, const lv_color_t * src,
lv_coord_t src_width,
lv_coord_t copy_width, lv_coord_t copy_height, lv_opa_t opa, lv_color_t recolor, lv_opa_t recolorOpa)
{
pxp_output_buffer_config_t outputBufferConfig;
pxp_as_buffer_config_t asBufferConfig;
if(colorKeyEnabled) {
/* should never get here, recolor & color keying not supported. Draw black box instead. */
const lv_area_t fill_area = {.x1 = 0, .y1 = 0, .x2 = copy_width - 1, .y2 = copy_height - 1};
lv_gpu_nxp_pxp_fill(dest, dest_width, &fill_area, LV_COLOR_BLACK, LV_OPA_MAX);
LV_LOG_WARN("Recoloring and color keying is not supported. Black rectangle rendered.");
return ;
}
else {
/* Recoloring without color keying */
if(opa > LV_OPA_MAX) {
/* Recolor with full opacity - AS source image, PS color generator, OUT destination */
PXP_Init(PXP);
PXP_EnableCsc1(PXP, false); /* Disable CSC1, it is enabled by default. */
PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /* block size 16x16 for higher performance */
/* AS buffer - source image */
asBufferConfig.pixelFormat = PXP_AS_PIXEL_FORMAT;
asBufferConfig.bufferAddr = (uint32_t)src;
asBufferConfig.pitchBytes = src_width * sizeof(lv_color_t);
PXP_SetAlphaSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &asBufferConfig);
PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, copy_width - 1U, copy_height - 1U);
lv_gpu_nxp_invalidate_cache(asBufferConfig.bufferAddr, copy_width, copy_height, asBufferConfig.pitchBytes,
sizeof(lv_color_t));
/* Disable PS buffer, use as color generator */
PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U);
PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(recolor));
/* Output buffer */
outputBufferConfig.pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT;
outputBufferConfig.interlacedMode = kPXP_OutputProgressive;
outputBufferConfig.buffer0Addr = (uint32_t)dest;
outputBufferConfig.buffer1Addr = (uint32_t)0U;
outputBufferConfig.pitchBytes = dest_width * sizeof(lv_color_t);
outputBufferConfig.width = copy_width;
outputBufferConfig.height = copy_height;
PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputBufferConfig);
lv_gpu_nxp_invalidate_cache(outputBufferConfig.buffer0Addr, outputBufferConfig.width, outputBufferConfig.height,
outputBufferConfig.pitchBytes, sizeof(lv_color_t));
pxp_porter_duff_config_t pdConfig;
/* Configure Porter-Duff blending - For RGB 565 only! */
pdConfig.enable = 1;
pdConfig.dstColorMode = kPXP_PorterDuffColorStraight;
pdConfig.srcColorMode = kPXP_PorterDuffColorStraight;
pdConfig.dstGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha;
pdConfig.srcGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha;
pdConfig.srcFactorMode = kPXP_PorterDuffFactorStraight;
pdConfig.dstFactorMode = kPXP_PorterDuffFactorStraight;
pdConfig.srcGlobalAlpha = recolorOpa;
pdConfig.dstGlobalAlpha = 255 - recolorOpa;
pdConfig.srcAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */
pdConfig.dstAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */
PXP_SetPorterDuffConfig(LV_GPU_NXP_PXP_ID, &pdConfig);
lv_gpu_nxp_pxp_run(); /* Start PXP task */
}
else {
/* Recolor with transparency */
/* Step 1: Recolor with full opacity to temporary buffer */
lv_color_t * tmpBuf = (lv_color_t *) _lv_mem_buf_get(copy_width * copy_height * sizeof(lv_color_t));
lv_gpu_nxp_pxp_blit_recolor(tmpBuf, copy_width, src, src_width, copy_width, copy_height, LV_OPA_COVER, recolor,
recolorOpa);
/* Step 2: BLIT temporary results with required opacity to output */
lv_gpu_nxp_pxp_disable_recolor(); /* make sure to take BLIT path, not the recolor */
lv_gpu_nxp_pxp_blit(dest, dest_width, tmpBuf, copy_width, copy_width, copy_height, opa);
lv_gpu_nxp_pxp_enable_recolor(recolor, recolorOpa); /* restore state */
/* Step 3: Clean-up memory */
_lv_mem_buf_release(tmpBuf);
}
}
}
/**
* @brief Invalidate cache for rectangular area of memory
*
* @param[in] address starting address of area
* @param[in] width width of area in pixels
* @param[in] height height of area in pixels
* @param[in] stride stride in bytes
* @param[in] pxSize pixel size in bytes
*/
static void lv_gpu_nxp_invalidate_cache(uint32_t address, uint32_t width, uint32_t height, uint32_t stride,
uint32_t pxSize)
{
int y;
for(y = 0; y < height; y++) {
DCACHE_CleanInvalidateByRange(address, width * pxSize);
address += stride;
}
}
#endif /* LV_USE_GPU && LV_USE_GPU_NXP_PXP */

186
src/lv_gpu/lv_gpu_nxp_pxp.h Normal file
View File

@@ -0,0 +1,186 @@
/**
* @file lv_gpu_nxp_pxp.h
*
*/
/**
* MIT License
*
* Copyright (c) 2020 NXP
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next paragraph)
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LV_SRC_LV_GPU_LV_GPU_NXP_PXP_H_
#define LV_SRC_LV_GPU_LV_GPU_NXP_PXP_H_
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_misc/lv_area.h"
#include "../lv_misc/lv_color.h"
/*********************
* DEFINES
*********************/
/** PXP module instance to use */
#define LV_GPU_NXP_PXP_ID PXP
/** PXP interrupt line ID */
#define LV_GPU_NXP_PXP_IRQ_ID PXP_IRQn
#ifndef LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT
/** Minimum area (in pixels) for image copy with 100% opacity to be handled by PXP */
#define LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT 32
#endif
#ifndef LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT
/** Minimum area (in pixels) for image copy with transparency to be handled by PXP */
#define LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT 16
#endif
#ifndef LV_GPU_NXP_PXP_FILL_SIZE_LIMIT
/** Minimum area (in pixels) to be filled by PXP with 100% opacity */
#define LV_GPU_NXP_PXP_FILL_SIZE_LIMIT 64
#endif
#ifndef LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT
/** Minimum area (in pixels) to be filled by PXP with transparency */
#define LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT 32
#endif
/**********************
* TYPEDEFS
**********************/
/**
* NXP PXP device configuration - call-backs used for
* interrupt init/wait/deinit.
*/
typedef struct {
/** Callback for PXP interrupt initialization */
lv_res_t (*pxp_interrupt_init)(void);
/** Callback for PXP interrupt de-initialization */
void (*pxp_interrupt_deinit)(void);
/** Callback that should start PXP and wait for operation complete */
void (*pxp_run)(void);
} lv_nxp_pxp_cfg_t;
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Reset and initialize PXP device. This function should be called as a part
* of display init sequence.
*
* @return LV_RES_OK: PXP init ok; LV_RES_INV: init error. See error log for more information.
*/
lv_res_t lv_gpu_nxp_pxp_init(lv_nxp_pxp_cfg_t * cfg);
/**
* Disable PXP device. Should be called during display deinit sequence.
*/
void lv_gpu_nxp_pxp_deinit(void);
/**
* Fill area, with optional opacity.
*
* @param[in/out] dest_buf destination buffer
* @param[in] dest_width width (stride) of destination buffer in pixels
* @param[in] fill_area area to fill
* @param[in] color color
* @param[in] opa transparency of the color
*/
void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_area_t * fill_area, lv_color_t color,
lv_opa_t opa);
/**
* @brief BLock Image Transfer - copy rectangular image from src buffer to dst buffer with effects.
*
* By default, image is copied directly, with optional opacity configured by \p opa.
* Color keying can be enabled by calling lv_gpu_nxp_pxp_enable_color_key() before calling this function.
* Recoloring can be enabled by calling lv_gpu_nxp_pxp_enable_recolor() before calling this function.
* Note that color keying and recoloring at the same time is not supported and black rectangle is rendered.
*
* @param[in/out] dest destination buffer
* @param[in] dest_width width (stride) of destination buffer in pixels
* @param[in] src source buffer
* @param[in] src_with width (stride) of source buffer in pixels
* @param[in] copy_w width of area to be copied from src to dest
* @param[in] copy_h height of area to be copied from src to dest
* @param[in] opa opacity of the result
*/
void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_color_t * src, lv_coord_t src_width,
lv_coord_t copy_width, lv_coord_t copy_height, lv_opa_t opa);
/**
* @brief Enable color keying for subsequent calls to lv_gpu_nxp_pxp_blit()
*
* Color key is defined by LV_COLOR_TRANSP symbol in lv_conf.h
*/
void lv_gpu_nxp_pxp_enable_color_key(void);
/**
* @brief Disable color keying for subsequent calls to lv_gpu_nxp_pxp_blit()
*
*/
void lv_gpu_nxp_pxp_disable_color_key(void);
/**
* @brief Enable recolor feature for subsequent calls to lv_gpu_nxp_pxp_blit()
*
* @param[in] color recolor value
* @param[in] opa effect opacity
*/
void lv_gpu_nxp_pxp_enable_recolor(lv_color_t color, lv_opa_t opa);
/**
* @brief Disable recolor feature for subsequent calls to lv_gpu_nxp_pxp_blit()
*/
void lv_gpu_nxp_pxp_disable_recolor(void);
/**********************
* STATIC FUNCTIONS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_SRC_LV_GPU_LV_GPU_NXP_PXP_H_ */

View File

@@ -0,0 +1,166 @@
/**
* @file lv_gpu_nxp_pxp_osa.c
*
*/
/**
* MIT License
*
* Copyright (c) 2020 NXP
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next paragraph)
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
/*********************
* INCLUDES
*********************/
#include "../lv_conf_internal.h"
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
#include "lv_gpu_nxp_pxp.h"
#include "fsl_pxp.h"
#if defined(FSL_RTOS_FREE_RTOS)
#include "FreeRTOS.h"
#include "semphr.h"
#endif
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static lv_res_t _lv_gpu_nxp_pxp_interrupt_init(void);
static void _lv_gpu_nxp_pxp_interrupt_deinit(void);
static void _lv_gpu_nxp_pxp_run(void);
/**********************
* STATIC VARIABLES
**********************/
#if defined(FSL_RTOS_FREE_RTOS)
static SemaphoreHandle_t s_pxpIdle;
#else
static volatile bool s_pxpIdle;
#endif
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* PXP device interrupt handler. Used to check PXP task completion status.
*/
void PXP_IRQHandler(void)
{
#if defined(FSL_RTOS_FREE_RTOS)
BaseType_t taskAwake = pdFALSE;
#endif
if(kPXP_CompleteFlag & PXP_GetStatusFlags(LV_GPU_NXP_PXP_ID)) {
PXP_ClearStatusFlags(LV_GPU_NXP_PXP_ID, kPXP_CompleteFlag);
#if defined(FSL_RTOS_FREE_RTOS)
xSemaphoreGiveFromISR(s_pxpIdle, &taskAwake);
portYIELD_FROM_ISR(taskAwake);
#else
s_pxpIdle = true;
#endif
}
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* PXP interrupt initialization.
*/
static lv_res_t _lv_gpu_nxp_pxp_interrupt_init(void)
{
#if defined(FSL_RTOS_FREE_RTOS)
s_pxpIdle = xSemaphoreCreateBinary();
if(s_pxpIdle == NULL) {
return LV_RES_INV;
}
NVIC_SetPriority(LV_GPU_NXP_PXP_IRQ_ID, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 1);
#else
s_pxpIdle = true;
#endif
NVIC_EnableIRQ(LV_GPU_NXP_PXP_IRQ_ID);
return LV_RES_OK;
}
/**
* PXP interrupt de-initialization.
*/
static void _lv_gpu_nxp_pxp_interrupt_deinit(void)
{
NVIC_DisableIRQ(LV_GPU_NXP_PXP_IRQ_ID);
#if defined(FSL_RTOS_FREE_RTOS)
vSemaphoreDelete(s_pxpIdle);
#endif
}
/**
* Function to start PXP job. This function must wait for task complete.
*/
static void _lv_gpu_nxp_pxp_run(void)
{
#if !defined(FSL_RTOS_FREE_RTOS)
s_pxpIdle = false;
#endif
PXP_EnableInterrupts(LV_GPU_NXP_PXP_ID, kPXP_CompleteInterruptEnable);
PXP_Start(LV_GPU_NXP_PXP_ID);
#if defined(FSL_RTOS_FREE_RTOS)
if(xSemaphoreTake(s_pxpIdle, portMAX_DELAY) != pdTRUE) {
LV_LOG_ERROR("xSemaphoreTake error. Task halted.");
for(; ;) ;
}
#else
while(s_pxpIdle == false) {
}
#endif
}
lv_nxp_pxp_cfg_t pxp_default_cfg = {
.pxp_interrupt_init = _lv_gpu_nxp_pxp_interrupt_init,
.pxp_interrupt_deinit = _lv_gpu_nxp_pxp_interrupt_deinit,
.pxp_run = _lv_gpu_nxp_pxp_run
};
#endif /* LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT */

View File

@@ -0,0 +1,47 @@
/**
* @file lv_gpu_nxp_pxp_osa.h
*
*/
/**
* MIT License
*
* Copyright (c) 2020 NXP
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next paragraph)
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_
#define LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "../lv_conf_internal.h"
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
extern lv_nxp_pxp_cfg_t pxp_default_cfg;
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_ */

View File

@@ -0,0 +1,303 @@
/**
* @file lv_gpu_nxp_vglite.c
*
*/
/**
* MIT License
*
* Copyright (c) 2020 NXP
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next paragraph)
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
/*********************
* INCLUDES
*********************/
#include "../lv_conf_internal.h"
#if LV_USE_GPU_NXP_VG_LITE
#include "lvgl.h"
#include "lv_gpu_nxp_vglite.h"
#include "../lv_misc/lv_log.h"
#include "fsl_cache.h"
#include "vg_lite.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
#if LV_COLOR_DEPTH==16
#define VGLITE_PX_FMT VG_LITE_RGB565
#else
#error Only 16bit color depth is supported. Set LV_COLOR_DEPTH to 16.
#endif
/**********************
* STATIC PROTOTYPES
**********************/
static lv_res_t init_vg_buf(vg_lite_buffer_t * dst, uint32_t width, uint32_t height, uint32_t stride,
const lv_color_t * ptr);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/***
* Fills rectangular area in buffer.
* @param[in] dest_buf Destination buffer pointer (must be aligned on 32 bytes)
* @param[in] dest_width Destination buffer width in pixels (must be aligned on 16 px)
* @param[in] dest_height Destination buffer height in pixels
* @param[in] fill_area Area to be filled
* @param[in] color Fill color
* @param[in] opa Opacity (255 = full, 128 = 50% background/50% color, 0 = no fill)
* @retval LV_RES_OK Fill completed
* @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS)
*/
lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv_coord_t dest_height,
const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa)
{
vg_lite_buffer_t rt;
vg_lite_rectangle_t rect;
vg_lite_error_t err = VG_LITE_SUCCESS;
lv_color32_t col32 = {.full = lv_color_to32(color)}; /* Convert color to RGBA8888 */
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
if(init_vg_buf(&rt, dest_width, dest_height, dest_width * sizeof(lv_color_t), dest_buf) != LV_RES_OK) {
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("init_vg_buf reported error. Fill failed.");
#endif
return LV_RES_INV;
}
if(opa >= LV_OPA_MAX) { /* Opaque fill */
rect.x = fill_area->x1;
rect.y = fill_area->y1;
rect.width = (fill_area->x2 - fill_area->x1) + 1;
rect.height = (fill_area->y2 - fill_area->y1) + 1;
if(disp && disp->driver.clean_dcache_cb) { /* Clean & invalidate cache */
disp->driver.clean_dcache_cb(&disp->driver);
}
err |= vg_lite_clear(&rt, &rect, col32.full);
err |= vg_lite_finish();
}
else { /* fill with transparency */
vg_lite_path_t path;
lv_color32_t colMix;
int16_t path_data[] = { /* VG rectangular path */
VLC_OP_MOVE, fill_area->x1, fill_area->y1,
VLC_OP_LINE, fill_area->x2 + 1, fill_area->y1,
VLC_OP_LINE, fill_area->x2 + 1, fill_area->y2 + 1,
VLC_OP_LINE, fill_area->x1, fill_area->y2 + 1,
VLC_OP_LINE, fill_area->x1, fill_area->y1,
VLC_OP_END
};
err |= vg_lite_init_path(&path, VG_LITE_S16, VG_LITE_LOW, sizeof(path_data), path_data,
fill_area->x1, fill_area->y1, fill_area->x2 + 1, fill_area->y2 + 1);
if(err != VG_LITE_SUCCESS) {
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("vg_lite_init_path() failed.");
#endif
return LV_RES_INV;
}
colMix.ch.red = ((uint16_t)col32.ch.red * opa) >> 8; /* Pre-multiply color */
colMix.ch.green = ((uint16_t)col32.ch.green * opa) >> 8;
colMix.ch.blue = ((uint16_t)col32.ch.blue * opa) >> 8;
colMix.ch.alpha = opa;
if(disp && disp->driver.clean_dcache_cb) { /* Clean & invalidate cache */
disp->driver.clean_dcache_cb(&disp->driver);
}
vg_lite_matrix_t matrix;
vg_lite_identity(&matrix);
/* Draw rectangle */
err |= vg_lite_draw(&rt, &path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, colMix.full);
if(err) {
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("vg_lite_draw() failed.");
#endif
vg_lite_clear_path(&path);
return LV_RES_INV;
}
err |= vg_lite_finish();
err |= vg_lite_clear_path(&path);
}
if(err == VG_LITE_SUCCESS) {
return LV_RES_OK;
}
else {
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("VG Lite Fill failed.");
#endif
return LV_RES_INV;
}
}
/***
* BLock Image Transfer.
* @param[in] blit Description of the transfer
* @retval LV_RES_OK Transfer complete
* @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS)
*/
lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit)
{
vg_lite_buffer_t src_vgbuf, dst_vgbuf;
vg_lite_error_t err = VG_LITE_SUCCESS;
uint32_t rect[4];
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
if(blit->opa < LV_OPA_MIN) {
return LV_RES_OK; /* Nothing to BLIT */
}
if(!blit) {
/* Wrong parameter */
return LV_RES_INV;
}
/* Wrap src/dst buffer into VG-Lite buffer */
if(init_vg_buf(&src_vgbuf, blit->src_width, blit->src_height, blit->src_stride, blit->src) != LV_RES_OK) {
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("init_vg_buf reported error. BLIT failed.");
#endif
return LV_RES_INV;
}
if(init_vg_buf(&dst_vgbuf, blit->dst_width, blit->dst_height, blit->dst_stride, blit->dst) != LV_RES_OK) {
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("init_vg_buf reported error. BLIT failed.");
#endif
return LV_RES_INV;
}
rect[0] = 0; /* Crop */
rect[1] = 0;
rect[2] = blit->src_width;
rect[3] = blit->src_height;
vg_lite_matrix_t matrix;
vg_lite_identity(&matrix);
vg_lite_translate(blit->dst_area.x1, blit->dst_area.y1, &matrix);
if(disp && disp->driver.clean_dcache_cb) { /* Clean & invalidate cache */
disp->driver.clean_dcache_cb(&disp->driver);
}
uint32_t color;
vg_lite_blend_t blend;
if(blit->opa >= LV_OPA_MAX) {
color = 0x0;
blend = VG_LITE_BLEND_NONE;
}
else {
color = ((blit->opa) << 24) | ((blit->opa) << 16) | ((blit->opa) << 8) | (blit->opa);
blend = VG_LITE_BLEND_SRC_OVER;
src_vgbuf.image_mode = VG_LITE_MULTIPLY_IMAGE_MODE;
}
err |= vg_lite_blit_rect(&dst_vgbuf, &src_vgbuf, rect, &matrix, blend, color, VG_LITE_FILTER_POINT);
err |= vg_lite_finish();
if(err == VG_LITE_SUCCESS) {
return LV_RES_OK;
}
else {
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("vg_lite_blit_rect or vg_lite_finish reported error. BLIT failed.");
#endif
return LV_RES_INV;
}
}
/**********************
* STATIC FUNCTIONS
**********************/
/***
* Fills vg_lite_buffer_t structure according given parameters.
* @param[out] dst Buffer structure to be filled
* @param[in] width Width of buffer in pixels
* @param[in] height Height of buffer in pixels
* @param[in] stride Stride of the buffer in bytes
* @param[in] ptr Pointer to the buffer (must be aligned according VG-Lite requirements)
*/
static lv_res_t init_vg_buf(vg_lite_buffer_t * dst, uint32_t width, uint32_t height, uint32_t stride,
const lv_color_t * ptr)
{
if((((uintptr_t)ptr) % LV_ATTRIBUTE_MEM_ALIGN_SIZE) != 0x0) { /* Test for alignment */
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("ptr (0x%X) not aligned to %d.", (size_t) ptr, LV_ATTRIBUTE_MEM_ALIGN_SIZE);
#endif
return LV_RES_INV;
}
if((stride % LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX) != 0x0) { /* Test for stride alignment */
#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
LV_LOG_ERROR("Buffer stride (%d px) not aligned to %d px.", stride, LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX);
#endif
return LV_RES_INV;
}
dst->format = VGLITE_PX_FMT;
dst->tiled = VG_LITE_LINEAR;
dst->image_mode = VG_LITE_NORMAL_IMAGE_MODE;
dst->transparency_mode = VG_LITE_IMAGE_OPAQUE;
dst->width = width;
dst->height = height;
dst->stride = stride;
memset(&dst->yuv, 0, sizeof(dst->yuv));
dst->memory = (void *) ptr;
dst->address = (uint32_t) dst->memory;
dst->handle = 0x0;
return LV_RES_OK;
}
#endif /* LV_USE_GPU_NXP_VG_LITE */

View File

@@ -0,0 +1,133 @@
/**
* @file lv_gpu_nxp_vglite.h
*
*/
/**
* MIT License
*
* Copyright (c) 2020 NXP
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next paragraph)
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LV_SRC_LV_GPU_LV_GPU_NXP_VGLITE_H_
#define LV_SRC_LV_GPU_LV_GPU_NXP_VGLITE_H_
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_misc/lv_area.h"
/*********************
* DEFINES
*********************/
/** Stride in px required by VG-Lite HW. Don't change this. */
#define LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX 16
#ifndef LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT
/** Minimum area (in pixels) to be filled by VG-Lite with 100% opacity */
#define LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT 32
#endif
#ifndef LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT
/** Minimum area (in pixels) to be filled by VG-Lite with transparency */
#define LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT 32
#endif
#ifndef LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT
/** Minimum area (in pixels) for image copy with 100% opacity to be handled by VG-Lite */
#define LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT 32
#endif
#ifndef LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT
/** Minimum area (in pixels) for image copy with transparency to be handled by VG-Lite */
#define LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT 32
#endif
#ifndef LV_GPU_NXP_VG_LITE_LOG_ERRORS
/** Enable logging of VG-Lite erors (\see LV_LOG_ERROR) */
#define LV_GPU_NXP_VG_LITE_LOG_ERRORS 1
#endif
/**********************
* TYPEDEFS
**********************/
/**
* BLock Image Transfer descriptor structure
*/
typedef struct {
const lv_color_t * src; /**< Source buffer pointer (must be aligned on 32 bytes) */
lv_area_t src_area; /**< Area to be copied from source */
lv_coord_t src_width; /**< Source buffer width */
lv_coord_t src_height; /**< Source buffer height */
uint32_t src_stride; /**< Source buffer stride in bytes (must be aligned on 16 px) */
const lv_color_t * dst; /**< Destination buffer pointer (must be aligned on 32 bytes) */
lv_area_t dst_area; /**< Target area in destination buffer (must be the same as src_area) */
lv_coord_t dst_width; /**< Destination buffer width */
lv_coord_t dst_height; /**< Destination buffer height */
uint32_t dst_stride; /**< Destination buffer stride in bytes (must be aligned on 16 px) */
lv_opa_t opa; /**< Opacity - alpha mix (0 = source not copied, 255 = 100% opaque) */
} lv_gpu_nxp_vglite_blit_info_t;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/***
* Fills rectangular area in buffer.
* @param[in] dest_buf Destination buffer pointer (must be aligned on 32 bytes)
* @param[in] dest_width Destination buffer width in pixels ((must be aligned on 16 px)
* @param[in] dest_height Destination buffer height in pixels
* @param[in] fill_area Area to be filled
* @param[in] color Fill color
* @param[in] opa Opacity (255 = full, 128 = 50% background/50% color, 0 = no fill)
* @retval LV_RES_OK Fill completed
* @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS)
*/
lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv_coord_t dest_height,
const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa);
/***
* BLock Image Transfer.
* @param[in] blit Description of the transfer
* @retval LV_RES_OK Transfer complete
* @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS)
*/
lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_SRC_LV_GPU_LV_GPU_NXP_VGLITE_H_ */

View File

@@ -43,7 +43,7 @@
* STATIC PROTOTYPES
**********************/
static void invalidate_cache(void);
static void dma2d_wait(void);
static void wait_finish(void);
/**********************
* STATIC VARIABLES
@@ -63,7 +63,16 @@ static void dma2d_wait(void);
void lv_gpu_stm32_dma2d_init(void)
{
/* Enable DMA2D clock */
#if defined(STM32F4) || defined(STM32F7)
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN;
#elif defined(STM32H7)
RCC->AHB3ENR |= RCC_AHB3ENR_DMA2DEN;
#else
# warning "LVGL can't enable the clock of DMA2D"
#endif
/* Wait for hardware access to complete */
__asm volatile("DSB\n");
/* Delay after setting peripheral clock */
volatile uint32_t temp = RCC->AHB1ENR;
@@ -95,7 +104,7 @@ void lv_gpu_stm32_dma2d_fill(lv_color_t * buf, lv_coord_t buf_w, lv_color_t colo
/* start transfer */
DMA2D->CR |= DMA2D_CR_START_Msk;
dma2d_wait();
wait_finish();
}
/**
@@ -140,7 +149,7 @@ void lv_gpu_stm32_dma2d_fill_mask(lv_color_t * buf, lv_coord_t buf_w, lv_color_t
HAL_DMA2D_ConfigLayer(&hdma2d, 0);
HAL_DMA2D_ConfigLayer(&hdma2d, 1);
HAL_DMA2D_BlendingStart(&hdma2d, (uint32_t) mask, (uint32_t) buf, (uint32_t)buf, fill_w, fill_h);
dma2d_wait();
wait_finish();
#endif
}
@@ -170,7 +179,7 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_
/* start transfer */
DMA2D->CR |= DMA2D_CR_START_Msk;
dma2d_wait();
wait_finish();
}
/**
@@ -208,7 +217,19 @@ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color
/* start transfer */
DMA2D->CR |= DMA2D_CR_START_Msk;
dma2d_wait();
wait_finish();
}
void lv_gpu_stm32_dma2d_wait_cb(lv_disp_drv_t * drv)
{
if(drv && drv->wait_cb) {
while(DMA2D->CR & DMA2D_CR_START_Msk) {
drv->wait_cb(drv);
}
}
else {
while(DMA2D->CR & DMA2D_CR_START_Msk);
}
}
/**********************
@@ -221,14 +242,17 @@ static void invalidate_cache(void)
if(disp->driver.clean_dcache_cb) disp->driver.clean_dcache_cb(&disp->driver);
else {
#if __CORTEX_M >= 0x07
SCB_CleanInvalidateDCache();
if((SCB->CCR) & (uint32_t)SCB_CCR_DC_Msk)
SCB_CleanInvalidateDCache();
#endif
}
}
static void dma2d_wait(void)
static void wait_finish(void)
{
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
if(disp->driver.gpu_wait_cb) return;
while(DMA2D->CR & DMA2D_CR_START_Msk) {
if(disp->driver.wait_cb) disp->driver.wait_cb(&disp->driver);
}

View File

@@ -15,6 +15,7 @@ extern "C" {
*********************/
#include "../lv_misc/lv_area.h"
#include "../lv_misc/lv_color.h"
#include "../lv_hal/lv_hal_disp.h"
/*********************
* DEFINES
@@ -91,6 +92,14 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_
*/
void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color_t * map, lv_opa_t opa,
lv_coord_t map_w, lv_coord_t copy_w, lv_coord_t copy_h);
/**
* Can be used as `gpu_wait_cb` in display driver to
* let the MCU run while the GPU is working
*/
void lv_gpu_stm32_dma2d_wait_cb(lv_disp_drv_t * drv);
/**********************
* MACROS
**********************/

View File

@@ -341,7 +341,7 @@ lv_anim_value_t lv_anim_path_overshoot(const lv_anim_path_t * path, const lv_ani
else
t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;
int32_t step = _lv_bezier3(t, 0, 1000, 2000, 1024);
int32_t step = _lv_bezier3(t, 0, 1000, 1300, 1024);
int32_t new_value;
new_value = (int32_t)step * (a->end - a->start);
@@ -362,7 +362,7 @@ lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t
LV_UNUSED(path);
/*Calculate the current step*/
uint32_t t;
int32_t t;
if(a->time == a->act_time)
t = 1024;
else
@@ -381,31 +381,32 @@ lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t
t -= 408;
t = t * 5; /*to [0..1024] range*/
t = 1024 - t;
diff = diff / 6;
diff = diff / 20;
}
else if(t >= 614 && t < 819) {
/*Fall back*/
t -= 614;
t = t * 5; /*to [0..1024] range*/
diff = diff / 6;
diff = diff / 20;
}
else if(t >= 819 && t < 921) {
/*Second bounce back*/
t -= 819;
t = t * 10; /*to [0..1024] range*/
t = 1024 - t;
diff = diff / 16;
diff = diff / 40;
}
else if(t >= 921 && t <= 1024) {
/*Fall back*/
t -= 921;
t = t * 10; /*to [0..1024] range*/
diff = diff / 16;
diff = diff / 40;
}
if(t > 1024) t = 1024;
if(t < 0) t = 0;
int32_t step = _lv_bezier3(t, 1024, 1024, 800, 0);
int32_t step = _lv_bezier3(t, 1024, 800, 500, 0);
int32_t new_value;
new_value = (int32_t)step * diff;

View File

@@ -108,9 +108,9 @@ enum {
* Macros for all existing color depths
* to set/get values of the color channels
*------------------------------------------*/
# define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1);
# define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1);
# define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1);
# define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1)
# define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1)
# define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1)
# define LV_COLOR_SET_A1(c, v)
# define LV_COLOR_GET_R1(c) (c).ch.red
@@ -118,9 +118,9 @@ enum {
# define LV_COLOR_GET_B1(c) (c).ch.blue
# define LV_COLOR_GET_A1(c) 1
# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)(v) & 0x7U;
# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)(v) & 0x7U;
# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)(v) & 0x3U;
# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)(v) & 0x7U
# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)(v) & 0x7U
# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)(v) & 0x3U
# define LV_COLOR_SET_A8(c, v) do {} while(0)
# define LV_COLOR_GET_R8(c) (c).ch.red
@@ -128,10 +128,10 @@ enum {
# define LV_COLOR_GET_B8(c) (c).ch.blue
# define LV_COLOR_GET_A8(c) 0xFF
# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)(v) & 0x1FU;
# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)(v) & 0x3FU;
# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)(v) & 0x1FU
# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)(v) & 0x3FU
# define LV_COLOR_SET_G16_SWAP(c, v) {(c).ch.green_h = (uint8_t)(((v) >> 3) & 0x7); (c).ch.green_l = (uint8_t)((v) & 0x7);}
# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)(v) & 0x1FU;
# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)(v) & 0x1FU
# define LV_COLOR_SET_A16(c, v) do {} while(0)
# define LV_COLOR_GET_R16(c) (c).ch.red
@@ -140,10 +140,10 @@ enum {
# define LV_COLOR_GET_B16(c) (c).ch.blue
# define LV_COLOR_GET_A16(c) 0xFF
# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint32_t)((v) & 0xFF);
# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint32_t)((v) & 0xFF);
# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint32_t)((v) & 0xFF);
# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint32_t)((v) & 0xFF);
# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint32_t)((v) & 0xFF)
# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint32_t)((v) & 0xFF)
# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint32_t)((v) & 0xFF)
# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint32_t)((v) & 0xFF)
# define LV_COLOR_GET_R32(c) (c).ch.red
# define LV_COLOR_GET_G32(c) (c).ch.green
@@ -213,12 +213,12 @@ enum {
**********************/
typedef union {
uint8_t full; /*must be declared first to set all bits of byte via initializer list */
union {
uint8_t blue : 1;
uint8_t green : 1;
uint8_t red : 1;
} ch;
uint8_t full;
} lv_color1_t;
typedef union {
@@ -259,15 +259,23 @@ typedef union {
#if LV_COLOR_DEPTH == 1
typedef uint8_t lv_color_int_t;
typedef lv_color1_t lv_color_t;
#define _LV_COLOR_ZERO_INITIALIZER {0x00}
#elif LV_COLOR_DEPTH == 8
typedef uint8_t lv_color_int_t;
typedef lv_color8_t lv_color_t;
#define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00}}
#elif LV_COLOR_DEPTH == 16
typedef uint16_t lv_color_int_t;
typedef lv_color16_t lv_color_t;
# if LV_COLOR_16_SWAP == 0
# define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00}}
# else
# define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00, 0x00}}
# endif
#elif LV_COLOR_DEPTH == 32
typedef uint32_t lv_color_int_t;
typedef lv_color32_t lv_color_t;
#define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00, 0x00}}
#else
#error "Invalid LV_COLOR_DEPTH in lv_conf.h! Set it to 1, 8, 16 or 32!"
#endif
@@ -553,9 +561,9 @@ LV_ATTRIBUTE_FAST_MEM static inline void lv_color_mix_with_alpha(lv_color_t bg_c
/*Save the parameters and the result. If they will be asked again don't compute again*/
static lv_opa_t fg_opa_save = 0;
static lv_opa_t bg_opa_save = 0;
static lv_color_t fg_color_save = {.full = 0};
static lv_color_t bg_color_save = {.full = 0};
static lv_color_t res_color_saved = {.full = 0};
static lv_color_t fg_color_save = _LV_COLOR_ZERO_INITIALIZER;
static lv_color_t bg_color_save = _LV_COLOR_ZERO_INITIALIZER;
static lv_color_t res_color_saved = _LV_COLOR_ZERO_INITIALIZER;
static lv_opa_t res_opa_saved = 0;
if(fg_opa != fg_opa_save || bg_opa != bg_opa_save || fg_color.full != fg_color_save.full ||
@@ -600,7 +608,7 @@ static inline uint8_t lv_color_brightness(lv_color_t color)
/**
* MSVC compiler's definition of the __cplusplus indicating 199711L regardless to C++ standard version
* see https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-cplusplus
* so we use _MSC_VER macro unstead of __cplusplus
* so we use _MSC_VER macro instead of __cplusplus
*/
#ifdef _MSC_VER
#if _MSC_VER >= 1900 /* Visual Studio 2015 */
@@ -626,7 +634,7 @@ static inline uint8_t lv_color_brightness(lv_color_t color)
/* The most simple macro to create a color from R,G and B values */
#if LV_COLOR_DEPTH == 1
#define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{.full = (uint8_t)((b8 >> 7) | (g8 >> 7) | (r8 >> 7))})
#define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{(uint8_t)((b8 >> 7) | (g8 >> 7) | (r8 >> 7))})
#elif LV_COLOR_DEPTH == 8
#define LV_COLOR_MAKE(r8, g8, b8) (_LV_COLOR_MAKE_TYPE_HELPER{{(uint8_t)((b8 >> 6) & 0x3U), (uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 5) & 0x7U)}})
#elif LV_COLOR_DEPTH == 16

View File

@@ -536,7 +536,7 @@ void * _lv_mem_buf_get(uint32_t size)
}
}
LV_DEBUG_ASSERT(false, "No free buffer. Increase LV_DRAW_BUF_MAX_NUM.", 0x00);
LV_DEBUG_ASSERT(false, "No free buffer. Increase LV_MEM_BUF_MAX_NUM.", 0x00);
return NULL;
}

View File

@@ -6,9 +6,11 @@
/*********************
* INCLUDES
*********************/
#include <stdarg.h>
#include "lv_txt.h"
#include "lv_math.h"
#include "lv_log.h"
#include "lv_debug.h"
/*********************
* DEFINES
@@ -473,6 +475,54 @@ void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len)
}
}
/**
* return a new formatted text. Memory will be allocated to store the text.
* @param fmt `printf`-like format
* @return pointer to the allocated text string.
*/
char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap)
{
/*Allocate space for the new text by using trick from C99 standard section 7.19.6.12 */
va_list ap_copy;
va_copy(ap_copy, ap);
uint32_t len = lv_vsnprintf(NULL, 0, fmt, ap_copy);
va_end(ap_copy);
char * text = 0;
#if LV_USE_ARABIC_PERSIAN_CHARS
/*Put together the text according to the format string*/
char * raw_txt = _lv_mem_buf_get(len + 1);
LV_ASSERT_MEM(raw_txt);
if(raw_txt == NULL) {
return NULL;
}
lv_vsnprintf(raw_txt, len + 1, fmt, ap);
/*Get the size of the Arabic text and process it*/
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt);
text = lv_mem_alloc(len_ap + 1);
LV_ASSERT_MEM(text);
if(text == NULL) {
return NULL;
}
_lv_txt_ap_proc(raw_txt, text);
_lv_mem_buf_release(raw_txt);
#else
text = lv_mem_alloc(len + 1);
LV_ASSERT_MEM(text);
if(text == NULL) {
return NULL;
}
text[len] = 0; /* Ensure NULL termination */
lv_vsnprintf(text, len + 1, fmt, ap);
#endif
return text;
}
#if LV_TXT_ENC == LV_TXT_ENC_UTF8
/*******************************
* UTF-8 ENCODER/DECOER

View File

@@ -19,6 +19,7 @@ extern "C" {
#include "lv_area.h"
#include "lv_area.h"
#include "../lv_font/lv_font.h"
#include "lv_printf.h"
/*********************
* DEFINES
@@ -127,6 +128,13 @@ void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt);
*/
void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len);
/**
* return a new formatted text. Memory will be allocated to store the text.
* @param fmt `printf`-like format
* @return pointer to the allocated text string.
*/
char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap);
/***************************************************************
* GLOBAL FUNCTION POINTERS FOR CAHRACTER ENCODING INTERFACE
***************************************************************/

View File

@@ -211,6 +211,12 @@ static uint32_t lv_ap_get_char_index(uint16_t c)
for(uint8_t i = 0; ap_chars_map[i].char_end_form; i++) {
if(c == (ap_chars_map[i].char_offset + LV_AP_ALPHABET_BASE_CODE))
return i;
else if(c == ap_chars_map[i].char_end_form //is it an End form
|| c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_begining_form_offset) //is it a Begining form
|| c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_middle_form_offset) //is it a middle form
|| c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_isolated_form_offset)) { //is it an isolated form
return i;
}
}
return LV_UNDEF_ARABIC_PERSIAN_CHARS;
}

View File

@@ -27,7 +27,7 @@
/*BUTTON*/
#define COLOR_BTN (IS_LIGHT ? lv_color_hex(0xffffff) : lv_color_hex(0x586273))
#define COLOR_BTN_PR (IS_LIGHT ? lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_10) : lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_30))
#define COLOR_BTN_PR (IS_LIGHT ? lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_20) : lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_30))
#define COLOR_BTN_CHK (theme.color_primary)
#define COLOR_BTN_CHK_PR (lv_color_darken(theme.color_primary, LV_OPA_30))
@@ -204,6 +204,8 @@ static void basic_init(void)
lv_style_set_bg_color(&styles->scr, LV_STATE_DEFAULT, COLOR_SCR);
lv_style_set_text_color(&styles->scr, LV_STATE_DEFAULT, COLOR_SCR_TEXT);
lv_style_set_value_color(&styles->scr, LV_STATE_DEFAULT, COLOR_SCR_TEXT);
lv_style_set_text_sel_color(&styles->scr, LV_STATE_DEFAULT, COLOR_SCR_TEXT);
lv_style_set_text_sel_bg_color(&styles->scr, LV_STATE_DEFAULT, theme.color_primary);
lv_style_set_value_font(&styles->scr, LV_STATE_DEFAULT, theme.font_normal);
style_init_reset(&styles->bg);
@@ -547,10 +549,12 @@ static void calendar_init(void)
#if LV_USE_CALENDAR
style_init_reset(&styles->calendar_header);
lv_style_set_pad_top(&styles->calendar_header, LV_STATE_DEFAULT, PAD_DEF);
lv_style_set_pad_top(&styles->calendar_header, LV_STATE_DEFAULT, 0);
lv_style_set_pad_left(&styles->calendar_header, LV_STATE_DEFAULT, PAD_DEF);
lv_style_set_pad_right(&styles->calendar_header, LV_STATE_DEFAULT, PAD_DEF);
lv_style_set_pad_bottom(&styles->calendar_header, LV_STATE_DEFAULT, PAD_DEF);
lv_style_set_pad_bottom(&styles->calendar_header, LV_STATE_DEFAULT, 0);
lv_style_set_margin_top(&styles->calendar_header, LV_STATE_DEFAULT, PAD_DEF);
lv_style_set_margin_bottom(&styles->calendar_header, LV_STATE_DEFAULT, PAD_DEF);
lv_style_set_text_color(&styles->calendar_header, LV_STATE_PRESSED, IS_LIGHT ? lv_color_hex(0x888888) : LV_COLOR_WHITE);
style_init_reset(&styles->calendar_daynames);
@@ -840,10 +844,6 @@ static void tabview_win_shared_init(void)
style_init_reset(&styles->tabview_btns_bg);
lv_style_set_bg_opa(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&styles->tabview_btns_bg, LV_STATE_DEFAULT, COLOR_BG);
lv_style_set_border_color(&styles->tabview_btns_bg, LV_STATE_DEFAULT,
IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42));
lv_style_set_border_width(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_DPX(5));
lv_style_set_border_side(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_BORDER_SIDE_BOTTOM);
lv_style_set_text_color(&styles->tabview_btns_bg, LV_STATE_DEFAULT, COLOR_SCR_TEXT);
lv_style_set_image_recolor(&styles->tabview_btns_bg, LV_STATE_DEFAULT, lv_color_hex(0x979a9f));
lv_style_set_pad_top(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_DPX(7));
@@ -1252,27 +1252,28 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
_lv_style_list_add_style(list, &styles->pad_small);
_lv_style_list_add_style(list, &styles->chart_series_bg);
list = lv_obj_get_style_list(obj, LV_CHART_PART_CURSOR);
_lv_style_list_add_style(list, &styles->chart_series_bg);
list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES);
_lv_style_list_add_style(list, &styles->chart_series);
break;
#endif
#if LV_USE_TABLE
case LV_THEME_TABLE:
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg);
case LV_THEME_TABLE: {
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL1);
_lv_style_list_add_style(list, &styles->table_cell);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL2);
_lv_style_list_add_style(list, &styles->table_cell);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL3);
_lv_style_list_add_style(list, &styles->table_cell);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL4);
_lv_style_list_add_style(list, &styles->table_cell);
break;
int idx = 1; /* start value should be 1, not zero, since cell styles
start at 1 due to presence of LV_TABLE_PART_BG=0
in the enum (lv_table.h) */
/* declaring idx outside loop to work with older compilers */
for(; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++) {
list = lv_obj_get_style_list(obj, idx);
_lv_style_list_add_style(list, &styles->table_cell);
}
break;
}
#endif
#if LV_USE_WIN

View File

@@ -115,6 +115,8 @@ static void basic_init(void)
lv_style_set_bg_opa(&styles->scr, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&styles->scr, LV_STATE_DEFAULT, BG_COLOR);
lv_style_set_text_color(&styles->scr, LV_STATE_DEFAULT, FG_COLOR);
lv_style_set_text_sel_color(&styles->scr, LV_STATE_DEFAULT, BG_COLOR);
lv_style_set_text_sel_bg_color(&styles->scr, LV_STATE_DEFAULT, FG_COLOR);
lv_style_set_value_color(&styles->scr, LV_STATE_DEFAULT, FG_COLOR);
style_init_reset(&styles->bg);
@@ -886,26 +888,21 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
break;
#endif
#if LV_USE_TABLE
case LV_THEME_TABLE:
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg);
case LV_THEME_TABLE: {
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL1);
_lv_style_list_add_style(list, &styles->bg);
_lv_style_list_add_style(list, &styles->no_radius);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL2);
_lv_style_list_add_style(list, &styles->bg);
_lv_style_list_add_style(list, &styles->no_radius);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL3);
_lv_style_list_add_style(list, &styles->bg);
_lv_style_list_add_style(list, &styles->no_radius);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL4);
_lv_style_list_add_style(list, &styles->bg);
_lv_style_list_add_style(list, &styles->no_radius);
break;
int idx = 1; /* start value should be 1, not zero, since cell styles
start at 1 due to presence of LV_TABLE_PART_BG=0
in the enum (lv_table.h) */
/* declaring idx outside loop to work with older compilers */
for(; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++) {
list = lv_obj_get_style_list(obj, idx);
_lv_style_list_add_style(list, &styles->bg);
_lv_style_list_add_style(list, &styles->no_radius);
}
break;
}
#endif
#if LV_USE_WIN

View File

@@ -42,7 +42,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name);
/**********************
* STATIC VARIABLES
**********************/
static lv_theme_t theme;
static lv_theme_t theme;
static theme_styles_t * styles;
@@ -728,22 +727,20 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
break;
#endif
#if LV_USE_TABLE
case LV_THEME_TABLE:
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg);
case LV_THEME_TABLE: {
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL1);
_lv_style_list_add_style(list, &styles->bg);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL2);
_lv_style_list_add_style(list, &styles->bg);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL3);
_lv_style_list_add_style(list, &styles->bg);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL4);
_lv_style_list_add_style(list, &styles->bg);
break;
int idx = 1; /* start value should be 1, not zero, since cell styles
start at 1 due to presence of LV_TABLE_PART_BG=0
in the enum (lv_table.h) */
/* declaring idx outside loop to work with older compilers */
for(; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++) {
list = lv_obj_get_style_list(obj, idx);
_lv_style_list_add_style(list, &styles->bg);
}
break;
}
#endif
#if LV_USE_WIN

View File

@@ -85,6 +85,7 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
ext->arc_angle_end = 270;
ext->type = LV_ARC_TYPE_NORMAL;
ext->cur_value = -1;
ext->min_close = 1;
ext->min_value = 0;
ext->max_value = 100;
ext->dragging = false;
@@ -272,6 +273,8 @@ void lv_arc_set_bg_start_angle(lv_obj_t * arc, uint16_t start)
}
ext->bg_angle_start = start;
value_update(arc);
}
/**
@@ -304,6 +307,8 @@ void lv_arc_set_bg_end_angle(lv_obj_t * arc, uint16_t end)
lv_obj_invalidate(arc);
}
value_update(arc);
ext->bg_angle_end = end;
}
@@ -328,6 +333,8 @@ void lv_arc_set_bg_angles(lv_obj_t * arc, uint16_t start, uint16_t end)
ext->bg_angle_end = end;
inv_arc_area(arc, ext->bg_angle_start, ext->bg_angle_end, LV_ARC_PART_BG);
value_update(arc);
}
/**
@@ -751,6 +758,9 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
/*It must be in "dragging" mode to turn the arc*/
if(ext->dragging == false) return res;
/*No angle can be determined if exactly the middle of the arc is being pressed*/
if(p.x == 0 && p.y == 0) return res;
/*Calculate the angle of the pressed point*/
int16_t angle;
int16_t bg_end = ext->bg_angle_end;
@@ -758,13 +768,31 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
bg_end = ext->bg_angle_end + 360;
}
angle = 360 - _lv_atan2(p.x, p.y) + 90; /*Some transformation is required*/
angle = _lv_atan2(p.y, p.x);
angle -= ext->rotation_angle;
if(angle < ext->bg_angle_start) angle = ext->bg_angle_start;
if(angle > bg_end) angle = bg_end;
angle -= ext->bg_angle_start; /*Make the angle relative to the start angle*/
if(angle < 0) angle += 360;
int16_t deg_range = bg_end - ext->bg_angle_start;
int16_t last_angle_rel = ext->last_angle - ext->bg_angle_start;
int16_t delta_angle = angle - last_angle_rel;
/* Do not allow big jumps.
* It's mainly to avoid jumping to the opposite end if the "dead" range between min. an max. is crossed.
* Check which and was closer on the last valid press (ext->min_close) and prefer that end */
if(LV_MATH_ABS(delta_angle) > 180) {
if(ext->min_close) angle = 0;
else angle = deg_range;
}
else {
if(angle < deg_range / 2) ext->min_close = 1;
else ext->min_close = 0;
}
/*Calculate the slew rate limited angle based on change rate (degrees/sec)*/
int16_t delta_angle = angle - ext->last_angle;
delta_angle = angle - last_angle_rel;
uint32_t delta_tick = lv_tick_elaps(ext->last_tick);
int16_t delta_angle_max = (ext->chg_rate * delta_tick) / 1000;
@@ -775,13 +803,15 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
delta_angle = -delta_angle_max;
}
angle = ext->last_angle + delta_angle; /*Apply the limited angle change*/
angle = last_angle_rel + delta_angle; /*Apply the limited angle change*/
/*Rounding for symmetry*/
int32_t round = ((bg_end - ext->bg_angle_start) * 8) / (ext->max_value - ext->min_value);
round = (round + 4) >> 4;
angle += round;
angle += ext->bg_angle_start; /*Make the angle absolute again*/
/*Set the new value*/
int16_t old_value = ext->cur_value;
int16_t new_value = _lv_map(angle, ext->bg_angle_start, bg_end, ext->min_value, ext->max_value);
@@ -831,6 +861,12 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
if(res != LV_RES_OK) return res;
}
}
else if(sign == LV_SIGNAL_GET_EDITABLE) {
#if LV_USE_GROUP
bool * editable = (bool *)param;
*editable = true;
#endif
}
else if(sign == LV_SIGNAL_CLEANUP) {
lv_obj_clean_style_list(arc, LV_ARC_PART_KNOB);
lv_obj_clean_style_list(arc, LV_ARC_PART_INDIC);

View File

@@ -51,6 +51,7 @@ typedef struct {
uint16_t dragging : 1;
uint16_t type : 2;
uint16_t adjustable : 1;
uint16_t min_close : 1; /*1: the last pressed angle was closer to minimum end*/
uint16_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/
uint32_t last_tick; /*Last dragging event timestamp of the arc*/
int16_t last_angle; /*Last dragging angle of the arc*/

View File

@@ -157,9 +157,11 @@ void lv_bar_set_value(lv_obj_t * bar, int16_t value, lv_anim_enable_t anim)
lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);
if(ext->cur_value == value) return;
int16_t new_value;
new_value = value > ext->max_value ? ext->max_value : value;
int16_t new_value = value;
new_value = value > ext->max_value ? ext->max_value : new_value;
new_value = new_value < ext->min_value ? ext->min_value : new_value;
new_value = new_value < ext->start_value ? ext->start_value : new_value;
if(ext->cur_value == new_value) return;
#if LV_USE_ANIMATION == 0
@@ -184,9 +186,10 @@ void lv_bar_set_start_value(lv_obj_t * bar, int16_t start_value, lv_anim_enable_
lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);
if(ext->start_value == start_value) return;
int16_t new_value;
new_value = start_value > ext->max_value ? ext->max_value : start_value;
new_value = new_value < ext->min_value ? ext->min_value : start_value;
int16_t new_value = start_value;
new_value = new_value > ext->max_value ? ext->max_value : new_value;
new_value = new_value < ext->min_value ? ext->min_value : new_value;
new_value = new_value > ext->cur_value ? ext->cur_value : new_value;
if(ext->start_value == new_value) return;
#if LV_USE_ANIMATION == 0

View File

@@ -15,6 +15,7 @@
#include "../lv_core/lv_refr.h"
#include "../lv_themes/lv_theme.h"
#include "../lv_misc/lv_txt.h"
#include "../lv_misc/lv_txt_ap.h"
/*********************
* DEFINES
@@ -43,7 +44,6 @@ static bool button_get_tgl_state(lv_btnmatrix_ctrl_t ctrl_bits);
static uint16_t get_button_from_point(lv_obj_t * btnm, lv_point_t * p);
static void allocate_btn_areas_and_controls(const lv_obj_t * btnm, const char ** map);
static void invalidate_button_area(const lv_obj_t * btnm, uint16_t btn_idx);
static bool maps_are_identical(const char ** map1, const char ** map2);
static void make_one_button_toggled(lv_obj_t * btnm, uint16_t btn_idx);
/**********************
@@ -152,11 +152,9 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[])
* set/allocation when map hasn't changed.
*/
lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm);
if(!maps_are_identical(ext->map_p, map)) {
/*Analyze the map and create the required number of buttons*/
allocate_btn_areas_and_controls(btnm, map);
}
/*Analyze the map and create the required number of buttons*/
allocate_btn_areas_and_controls(btnm, map);
ext->map_p = map;
/*Set size and positions of the buttons*/
@@ -322,7 +320,7 @@ void lv_btnmatrix_set_recolor(const lv_obj_t * btnm, bool en)
* @param btnm pointer to button matrix object
* @param btn_id 0 based index of the button to modify. (Not counting new lines)
*/
void lv_btnmatrix_set_btn_ctrl(const lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl)
void lv_btnmatrix_set_btn_ctrl(lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl)
{
LV_ASSERT_OBJ(btnm, LV_OBJX_NAME);
@@ -330,6 +328,12 @@ void lv_btnmatrix_set_btn_ctrl(const lv_obj_t * btnm, uint16_t btn_id, lv_btnmat
if(btn_id >= ext->btn_cnt) return;
/*Uncheck all buttons if required*/
if(ext->one_check && (ctrl & LV_BTNMATRIX_CTRL_CHECK_STATE)) {
lv_btnmatrix_clear_btn_ctrl_all(btnm, LV_BTNMATRIX_CTRL_CHECK_STATE);
ext->btn_id_act = btn_id;
}
ext->ctrl_bits[btn_id] |= ctrl;
invalidate_button_area(btnm, btn_id);
}
@@ -677,6 +681,10 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
lv_style_int_t padding_top = lv_obj_get_style_pad_top(btnm, LV_BTNMATRIX_PART_BG);
lv_style_int_t padding_bottom = lv_obj_get_style_pad_bottom(btnm, LV_BTNMATRIX_PART_BG);
#if LV_USE_ARABIC_PERSIAN_CHARS
const size_t txt_ap_size = 256 ;
char * txt_ap = _lv_mem_buf_get(txt_ap_size);
#endif
for(btn_i = 0; btn_i < ext->btn_cnt; btn_i++, txt_i++) {
/*Search the next valid text in the map*/
while(strcmp(ext->map_p[txt_i], "\n") == 0) {
@@ -792,6 +800,16 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
lv_style_int_t letter_space = draw_label_dsc_act->letter_space;
lv_style_int_t line_space = draw_label_dsc_act->line_space;
const char * txt = ext->map_p[txt_i];
#if LV_USE_ARABIC_PERSIAN_CHARS
/*Get the size of the Arabic text and process it*/
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(txt);
if(len_ap < txt_ap_size) {
_lv_txt_ap_proc(txt, txt_ap);
txt = txt_ap;
}
#endif
lv_point_t txt_size;
_lv_txt_get_size(&txt_size, txt, font, letter_space,
line_space, lv_area_get_width(&area_btnm), txt_flag);
@@ -803,6 +821,10 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
lv_draw_label(&area_tmp, clip_area, draw_label_dsc_act, txt, NULL);
}
#if LV_USE_ARABIC_PERSIAN_CHARS
_lv_mem_buf_release(txt_ap);
#endif
}
else if(mode == LV_DESIGN_DRAW_POST) {
ancestor_design_f(btnm, clip_area, mode);
@@ -1126,6 +1148,10 @@ static void allocate_btn_areas_and_controls(const lv_obj_t * btnm, const char **
lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm);
/*Do not allocate memory for the same amount of buttons*/
if(btn_cnt == ext->btn_cnt) return;
if(ext->button_areas != NULL) {
lv_mem_free(ext->button_areas);
ext->button_areas = NULL;
@@ -1263,25 +1289,6 @@ static void invalidate_button_area(const lv_obj_t * btnm, uint16_t btn_idx)
lv_obj_invalidate_area(btnm, &btn_area);
}
/**
* Compares two button matrix maps for equality
* @param map1 map to compare
* @param map2 map to compare
* @return true if maps are identical in length and content
*/
static bool maps_are_identical(const char ** map1, const char ** map2)
{
if(map1 == map2) return true;
if(map1 == NULL || map2 == NULL) return map1 == map2;
uint16_t i = 0;
while(map1[i][0] != '\0' && map2[i][0] != '\0') {
if(strcmp(map1[i], map2[i]) != 0) return false;
i++;
}
return map1[i][0] == '\0' && map2[i][0] == '\0';
}
/**
* Enforces a single button being toggled on the button matrix.
* It simply clears the toggle flag on other buttons.

View File

@@ -127,7 +127,7 @@ void lv_btnmatrix_set_recolor(const lv_obj_t * btnm, bool en);
* @param btnm pointer to button matrix object
* @param btn_id 0 based index of the button to modify. (Not counting new lines)
*/
void lv_btnmatrix_set_btn_ctrl(const lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl);
void lv_btnmatrix_set_btn_ctrl(lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl);
/**
* Clear the attributes of a button of the button matrix

View File

@@ -650,8 +650,10 @@ static bool calculate_touched_day(lv_obj_t * calendar, const lv_point_t * touche
static lv_coord_t get_header_height(lv_obj_t * calendar)
{
const lv_font_t * font = lv_obj_get_style_text_font(calendar, LV_CALENDAR_PART_HEADER);
lv_style_int_t top = lv_obj_get_style_pad_top(calendar, LV_CALENDAR_PART_HEADER);
lv_style_int_t bottom = lv_obj_get_style_pad_bottom(calendar, LV_CALENDAR_PART_HEADER);
lv_style_int_t top = lv_obj_get_style_margin_top(calendar, LV_CALENDAR_PART_HEADER) +
lv_obj_get_style_pad_top(calendar, LV_CALENDAR_PART_HEADER);
lv_style_int_t bottom = lv_obj_get_style_margin_bottom(calendar, LV_CALENDAR_PART_HEADER) +
lv_obj_get_style_pad_bottom(calendar, LV_CALENDAR_PART_HEADER);
return lv_font_get_line_height(font) + top + bottom;
}
@@ -677,7 +679,6 @@ static lv_coord_t get_day_names_height(lv_obj_t * calendar)
*/
static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
{
lv_style_int_t header_top = lv_obj_get_style_pad_top(calendar, LV_CALENDAR_PART_HEADER);
lv_style_int_t header_left = lv_obj_get_style_pad_left(calendar, LV_CALENDAR_PART_HEADER);
lv_style_int_t header_right = lv_obj_get_style_pad_right(calendar, LV_CALENDAR_PART_HEADER);
const lv_font_t * font = lv_obj_get_style_text_font(calendar, LV_CALENDAR_PART_HEADER);
@@ -687,8 +688,9 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
lv_area_t header_area;
header_area.x1 = calendar->coords.x1;
header_area.x2 = calendar->coords.x2;
header_area.y1 = calendar->coords.y1 + header_top;
header_area.y2 = header_area.y1 + lv_font_get_line_height(font);
header_area.y1 = calendar->coords.y1 + lv_obj_get_style_margin_top(calendar, LV_CALENDAR_PART_HEADER);
header_area.y2 = header_area.y1 + lv_obj_get_style_pad_top(calendar, LV_CALENDAR_PART_HEADER) +
lv_font_get_line_height(font) + lv_obj_get_style_pad_bottom(calendar, LV_CALENDAR_PART_HEADER);
lv_draw_rect_dsc_t header_rect_dsc;
lv_draw_rect_dsc_init(&header_rect_dsc);
@@ -711,6 +713,8 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
lv_draw_label_dsc_init(&label_dsc);
lv_obj_init_draw_label_dsc(calendar, LV_CALENDAR_PART_HEADER, &label_dsc);
label_dsc.flag = LV_TXT_FLAG_CENTER;
header_area.y1 += lv_obj_get_style_pad_top(calendar, LV_CALENDAR_PART_HEADER);
header_area.y2 -= lv_obj_get_style_pad_bottom(calendar, LV_CALENDAR_PART_HEADER);
lv_draw_label(&header_area, mask, &label_dsc, txt_buf, NULL);
calendar->state = state_ori; /*Restore the state*/

View File

@@ -51,10 +51,10 @@ static lv_style_list_t * lv_chart_get_style(lv_obj_t * chart, uint8_t part);
static void draw_series_bg(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * mask);
static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * clip_area);
static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * clip_area);
static void draw_cursors(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * clip_area);
static void draw_axes(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * mask);
static void invalidate_lines(lv_obj_t * chart, uint16_t i);
static void invalidate_columns(lv_obj_t * chart, uint16_t i);
static void get_series_area(lv_obj_t * chart, lv_area_t * series_area);
static void get_next_axis_label(lv_chart_label_iterator_t * iterator, char * buf);
static inline bool is_tick_with_label(uint8_t tick_num, lv_chart_axis_cfg_t * axis);
static lv_chart_label_iterator_t create_axis_label_iter(const char * list, uint8_t iterator_dir);
@@ -98,6 +98,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
}
_lv_ll_init(&ext->series_ll, sizeof(lv_chart_series_t));
_lv_ll_init(&ext->cursors_ll, sizeof(lv_chart_cursor_t));
uint8_t i;
for(i = 0; i < _LV_CHART_AXIS_LAST; i++) {
@@ -122,6 +123,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
lv_style_list_init(&ext->style_series_bg);
lv_style_list_init(&ext->style_series);
lv_style_list_init(&ext->style_cursors);
if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(chart);
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(chart);
@@ -140,6 +142,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
lv_style_list_copy(&ext->style_series, &ext_copy->style_series);
lv_style_list_copy(&ext->style_series_bg, &ext_copy->style_series_bg);
lv_style_list_copy(&ext->style_cursors, &ext_copy->style_cursors);
ext->type = ext_copy->type;
ext->hdiv_cnt = ext_copy->hdiv_cnt;
@@ -204,6 +207,23 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color)
return ser;
}
lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * chart, lv_color_t color, lv_cursor_direction_t axes)
{
LV_ASSERT_OBJ(chart, LV_OBJX_NAME);
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
lv_chart_cursor_t * cursor = _lv_ll_ins_head(&ext->cursors_ll);
LV_ASSERT_MEM(cursor);
if(cursor == NULL) return NULL;
cursor->point.x = 0U;
cursor->point.y = LV_CHART_POINT_DEF;
cursor->color = color;
cursor->axes = axes;
return cursor;
}
/**
* Clear the point of a series
* @param chart pointer to a chart object
@@ -629,6 +649,23 @@ void lv_chart_set_series_axis(lv_obj_t * chart, lv_chart_series_t * ser, lv_char
lv_chart_refresh(chart);
}
/**
* Set the coordinate of the cursor with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object.
* @param cursor pointer to the cursor.
* @param point the new coordinate of cursor relative to the series area
*/
void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_point_t * point)
{
LV_ASSERT_NULL(cursor);
LV_UNUSED(chart);
cursor->point.x = point->x;
cursor->point.y = point->y;
lv_chart_refresh(chart);
}
/*=====================
* Getter functions
*====================*/
@@ -702,6 +739,138 @@ lv_chart_axis_t lv_chart_get_series_axis(lv_obj_t * chart, lv_chart_series_t * s
return ser->y_axis;
}
/**
* Get the coordinate of the cursor with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object
* @param cursor pointer to cursor
* @return coordinate of the cursor as lv_point_t
*/
lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor)
{
LV_ASSERT_NULL(cursor);
LV_UNUSED(chart);
return cursor->point;
}
/**
* Get the nearest index to an X coordinate
* @param chart pointer to a chart object
* @param coord the coordination of the point relative to the series area.
* @return the found index
*/
uint16_t lv_chart_get_nearest_index_from_coord(lv_obj_t * chart, lv_coord_t x)
{
lv_area_t series_area;
lv_chart_get_series_area(chart, &series_area);
lv_coord_t w = lv_area_get_width(&series_area);
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if(x < 0) return 0;
if(x > w) return ext->point_cnt - 1;
if(ext->type == LV_CHART_TYPE_LINE) return (x * (ext->point_cnt - 1) + w / 2) / w;
if(ext->type == LV_CHART_TYPE_COLUMN) return (x * ext->point_cnt) / w;
return 0;
}
/**
* Get the x coordinate of the an index with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object
* @param ser pointer to series
* @param id the index.
* @return x coordinate of index
*/
lv_coord_t lv_chart_get_x_from_index(lv_obj_t * chart, lv_chart_series_t * ser, uint16_t id)
{
LV_ASSERT_NULL(chart);
LV_ASSERT_NULL(ser);
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if(id >= ext->point_cnt) {
LV_LOG_WARN("Invalid index: %d", id);
return 0;
}
lv_area_t series_area;
lv_chart_get_series_area(chart, &series_area);
lv_coord_t w = lv_area_get_width(&series_area);
lv_coord_t x = 0;
if(ext->type & LV_CHART_TYPE_LINE) {
x = (w * id) / (ext->point_cnt - 1);
}
else if(ext->type & LV_CHART_TYPE_COLUMN) {
lv_coord_t col_w = w / ((_lv_ll_get_len(&ext->series_ll) + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/
lv_chart_series_t * itr_ser = NULL;
lv_style_int_t col_space = lv_obj_get_style_pad_inner(chart, LV_CHART_PART_SERIES);
x = (int32_t)((int32_t)w * id) / ext->point_cnt;
x += col_w / 2; /*Start offset*/
_LV_LL_READ_BACK(ext->series_ll, itr_ser) {
if(itr_ser == ser) break;
x += col_w;
}
x += (col_w - col_space) / 2;
}
return x;
}
/**
* Get the y coordinate of the an index with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object
* @param ser pointer to series
* @param id the index.
* @return y coordinate of index
*/
lv_coord_t lv_chart_get_y_from_index(lv_obj_t * chart, lv_chart_series_t * ser, uint16_t id)
{
LV_ASSERT_NULL(chart);
LV_ASSERT_NULL(ser);
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if(id >= ext->point_cnt) {
LV_LOG_WARN("Invalid index: %d", id);
return 0;
}
lv_area_t series_area;
lv_chart_get_series_area(chart, &series_area);
lv_coord_t h = lv_area_get_height(&series_area);
int32_t y = (int32_t)((int32_t)ser->points[id] - ext->ymin[ser->y_axis]) * h;
y = y / (ext->ymax[ser->y_axis] - ext->ymin[ser->y_axis]);
y = h - y;
return (lv_coord_t)y;
}
/**
* Get the series area of a chart.
* @param chart pointer to a chart object
* @param series_area pointer to an area variable that the result will be put in.
*/
void lv_chart_get_series_area(lv_obj_t * chart, lv_area_t * series_area)
{
lv_area_copy(series_area, &chart->coords);
series_area->x1 += lv_obj_get_style_pad_left(chart, LV_CHART_PART_BG);
series_area->x2 -= lv_obj_get_style_pad_right(chart, LV_CHART_PART_BG);
series_area->y1 += lv_obj_get_style_pad_top(chart, LV_CHART_PART_BG);
series_area->y2 -= lv_obj_get_style_pad_bottom(chart, LV_CHART_PART_BG);
}
/*=====================
* Other functions
*====================*/
@@ -744,7 +913,7 @@ static lv_design_res_t lv_chart_design(lv_obj_t * chart, const lv_area_t * clip_
lv_draw_rect(&chart->coords, clip_area, &bg_dsc);
lv_area_t series_area;
get_series_area(chart, &series_area);
lv_chart_get_series_area(chart, &series_area);
draw_series_bg(chart, &series_area, clip_area);
draw_axes(chart, &series_area, clip_area);
@@ -753,6 +922,7 @@ static lv_design_res_t lv_chart_design(lv_obj_t * chart, const lv_area_t * clip_
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if(ext->type & LV_CHART_TYPE_LINE) draw_series_line(chart, &series_area, clip_area);
if(ext->type & LV_CHART_TYPE_COLUMN) draw_series_column(chart, &series_area, clip_area);
draw_cursors(chart, &series_area, clip_area);
}
return LV_DESIGN_RES_OK;
@@ -794,6 +964,7 @@ static lv_res_t lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param
_lv_ll_clear(&ext->series_ll);
lv_obj_clean_style_list(chart, LV_CHART_PART_SERIES);
lv_obj_clean_style_list(chart, LV_CHART_PART_CURSOR);
lv_obj_clean_style_list(chart, LV_CHART_PART_SERIES_BG);
}
@@ -824,6 +995,9 @@ static lv_style_list_t * lv_chart_get_style(lv_obj_t * chart, uint8_t part)
case LV_CHART_PART_SERIES:
style_dsc_p = &ext->style_series;
break;
case LV_CHART_PART_CURSOR:
style_dsc_p = &ext->style_cursors;
break;
default:
style_dsc_p = NULL;
}
@@ -1120,6 +1294,94 @@ static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area,
}
}
/**
* Draw the cursors as lines on a chart
* @param chart pointer to chart object
* @param clip_area the object will be drawn only in this area
*/
static void draw_cursors(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * clip_area)
{
lv_area_t series_mask;
bool mask_ret = _lv_area_intersect(&series_mask, series_area, clip_area);
if(mask_ret == false) return;
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if(_lv_ll_is_empty(&ext->cursors_ll)) return;
lv_point_t p1;
lv_point_t p2;
lv_chart_cursor_t * cursor;
lv_draw_line_dsc_t line_dsc;
lv_draw_line_dsc_init(&line_dsc);
lv_obj_init_draw_line_dsc(chart, LV_CHART_PART_CURSOR, &line_dsc);
lv_draw_rect_dsc_t point_dsc;
lv_draw_rect_dsc_init(&point_dsc);
point_dsc.bg_opa = line_dsc.opa;
point_dsc.radius = LV_RADIUS_CIRCLE;
lv_coord_t point_radius = lv_obj_get_style_size(chart, LV_CHART_PART_CURSOR);
/*Do not bother with line ending is the point will over it*/
if(point_radius > line_dsc.width / 2) line_dsc.raw_end = 1;
/*Go through all cursor lines*/
_LV_LL_READ_BACK(ext->cursors_ll, cursor) {
line_dsc.color = cursor->color;
point_dsc.bg_color = cursor->color;
if(cursor->axes & LV_CHART_CURSOR_RIGHT) {
p1.x = series_area->x1 + cursor->point.x;
p1.y = series_area->y1 + cursor->point.y;
p2.x = series_area->x2;
p2.y = p1.y;
lv_draw_line(&p1, &p2, &series_mask, &line_dsc);
}
if(cursor->axes & LV_CHART_CURSOR_UP) {
p1.x = series_area->x1 + cursor->point.x;
p1.y = series_area->y1;
p2.x = p1.x;
p2.y = series_area->y1 + cursor->point.y;
lv_draw_line(&p1, &p2, &series_mask, &line_dsc);
}
if(cursor->axes & LV_CHART_CURSOR_LEFT) {
p1.x = series_area->x1;
p1.y = series_area->y1 + cursor->point.y;
p2.x = p1.x + cursor->point.x;
p2.y = p1.y;
lv_draw_line(&p1, &p2, &series_mask, &line_dsc);
}
if(cursor->axes & LV_CHART_CURSOR_DOWN) {
p1.x = series_area->x1 + cursor->point.x;
p1.y = series_area->y1 + cursor->point.y;
p2.x = p1.x;
p2.y = series_area->y2;
lv_draw_line(&p1, &p2, &series_mask, &line_dsc);
}
if(point_radius) {
lv_area_t point_area;
point_area.x1 = series_area->x1 + cursor->point.x - point_radius;
point_area.x2 = series_area->x1 + cursor->point.x + point_radius;
point_area.y1 = series_area->y1 + cursor->point.y - point_radius;
point_area.y2 = series_area->y1 + cursor->point.y + point_radius;
/*Don't limit to `series_mask` to get full circles on the ends*/
lv_draw_rect(&point_area, clip_area, &point_dsc);
}
}
}
/**
* Create iterator for newline-separated list
* @param list pointer to newline-separated labels list
@@ -1358,7 +1620,10 @@ static void draw_y_ticks(lv_obj_t * chart, const lv_area_t * series_area, const
LV_COORD_MAX, LV_TXT_FLAG_CENTER);
/* set the area at some distance of the major tick len left of the tick */
lv_area_t a = {.y1 = p2.y - size.y / 2, .y2 = p2.y + size.y / 2};
/* changed to explicit member initialization to allow compilation as c++ */
lv_area_t a;
a.y1 = p2.y - size.y / 2;
a.y2 = p2.y + size.y / 2;
if(which_axis == LV_CHART_AXIS_PRIMARY_Y) {
a.x1 = p2.x - size.x - label_dist;
@@ -1497,7 +1762,7 @@ static void invalidate_lines(lv_obj_t * chart, uint16_t i)
if(i >= ext->point_cnt) return;
lv_area_t series_area;
get_series_area(chart, &series_area);
lv_chart_get_series_area(chart, &series_area);
lv_coord_t w = lv_area_get_width(&series_area);
lv_coord_t x_ofs = series_area.x1;
@@ -1534,7 +1799,7 @@ static void invalidate_columns(lv_obj_t * chart, uint16_t i)
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
lv_area_t series_area;
get_series_area(chart, &series_area);
lv_chart_get_series_area(chart, &series_area);
lv_area_t col_a;
lv_coord_t w = lv_area_get_width(&series_area);
@@ -1552,13 +1817,4 @@ static void invalidate_columns(lv_obj_t * chart, uint16_t i)
_lv_inv_area(lv_obj_get_disp(chart), &col_a);
}
static void get_series_area(lv_obj_t * chart, lv_area_t * series_area)
{
lv_area_copy(series_area, &chart->coords);
series_area->x1 += lv_obj_get_style_pad_left(chart, LV_CHART_PART_BG);
series_area->x2 -= lv_obj_get_style_pad_right(chart, LV_CHART_PART_BG);
series_area->y1 += lv_obj_get_style_pad_top(chart, LV_CHART_PART_BG);
series_area->y2 -= lv_obj_get_style_pad_bottom(chart, LV_CHART_PART_BG);
}
#endif

View File

@@ -42,7 +42,6 @@ enum {
LV_CHART_TYPE_NONE = 0x00, /**< Don't draw the series*/
LV_CHART_TYPE_LINE = 0x01, /**< Connect the points with lines*/
LV_CHART_TYPE_COLUMN = 0x02, /**< Draw columns*/
LV_CHART_TYPE_SCATTER = 0x03, /**< X/Y chart, points and/or lines*/
};
typedef uint8_t lv_chart_type_t;
@@ -61,6 +60,15 @@ enum {
};
typedef uint8_t lv_chart_axis_t;
enum {
LV_CHART_CURSOR_NONE = 0x00,
LV_CHART_CURSOR_RIGHT = 0x01,
LV_CHART_CURSOR_UP = 0x02,
LV_CHART_CURSOR_LEFT = 0x04,
LV_CHART_CURSOR_DOWN = 0x08
};
typedef uint8_t lv_cursor_direction_t;
typedef struct {
lv_coord_t * points;
lv_color_t color;
@@ -69,6 +77,12 @@ typedef struct {
lv_chart_axis_t y_axis : 1;
} lv_chart_series_t;
typedef struct {
lv_point_t point;
lv_color_t color;
lv_cursor_direction_t axes : 4;
} lv_chart_cursor_t;
/** Data of axis */
enum {
LV_CHART_AXIS_SKIP_LAST_TICK = 0x00, /**< don't draw the last tick */
@@ -90,6 +104,7 @@ typedef struct {
/*No inherited ext*/ /*Ext. of ancestor*/
/*New data for this type */
lv_ll_t series_ll; /*Linked list for the data line pointers (stores lv_chart_series_t)*/
lv_ll_t cursors_ll; /*Linked list for the cursor pointers (stores lv_chart_cursor_t)*/
lv_coord_t ymin[_LV_CHART_AXIS_LAST]; /*y min values for both axis (used to scale the data)*/
lv_coord_t ymax[_LV_CHART_AXIS_LAST]; /*y max values for both axis (used to scale the data)*/
uint8_t hdiv_cnt; /*Number of horizontal division lines*/
@@ -97,6 +112,7 @@ typedef struct {
uint16_t point_cnt; /*Point number in a data line*/
lv_style_list_t style_series_bg;
lv_style_list_t style_series;
lv_style_list_t style_cursors;
lv_chart_type_t type; /*Line, column or point chart (from 'lv_chart_type_t')*/
lv_chart_axis_cfg_t y_axis;
lv_chart_axis_cfg_t x_axis;
@@ -108,7 +124,8 @@ typedef struct {
enum {
LV_CHART_PART_BG = LV_OBJ_PART_MAIN,
LV_CHART_PART_SERIES_BG = _LV_OBJ_PART_VIRTUAL_LAST,
LV_CHART_PART_SERIES
LV_CHART_PART_SERIES,
LV_CHART_PART_CURSOR
};
/**********************
@@ -136,6 +153,15 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy);
*/
lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color);
/**
* Add a cursor with a given color
* @param chart pointer to chart object
* @param color color of the cursor
* @param dir direction of the cursor. `LV_CHART_CURSOR_RIGHT/LEFT/TOP/DOWN`. OR-ed vaéues are possible
* @return pointer to the created cursor
*/
lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * chart, lv_color_t color, lv_cursor_direction_t dir);
/**
* Clear the point of a series
* @param chart pointer to a chart object
@@ -307,6 +333,16 @@ void lv_chart_set_point_id(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t
*/
void lv_chart_set_series_axis(lv_obj_t * chart, lv_chart_series_t * ser, lv_chart_axis_t axis);
/**
* Set the coordinate of the cursor with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object.
* @param cursor pointer to the cursor.
* @param point the new coordinate of cursor relative to the series area
*/
void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_point_t * point);
/*=====================
* Getter functions
*====================*/
@@ -349,6 +385,50 @@ lv_coord_t lv_chart_get_point_id(lv_obj_t * chart, lv_chart_series_t * ser, uint
*/
lv_chart_axis_t lv_chart_get_series_axis(lv_obj_t * chart, lv_chart_series_t * ser);
/**
* Get an individual point y value in the chart series directly based on index
* @param chart pointer to a chart object
* @param series_area pointer to an area variable that the result will put in.
*/
void lv_chart_get_series_area(lv_obj_t * chart, lv_area_t * series_area);
/**
* Get the coordinate of the cursor with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object
* @param cursor pointer to cursor
* @return coordinate of the cursor as lv_point_t
*/
lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor);
/**
* Get the nearest index to an X coordinate
* @param chart pointer to a chart object
* @param coord the coordination of the point relative to the series area.
* @return the found index
*/
uint16_t lv_chart_get_nearest_index_from_coord(lv_obj_t * chart, lv_coord_t x);
/**
* Get the x coordinate of the an index with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object
* @param ser pointer to series
* @param id the index.
* @return x coordinate of index
*/
lv_coord_t lv_chart_get_x_from_index(lv_obj_t * chart, lv_chart_series_t * ser, uint16_t id);
/**
* Get the y coordinate of the an index with respect
* to the origin of series area of the chart.
* @param chart pointer to a chart object
* @param ser pointer to series
* @param id the index.
* @return y coordinate of index
*/
lv_coord_t lv_chart_get_y_from_index(lv_obj_t * chart, lv_chart_series_t * ser, uint16_t id);
/*=====================
* Other functions
*====================*/

View File

@@ -566,25 +566,35 @@ static void lv_cont_layout_pretty(lv_obj_t * cont)
lv_coord_t new_pinner = (w_obj - w_row) / (obj_num - 1);
lv_coord_t act_x = pleft; /*x init*/
child_tmp = child_rs;
lv_align_t align;
int32_t inv;
if(lv_obj_get_base_dir(cont) == LV_BIDI_DIR_RTL) {
align = LV_ALIGN_IN_TOP_RIGHT;
inv = -1;
}
else {
align = LV_ALIGN_IN_TOP_LEFT;
inv = 1;
}
while(child_tmp != NULL) {
if(lv_obj_get_hidden(child_tmp) == false && lv_obj_is_protected(child_tmp, LV_PROTECT_POS) == false) {
lv_coord_t mleft = lv_obj_get_style_margin_left(child_tmp, LV_OBJ_PART_MAIN);
lv_coord_t mright = lv_obj_get_style_margin_right(child_tmp, LV_OBJ_PART_MAIN);
switch(type) {
case LV_LAYOUT_PRETTY_TOP:
lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT,
act_x + mleft,
lv_obj_align(child_tmp, cont, align,
inv * (act_x + mleft),
act_y + lv_obj_get_style_margin_top(child_tmp, LV_OBJ_PART_MAIN));
break;
case LV_LAYOUT_PRETTY_MID:
lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT,
act_x + mleft,
lv_obj_align(child_tmp, cont, align,
inv * (act_x + mleft),
act_y + (h_row - lv_obj_get_height(child_tmp)) / 2);
break;
case LV_LAYOUT_PRETTY_BOTTOM:
lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT,
act_x + mleft,
lv_obj_align(child_tmp, cont, align,
inv * (act_x + mleft),
act_y + h_row - lv_obj_get_height(child_tmp) - lv_obj_get_style_margin_bottom(child_tmp, LV_OBJ_PART_MAIN));
break;
default:

View File

@@ -18,6 +18,7 @@
#include "../lv_font/lv_symbol_def.h"
#include "../lv_misc/lv_anim.h"
#include "../lv_misc/lv_math.h"
#include "../lv_misc/lv_txt_ap.h"
#include <string.h>
/*********************
@@ -53,7 +54,7 @@ static void draw_box(lv_obj_t * ddlist, const lv_area_t * clip_area, uint16_t id
static void draw_box_label(lv_obj_t * ddlist, const lv_area_t * clip_area, uint16_t id, lv_state_t state);
static lv_res_t page_release_handler(lv_obj_t * page);
static void page_press_handler(lv_obj_t * page);
static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t x, lv_coord_t y);
static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t y);
static void position_to_selected(lv_obj_t * ddlist);
static lv_obj_t * get_label(const lv_obj_t * ddlist);
@@ -217,7 +218,12 @@ void lv_dropdown_set_options(lv_obj_t * ddlist, const char * options)
ext->sel_opt_id_orig = 0;
/*Allocate space for the new text*/
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
size_t len = strlen(options) + 1;
#else
size_t len = _lv_txt_ap_calc_bytes_cnt(options) + 1;
#endif
if(ext->options != NULL && ext->static_txt == 0) {
lv_mem_free(ext->options);
ext->options = NULL;
@@ -228,7 +234,11 @@ void lv_dropdown_set_options(lv_obj_t * ddlist, const char * options)
LV_ASSERT_MEM(ext->options);
if(ext->options == NULL) return;
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
strcpy(ext->options, options);
#else
_lv_txt_ap_proc(options, ext->options);
#endif
/*Now the text is dynamically allocated*/
ext->static_txt = 0;
@@ -1246,7 +1256,7 @@ static lv_res_t page_release_handler(lv_obj_t * page)
if(lv_indev_get_type(indev) == LV_INDEV_TYPE_POINTER || lv_indev_get_type(indev) == LV_INDEV_TYPE_BUTTON) {
lv_point_t p;
lv_indev_get_point(indev, &p);
ext->sel_opt_id = get_id_on_point(ddlist, p.x, p.y);
ext->sel_opt_id = get_id_on_point(ddlist, p.y);
ext->sel_opt_id_orig = ext->sel_opt_id;
}
@@ -1274,36 +1284,25 @@ static void page_press_handler(lv_obj_t * page)
if(indev && (lv_indev_get_type(indev) == LV_INDEV_TYPE_POINTER || lv_indev_get_type(indev) == LV_INDEV_TYPE_BUTTON)) {
lv_point_t p;
lv_indev_get_point(indev, &p);
ext->pr_opt_id = get_id_on_point(ddlist, p.x, p.y);
ext->pr_opt_id = get_id_on_point(ddlist, p.y);
lv_obj_invalidate(page);
}
}
static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t x, lv_coord_t y)
static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t y)
{
lv_obj_t * label = get_label(ddlist);
if(label == NULL) return 0;
x -= label->coords.x1;
y -= label->coords.y1;
uint32_t letter_i;
const char * txt = lv_label_get_text(label);
const lv_font_t * font = lv_obj_get_style_text_font(label, LV_LABEL_PART_MAIN);
lv_coord_t font_h = lv_font_get_line_height(font);
lv_style_int_t line_space = lv_obj_get_style_text_line_space(label, LV_LABEL_PART_MAIN);
lv_point_t p = {x, y};
letter_i = lv_label_get_letter_on(label, &p);
uint32_t letter_i_byte_pos = _lv_txt_encoded_get_byte_id(txt, letter_i);
uint16_t opt = 0;
uint32_t i = 0;
uint32_t i_prev = 0;
y += line_space / 2;
lv_coord_t h = font_h + line_space;
uint32_t letter_cnt = 0;
for(letter_cnt = 0; letter_cnt < letter_i; letter_cnt++) {
uint32_t letter = _lv_txt_encoded_next(txt, &i);
/*Count the lines to reach the clicked letter. But ignore the last '\n' because it
* still belongs to the clicked line*/
if(letter == '\n' && i_prev != letter_i_byte_pos) opt++;
i_prev = i;
}
uint16_t opt = y / h;
return opt;
}

View File

@@ -586,8 +586,15 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * clip_area)
uint8_t i;
lv_draw_line_dsc_t line_dsc;
lv_draw_line_dsc_init(&line_dsc);
lv_obj_init_draw_line_dsc(gauge, LV_GAUGE_PART_NEEDLE, &line_dsc);
lv_draw_img_dsc_t img_dsc;
if(ext->needle_img == NULL) {
lv_draw_line_dsc_init(&line_dsc);
lv_obj_init_draw_line_dsc(gauge, LV_GAUGE_PART_NEEDLE, &line_dsc);
}
else {
lv_draw_img_dsc_init(&img_dsc);
lv_obj_init_draw_img_dsc(gauge, LV_GAUGE_PART_NEEDLE, &img_dsc);
}
p_mid.x = x_ofs;
p_mid.y = y_ofs;
@@ -616,14 +623,10 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * clip_area)
a.y1 = gauge->coords.y1 + lv_area_get_height(&gauge->coords) / 2 - ext->needle_img_pivot.y;
a.x2 = a.x1 + info.w - 1;
a.y2 = a.y1 + info.h - 1;
lv_draw_img_dsc_t img_dsc;
lv_draw_img_dsc_init(&img_dsc);
lv_obj_init_draw_img_dsc(gauge, LV_GAUGE_PART_MAIN, &img_dsc);
img_dsc.pivot.x = ext->needle_img_pivot.x;
img_dsc.pivot.y = ext->needle_img_pivot.y;
if(ext->needle_colors != NULL)
img_dsc.recolor = ext->needle_colors[i];
if(ext->needle_colors != NULL) img_dsc.recolor = ext->needle_colors[i];
needle_angle = (needle_angle * 10);
if(needle_angle > 3600) needle_angle -= 3600;

View File

@@ -390,20 +390,20 @@ void lv_img_set_zoom(lv_obj_t * img, uint16_t zoom)
lv_coord_t h = lv_obj_get_height(img);
lv_area_t a;
_lv_img_buf_get_transformed_area(&a, w, h, transf_angle, (transf_zoom * ext->zoom) >> 8, &ext->pivot);
a.x1 += img->coords.x1;
a.y1 += img->coords.y1;
a.x2 += img->coords.x1;
a.y2 += img->coords.y1;
a.x1 += img->coords.x1 - 1;
a.y1 += img->coords.y1 - 1;
a.x2 += img->coords.x1 + 1;
a.y2 += img->coords.y1 + 1;
lv_obj_invalidate_area(img, &a);
ext->zoom = zoom;
lv_obj_refresh_ext_draw_pad(img);
_lv_img_buf_get_transformed_area(&a, w, h, transf_angle, (transf_zoom * ext->zoom) >> 8, &ext->pivot);
a.x1 += img->coords.x1;
a.y1 += img->coords.y1;
a.x2 += img->coords.x1;
a.y2 += img->coords.y1;
a.x1 += img->coords.x1 - 1;
a.y1 += img->coords.y1 - 1;
a.x2 += img->coords.x1 + 1;
a.y2 += img->coords.y1 + 1;
lv_obj_invalidate_area(img, &a);
}
@@ -706,10 +706,10 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
coords_tmp.y1 = zommed_coords.y1;
coords_tmp.y2 = zommed_coords.y1 + ext->h - 1;
for(; coords_tmp.y1 <= clip_real.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) {
for(; coords_tmp.y1 < zommed_coords.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) {
coords_tmp.x1 = zommed_coords.x1;
coords_tmp.x2 = zommed_coords.x1 + ext->w - 1;
for(; coords_tmp.x1 <= clip_real.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) {
for(; coords_tmp.x1 < zommed_coords.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) {
lv_draw_img(&coords_tmp, &clip_real, ext->src, &img_dsc);
}
}

View File

@@ -30,6 +30,7 @@
static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * clip_area, lv_design_mode_t mode);
static lv_res_t lv_imgbtn_signal(lv_obj_t * imgbtn, lv_signal_t sign, void * param);
static void refr_img(lv_obj_t * imgbtn);
static lv_btn_state_t suggest_state(lv_obj_t * imgbtn, lv_btn_state_t state);
/**********************
* STATIC VARIABLES
@@ -170,6 +171,26 @@ void lv_imgbtn_set_src_tiled(lv_obj_t * imgbtn, lv_btn_state_t state, const void
#endif
/**
* Set the state of the image button
* @param imgbtn pointer to an image button object
* @param state the new state of the button (from lv_btn_state_t enum)
*/
void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_btn_state_t state)
{
lv_btn_set_state(imgbtn, state);
refr_img(imgbtn);
}
/**
* Toggle the state of the image button (ON->OFF, OFF->ON)
* @param imgbtn pointer to a image button object
*/
void lv_imgbtn_toggle(lv_obj_t * imgbtn)
{
lv_btn_toggle(imgbtn);
refr_img(imgbtn);
}
/*=====================
* Getter functions
*====================*/
@@ -307,7 +328,7 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
/*Just draw an image*/
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
lv_btn_state_t state = suggest_state(imgbtn, lv_imgbtn_get_state(imgbtn));
/*Simply draw the middle src if no tiled*/
if(!ext->tiled) {
@@ -420,7 +441,6 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
draw_dsc.shadow_opa = LV_OPA_TRANSP;
lv_obj_init_draw_rect_dsc(imgbtn, LV_OBJ_PART_MAIN, &draw_dsc);
lv_area_t bg_coords;
lv_area_copy(&bg_coords, &imgbtn->coords);
bg_coords.x1 -= lv_obj_get_style_pad_left(imgbtn, LV_IMGBTN_PART_MAIN);
@@ -481,7 +501,7 @@ static lv_res_t lv_imgbtn_signal(lv_obj_t * imgbtn, lv_signal_t sign, void * par
static void refr_img(lv_obj_t * imgbtn)
{
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
lv_btn_state_t state = suggest_state(imgbtn, lv_imgbtn_get_state(imgbtn));
lv_img_header_t header;
const void * src = ext->img_src_mid[state];
@@ -511,4 +531,42 @@ static void refr_img(lv_obj_t * imgbtn)
lv_obj_invalidate(imgbtn);
}
/**
* If `src` is not defined for the current state try to get a state which is related to the curent but has `src`.
* E.g. if the PRESSED src is not set but the RELEASED does, use the RELEASED.
* @param imgbtn pointer to an image button
* @param state the state to convert
* @return the suggested state
*/
static lv_btn_state_t suggest_state(lv_obj_t * imgbtn, lv_btn_state_t state)
{
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
if(ext->img_src_mid[state] == NULL) {
switch(state) {
case LV_BTN_STATE_PRESSED:
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
break;
case LV_BTN_STATE_CHECKED_RELEASED:
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
break;
case LV_BTN_STATE_CHECKED_PRESSED:
if(ext->img_src_mid[LV_BTN_STATE_CHECKED_RELEASED]) return LV_BTN_STATE_CHECKED_RELEASED;
if(ext->img_src_mid[LV_BTN_STATE_PRESSED]) return LV_BTN_STATE_PRESSED;
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
break;
case LV_BTN_STATE_DISABLED:
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
break;
case LV_BTN_STATE_CHECKED_DISABLED:
if(ext->img_src_mid[LV_BTN_STATE_CHECKED_RELEASED]) return LV_BTN_STATE_CHECKED_RELEASED;
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
break;
default:
break;
}
}
return state;
}
#endif

View File

@@ -98,6 +98,19 @@ void lv_imgbtn_set_src_tiled(lv_obj_t * imgbtn, lv_btn_state_t state, const void
#endif
/**
* Set the state of the image button
* @param imgbtn pointer to an image button object
* @param state the new state of the button (from lv_btn_state_t enum)
*/
void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_btn_state_t state);
/**
* Toggle the state of the image button (ON->OFF, OFF->ON)
* @param imgbtn pointer to a image button object
*/
void lv_imgbtn_toggle(lv_obj_t * imgbtn);
/**
* Enable the toggled states. On release the button will change from/to toggled state.
* @param imgbtn pointer to an image button object
@@ -108,24 +121,6 @@ static inline void lv_imgbtn_set_checkable(lv_obj_t * imgbtn, bool tgl)
lv_btn_set_checkable(imgbtn, tgl);
}
/**
* Set the state of the image button
* @param imgbtn pointer to an image button object
* @param state the new state of the button (from lv_btn_state_t enum)
*/
static inline void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_btn_state_t state)
{
lv_btn_set_state(imgbtn, state);
}
/**
* Toggle the state of the image button (ON->OFF, OFF->ON)
* @param imgbtn pointer to a image button object
*/
static inline void lv_imgbtn_toggle(lv_obj_t * imgbtn)
{
lv_btn_toggle(imgbtn);
}
/*=====================
* Getter functions

View File

@@ -42,7 +42,6 @@
**********************/
static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param);
static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_area, lv_design_mode_t mode);
static void lv_label_refr_text(lv_obj_t * label);
static void lv_label_revert_dots(lv_obj_t * label);
#if LV_USE_ANIMATION
@@ -186,11 +185,8 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
/*If text is NULL then refresh */
if(text == NULL) {
lv_label_refr_text(label);
return;
}
/*If text is NULL then just refresh with the current text */
if(text == NULL) text = ext->text;
LV_ASSERT_STR(text);
@@ -271,50 +267,10 @@ void lv_label_set_text_fmt(lv_obj_t * label, const char * fmt, ...)
ext->text = NULL;
}
va_list ap, ap2;
va_start(ap, fmt);
va_copy(ap2, ap);
/*Allocate space for the new text by using trick from C99 standard section 7.19.6.12 */
uint32_t len = lv_vsnprintf(NULL, 0, fmt, ap);
va_end(ap);
#if LV_USE_ARABIC_PERSIAN_CHARS
/*Put together the text according to the format string*/
char * raw_txt = _lv_mem_buf_get(len + 1);
LV_ASSERT_MEM(raw_txt);
if(raw_txt == NULL) {
va_end(ap2);
return;
}
lv_vsnprintf(raw_txt, len + 1, fmt, ap2);
/*Get the size of the Arabic text and process it*/
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt);
ext->text = lv_mem_alloc(len_ap + 1);
LV_ASSERT_MEM(ext->text);
if(ext->text == NULL) {
va_end(ap2);
return;
}
_lv_txt_ap_proc(raw_txt, ext->text);
_lv_mem_buf_release(raw_txt);
#else
ext->text = lv_mem_alloc(len + 1);
LV_ASSERT_MEM(ext->text);
if(ext->text == NULL) {
va_end(ap2);
return;
}
ext->text[len - 1] = 0; /* Ensure NULL termination */
lv_vsnprintf(ext->text, len + 1, fmt, ap2);
#endif
va_end(ap2);
va_list args;
va_start(args, fmt);
ext->text = _lv_txt_set_text_vfmt(fmt, args);
va_end(args);
ext->static_txt = 0; /*Now the text is dynamically allocated*/
lv_label_refr_text(label);
@@ -1003,7 +959,7 @@ void lv_label_ins_text(lv_obj_t * label, uint32_t pos, const char * txt)
#else
_lv_txt_ins(ext->text, pos, txt);
#endif
lv_label_refr_text(label);
lv_label_set_text(label, NULL);
}
/**
@@ -1032,6 +988,241 @@ void lv_label_cut_text(lv_obj_t * label, uint32_t pos, uint32_t cnt)
lv_label_refr_text(label);
}
/**
* Refresh the label with its text stored in its extended data
* @param label pointer to a label object
*/
void lv_label_refr_text(lv_obj_t * label)
{
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
if(ext->text == NULL) return;
#if LV_LABEL_LONG_TXT_HINT
ext->hint.line_start = -1; /*The hint is invalid if the text changes*/
#endif
lv_area_t txt_coords;
get_txt_coords(label, &txt_coords);
lv_coord_t max_w = lv_area_get_width(&txt_coords);
const lv_font_t * font = lv_obj_get_style_text_font(label, LV_LABEL_PART_MAIN);
lv_style_int_t line_space = lv_obj_get_style_text_line_space(label, LV_LABEL_PART_MAIN);
lv_style_int_t letter_space = lv_obj_get_style_text_letter_space(label, LV_LABEL_PART_MAIN);
/*Calc. the height and longest line*/
lv_point_t size;
lv_txt_flag_t flag = LV_TXT_FLAG_NONE;
if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR;
if(ext->expand != 0) flag |= LV_TXT_FLAG_EXPAND;
if(ext->long_mode == LV_LABEL_LONG_EXPAND) flag |= LV_TXT_FLAG_FIT;
_lv_txt_get_size(&size, ext->text, font, letter_space, line_space, max_w, flag);
/*Set the full size in expand mode*/
if(ext->long_mode == LV_LABEL_LONG_EXPAND) {
size.x += lv_obj_get_style_pad_left(label, LV_LABEL_PART_MAIN) + lv_obj_get_style_pad_right(label, LV_LABEL_PART_MAIN);
size.y += lv_obj_get_style_pad_top(label, LV_LABEL_PART_MAIN) + lv_obj_get_style_pad_bottom(label, LV_LABEL_PART_MAIN);
lv_obj_set_size(label, size.x, size.y);
}
/*In roll mode keep the size but start offset animations*/
else if(ext->long_mode == LV_LABEL_LONG_SROLL) {
#if LV_USE_ANIMATION
lv_anim_t a;
lv_anim_init(&a);
lv_anim_set_var(&a, label);
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
lv_anim_set_playback_delay(&a, (((lv_font_get_glyph_width(font, ' ', ' ') + letter_space) * 1000) /
ext->anim_speed) *
LV_LABEL_WAIT_CHAR_COUNT);
lv_anim_set_repeat_delay(&a, a.playback_delay);
bool hor_anim = false;
if(size.x > lv_area_get_width(&txt_coords)) {
lv_anim_set_values(&a, 0, lv_area_get_width(&txt_coords) - size.x);
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_set_playback_time(&a, a.time);
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
int32_t act_time = 0;
bool playback_now = false;
if(anim_cur) {
act_time = anim_cur->act_time;
playback_now = anim_cur->playback_now;
}
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
if(playback_now) {
a.playback_now = 1;
/*Swap the start and end values*/
int32_t tmp;
tmp = a.start;
a.start = a.end;
a.end = tmp;
}
}
lv_anim_start(&a);
hor_anim = true;
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
ext->offset.x = 0;
}
if(size.y > lv_area_get_height(&txt_coords) && hor_anim == false) {
lv_anim_set_values(&a, 0, lv_area_get_height(&txt_coords) - size.y - (lv_font_get_line_height(font)));
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_set_playback_time(&a, a.time);
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
int32_t act_time = 0;
bool playback_now = false;
if(anim_cur) {
act_time = anim_cur->act_time;
playback_now = anim_cur->playback_now;
}
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
if(playback_now) {
a.playback_now = 1;
/*Swap the start and end values*/
int32_t tmp;
tmp = a.start;
a.start = a.end;
a.end = tmp;
}
}
lv_anim_start(&a);
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
ext->offset.y = 0;
}
#endif
}
/*In roll inf. mode keep the size but start offset animations*/
else if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) {
#if LV_USE_ANIMATION
lv_anim_t a;
lv_anim_init(&a);
lv_anim_set_var(&a, label);
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
bool hor_anim = false;
if(size.x > lv_area_get_width(&txt_coords)) {
lv_anim_set_values(&a, 0, -size.x - lv_font_get_glyph_width(font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT);
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
int32_t act_time = anim_cur ? anim_cur->act_time : 0;
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
}
lv_anim_start(&a);
hor_anim = true;
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
ext->offset.x = 0;
}
if(size.y > lv_area_get_height(&txt_coords) && hor_anim == false) {
lv_anim_set_values(&a, 0, -size.y - (lv_font_get_line_height(font)));
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
int32_t act_time = anim_cur ? anim_cur->act_time : 0;
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
}
lv_anim_start(&a);
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
ext->offset.y = 0;
}
#endif
}
else if(ext->long_mode == LV_LABEL_LONG_DOT) {
if(size.y <= lv_area_get_height(&txt_coords)) { /*No dots are required, the text is short enough*/
ext->dot_end = LV_LABEL_DOT_END_INV;
}
else if(_lv_txt_get_encoded_length(ext->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/
ext->dot_end = LV_LABEL_DOT_END_INV;
}
else {
lv_point_t p;
lv_coord_t y_overed;
p.x = lv_area_get_width(&txt_coords) -
(lv_font_get_glyph_width(font, '.', '.') + letter_space) *
LV_LABEL_DOT_NUM; /*Shrink with dots*/
p.y = lv_area_get_height(&txt_coords);
y_overed = p.y %
(lv_font_get_line_height(font) + line_space); /*Round down to the last line*/
if(y_overed >= lv_font_get_line_height(font)) {
p.y -= y_overed;
p.y += lv_font_get_line_height(font);
}
else {
p.y -= y_overed;
p.y -= line_space;
}
uint32_t letter_id = lv_label_get_letter_on(label, &p);
/*Be sure there is space for the dots*/
size_t txt_len = strlen(ext->text);
uint32_t byte_id = _lv_txt_encoded_get_byte_id(ext->text, letter_id);
while(byte_id + LV_LABEL_DOT_NUM > txt_len) {
_lv_txt_encoded_prev(ext->text, &byte_id);
letter_id--;
}
/*Save letters under the dots and replace them with dots*/
uint32_t byte_id_ori = byte_id;
uint32_t i;
uint8_t len = 0;
for(i = 0; i <= LV_LABEL_DOT_NUM; i++) {
len += _lv_txt_encoded_size(&ext->text[byte_id]);
_lv_txt_encoded_next(ext->text, &byte_id);
}
if(lv_label_set_dot_tmp(label, &ext->text[byte_id_ori], len)) {
for(i = 0; i < LV_LABEL_DOT_NUM; i++) {
ext->text[byte_id_ori + i] = '.';
}
ext->text[byte_id_ori + LV_LABEL_DOT_NUM] = '\0';
ext->dot_end = letter_id + LV_LABEL_DOT_NUM;
}
}
}
/*In break mode only the height can change*/
else if(ext->long_mode == LV_LABEL_LONG_BREAK) {
size.y += lv_obj_get_style_pad_top(label, LV_LABEL_PART_MAIN) + lv_obj_get_style_pad_bottom(label, LV_LABEL_PART_MAIN);
lv_obj_set_height(label, size.y);
}
/*Do not set the size in Clip mode*/
else if(ext->long_mode == LV_LABEL_LONG_CROP) {
/*Do nothing*/
}
lv_obj_invalidate(label);
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -1206,232 +1397,6 @@ static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param
return res;
}
/**
* Refresh the label with its text stored in its extended data
* @param label pointer to a label object
*/
static void lv_label_refr_text(lv_obj_t * label)
{
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
if(ext->text == NULL) return;
#if LV_LABEL_LONG_TXT_HINT
ext->hint.line_start = -1; /*The hint is invalid if the text changes*/
#endif
lv_area_t txt_coords;
get_txt_coords(label, &txt_coords);
lv_coord_t max_w = lv_area_get_width(&txt_coords);
const lv_font_t * font = lv_obj_get_style_text_font(label, LV_LABEL_PART_MAIN);
lv_style_int_t line_space = lv_obj_get_style_text_line_space(label, LV_LABEL_PART_MAIN);
lv_style_int_t letter_space = lv_obj_get_style_text_letter_space(label, LV_LABEL_PART_MAIN);
/*Calc. the height and longest line*/
lv_point_t size;
lv_txt_flag_t flag = LV_TXT_FLAG_NONE;
if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR;
if(ext->expand != 0) flag |= LV_TXT_FLAG_EXPAND;
if(ext->long_mode == LV_LABEL_LONG_EXPAND) flag |= LV_TXT_FLAG_FIT;
_lv_txt_get_size(&size, ext->text, font, letter_space, line_space, max_w, flag);
/*Set the full size in expand mode*/
if(ext->long_mode == LV_LABEL_LONG_EXPAND) {
size.x += lv_obj_get_style_pad_left(label, LV_LABEL_PART_MAIN) + lv_obj_get_style_pad_right(label, LV_LABEL_PART_MAIN);
size.y += lv_obj_get_style_pad_top(label, LV_LABEL_PART_MAIN) + lv_obj_get_style_pad_bottom(label, LV_LABEL_PART_MAIN);
lv_obj_set_size(label, size.x, size.y);
}
/*In roll mode keep the size but start offset animations*/
else if(ext->long_mode == LV_LABEL_LONG_SROLL) {
#if LV_USE_ANIMATION
lv_anim_t a;
lv_anim_init(&a);
lv_anim_set_var(&a, label);
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
lv_anim_set_playback_delay(&a, (((lv_font_get_glyph_width(font, ' ', ' ') + letter_space) * 1000) /
ext->anim_speed) *
LV_LABEL_WAIT_CHAR_COUNT);
lv_anim_set_repeat_delay(&a, a.playback_delay);
bool hor_anim = false;
if(size.x > lv_area_get_width(&txt_coords)) {
lv_anim_set_values(&a, 0, lv_area_get_width(&txt_coords) - size.x);
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_set_playback_time(&a, a.time);
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
int32_t act_time = 0;
bool playback_now = false;
if(anim_cur) {
act_time = anim_cur->act_time;
playback_now = anim_cur->playback_now;
}
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
if(playback_now) {
a.playback_now = 1;
/*Swap the start and end values*/
int32_t tmp;
tmp = a.start;
a.start = a.end;
a.end = tmp;
}
}
lv_anim_start(&a);
hor_anim = true;
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
ext->offset.x = 0;
}
if(size.y > lv_area_get_height(&txt_coords) && hor_anim == false) {
lv_anim_set_values(&a, 0, lv_area_get_height(&txt_coords) - size.y - (lv_font_get_line_height(font)));
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_set_playback_time(&a, a.time);
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
int32_t act_time = 0;
bool playback_now = false;
if(anim_cur) {
act_time = anim_cur->act_time;
playback_now = anim_cur->playback_now;
}
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
if(playback_now) {
a.playback_now = 1;
/*Swap the start and end values*/
int32_t tmp;
tmp = a.start;
a.start = a.end;
a.end = tmp;
}
}
lv_anim_start(&a);
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
ext->offset.y = 0;
}
#endif
}
/*In roll inf. mode keep the size but start offset animations*/
else if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) {
#if LV_USE_ANIMATION
lv_anim_t a;
lv_anim_init(&a);
lv_anim_set_var(&a, label);
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
bool hor_anim = false;
if(size.x > lv_area_get_width(&txt_coords)) {
lv_anim_set_values(&a, 0, -size.x - lv_font_get_glyph_width(font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT);
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
int32_t act_time = anim_cur ? anim_cur->act_time : 0;
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
}
lv_anim_start(&a);
hor_anim = true;
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x);
ext->offset.x = 0;
}
if(size.y > lv_area_get_height(&txt_coords) && hor_anim == false) {
lv_anim_set_values(&a, 0, -size.y - (lv_font_get_line_height(font)));
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
lv_anim_set_time(&a, lv_anim_speed_to_time(ext->anim_speed, a.start, a.end));
lv_anim_t * anim_cur = lv_anim_get(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
int32_t act_time = anim_cur ? anim_cur->act_time : 0;
if(act_time < a.time) {
a.act_time = act_time; /*To keep the old position*/
a.early_apply = 0;
}
lv_anim_start(&a);
}
else {
/*Delete the offset animation if not required*/
lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y);
ext->offset.y = 0;
}
#endif
}
else if(ext->long_mode == LV_LABEL_LONG_DOT) {
if(size.y <= lv_area_get_height(&txt_coords)) { /*No dots are required, the text is short enough*/
ext->dot_end = LV_LABEL_DOT_END_INV;
}
else if(_lv_txt_get_encoded_length(ext->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/
ext->dot_end = LV_LABEL_DOT_END_INV;
}
else {
lv_point_t p;
p.x = lv_area_get_width(&txt_coords) -
(lv_font_get_glyph_width(font, '.', '.') + letter_space) *
LV_LABEL_DOT_NUM; /*Shrink with dots*/
p.y = lv_area_get_height(&txt_coords);
p.y -= p.y %
(lv_font_get_line_height(font) + line_space); /*Round down to the last line*/
p.y -= line_space; /*Trim the last line space*/
uint32_t letter_id = lv_label_get_letter_on(label, &p);
/*Be sure there is space for the dots*/
size_t txt_len = strlen(ext->text);
uint32_t byte_id = _lv_txt_encoded_get_byte_id(ext->text, letter_id);
while(byte_id + LV_LABEL_DOT_NUM > txt_len) {
byte_id -= _lv_txt_encoded_size(&ext->text[byte_id]);
letter_id--;
}
/*Save letters under the dots and replace them with dots*/
uint32_t byte_id_ori = byte_id;
uint32_t i;
uint8_t len = 0;
for(i = 0; i <= LV_LABEL_DOT_NUM; i++) {
len += _lv_txt_encoded_size(&ext->text[byte_id]);
_lv_txt_encoded_next(ext->text, &byte_id);
}
if(lv_label_set_dot_tmp(label, &ext->text[byte_id_ori], len)) {
for(i = 0; i < LV_LABEL_DOT_NUM; i++) {
ext->text[byte_id_ori + i] = '.';
}
ext->text[byte_id_ori + LV_LABEL_DOT_NUM] = '\0';
ext->dot_end = letter_id + LV_LABEL_DOT_NUM;
}
}
}
/*In break mode only the height can change*/
else if(ext->long_mode == LV_LABEL_LONG_BREAK) {
size.y += lv_obj_get_style_pad_top(label, LV_LABEL_PART_MAIN) + lv_obj_get_style_pad_bottom(label, LV_LABEL_PART_MAIN);
lv_obj_set_height(label, size.y);
}
/*Do not set the size in Clip mode*/
else if(ext->long_mode == LV_LABEL_LONG_CROP) {
/*Do nothing*/
}
lv_obj_invalidate(label);
}
static void lv_label_revert_dots(lv_obj_t * label)
{
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);

View File

@@ -186,7 +186,6 @@ void lv_label_set_text_sel_start(lv_obj_t * label, uint32_t index);
* @param index index to set. `LV_LABEL_TXT_SEL_OFF` to select nothing.
*/
void lv_label_set_text_sel_end(lv_obj_t * label, uint32_t index);
/*=====================
* Getter functions
*====================*/
@@ -291,6 +290,12 @@ void lv_label_ins_text(lv_obj_t * label, uint32_t pos, const char * txt);
*/
void lv_label_cut_text(lv_obj_t * label, uint32_t pos, uint32_t cnt);
/**
* Refresh the label with its text stored in its extended data
* @param label pointer to a label object
*/
void lv_label_refr_text(lv_obj_t * label);
/**********************
* MACROS
**********************/

View File

@@ -131,83 +131,9 @@ void lv_linemeter_set_value(lv_obj_t * lmeter, int32_t value)
int16_t level_new =
(int32_t)((int32_t)(ext->cur_value - ext->min_value) * (ext->line_cnt - 1)) / (ext->max_value - ext->min_value);
if(level_new == level_old) {
return;
}
lv_style_int_t left = lv_obj_get_style_pad_left(lmeter, LV_LINEMETER_PART_MAIN);
lv_style_int_t right = lv_obj_get_style_pad_right(lmeter, LV_LINEMETER_PART_MAIN);
lv_style_int_t top = lv_obj_get_style_pad_top(lmeter, LV_LINEMETER_PART_MAIN);
lv_style_int_t bottom = lv_obj_get_style_pad_bottom(lmeter, LV_LINEMETER_PART_MAIN);
lv_coord_t r_out = (lv_obj_get_width(lmeter) - left - right) / 2 ;
lv_coord_t r_in = r_out - lv_obj_get_style_scale_width(lmeter, LV_LINEMETER_PART_MAIN);
if(r_in < 1) r_in = 1;
lv_coord_t x_ofs = lmeter->coords.x1 + r_out + left;
lv_coord_t y_ofs = lmeter->coords.y1 + r_out + top;
int16_t angle_ofs = ext->angle_ofs + 90 + (360 - ext->scale_angle) / 2;
lv_style_int_t line_width = lv_obj_get_style_scale_end_line_width(lmeter, LV_LINEMETER_PART_MAIN);
lv_style_int_t end_line_width = lv_obj_get_style_scale_end_line_width(lmeter, LV_LINEMETER_PART_MAIN);
line_width = LV_MATH_MAX(line_width, end_line_width);
int32_t angle_old = (level_old * ext->scale_angle) / (ext->line_cnt - 1);
/*Use smaller clip area only around the visible line*/
int32_t y_in_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
int32_t x_in_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
int32_t y_out_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
int32_t x_out_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
int32_t angle_new = (level_new * ext->scale_angle) / (ext->line_cnt - 1);
/*Use smaller clip area only around the visible line*/
int32_t y_in_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
int32_t x_in_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
int32_t y_out_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
int32_t x_out_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
lv_area_t a;
if(x_out_old < 0 && x_out_new < 0) {
a.x1 = lmeter->coords.x1 + left - line_width;
a.y1 = LV_MATH_MIN4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs - line_width;
a.x2 = LV_MATH_MAX(x_in_old, x_in_new) + x_ofs + line_width;
a.y2 = LV_MATH_MAX4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs + line_width;
}
else if(x_out_old > 0 && x_out_new > 0) {
a.x1 = LV_MATH_MIN(x_in_old, x_in_new) + x_ofs - line_width;
a.y1 = LV_MATH_MIN4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs - line_width;
a.x2 = lmeter->coords.x2 - right + line_width;
a.y2 = LV_MATH_MAX4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs + line_width;
}
else if(y_out_old < 0 && y_out_new < 0) {
a.x1 = LV_MATH_MIN4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs - line_width;
a.y1 = lmeter->coords.y1 + top - line_width;
a.x2 = LV_MATH_MAX4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs + line_width;
a.y2 = LV_MATH_MAX(y_in_old, y_in_new) + y_ofs + line_width;
}
else if(y_out_old > 0 && y_out_new > 0) {
a.x1 = LV_MATH_MIN4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs - line_width;
a.y1 = LV_MATH_MIN(y_in_old, y_in_new) + y_ofs - line_width;
a.x2 = LV_MATH_MAX4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs + line_width;
a.y2 = lmeter->coords.y2 - bottom + line_width;
}
else {
a.x1 = lmeter->coords.x1 + left - line_width;
a.y1 = lmeter->coords.y1 + top - line_width;
a.x2 = lmeter->coords.x2 - right + line_width;
a.y2 = lmeter->coords.y2 - bottom + line_width;
}
lv_obj_invalidate_area(lmeter, &a);
if(level_new == level_old) return;
lv_obj_invalidate(lmeter);
}
/**
@@ -521,7 +447,7 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin
p1.y = y_out_extra;
/* Set the color of the lines */
if((!ext->mirrored && i >= level) || (ext->mirrored && i <= level)) {
if((!ext->mirrored && i > level) || (ext->mirrored && i < level)) {
line_dsc.color = end_color;
line_dsc.width = end_line_width;
}

View File

@@ -250,10 +250,16 @@ bool lv_list_remove(const lv_obj_t * list, uint16_t index)
{
LV_ASSERT_OBJ(list, LV_OBJX_NAME);
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
uint16_t count = 0;
lv_obj_t * e = lv_list_get_next_btn(list, NULL);
while(e != NULL) {
if(count == index) {
#if LV_USE_GROUP
if(e == ext->last_sel_btn) ext->last_sel_btn = NULL;
#endif
if(e == ext->act_sel_btn) ext->act_sel_btn = NULL;
lv_obj_del(e);
return true;
}

View File

@@ -198,6 +198,38 @@ void lv_msgbox_set_text(lv_obj_t * mbox, const char * txt)
mbox_realign(mbox);
}
/**
* Set a formatted text for the message box
* @param mbox pointer to a message box
* @param fmt `printf`-like format
*/
void lv_msgbox_set_text_fmt(lv_obj_t * mbox, const char * fmt, ...)
{
LV_ASSERT_OBJ(mbox, LV_OBJX_NAME);
LV_ASSERT_STR(fmt);
lv_msgbox_ext_t * msgbox_ext = lv_obj_get_ext_attr(mbox);
lv_label_ext_t * label_ext = lv_obj_get_ext_attr(msgbox_ext->text);
/*If text is NULL then refresh */
if(fmt == NULL) {
lv_label_refr_text(msgbox_ext->text);
return;
}
if(label_ext->text != NULL) {
lv_mem_free(label_ext->text);
label_ext->text = NULL;
}
va_list args;
va_start(args, fmt);
label_ext->text = _lv_txt_set_text_vfmt(fmt, args);
va_end(args);
lv_label_refr_text(msgbox_ext->text);
mbox_realign(mbox);
}
/**
* Set animation duration
* @param mbox pointer to a message box object

View File

@@ -99,6 +99,13 @@ void lv_msgbox_add_btns(lv_obj_t * mbox, const char * btn_mapaction[]);
*/
void lv_msgbox_set_text(lv_obj_t * mbox, const char * txt);
/**
* Set a formatted text for the message box
* @param mbox pointer to a message box
* @param fmt `printf`-like format
*/
void lv_msgbox_set_text_fmt(lv_obj_t * mbox, const char * fmt, ...);
/**
* Set animation duration
* @param mbox pointer to a message box object

View File

@@ -9,7 +9,7 @@
* TEMPL -> object short name with upper case (e.g. BTN, LABEL etc.)
*
* You can remove the defined() clause from the #if statement below. This exists because
* LV_USE_TEMPL is not in lv_conf.h or lv_conf_templ.h by default.
* LV_USE_TEMPL is not in lv_conf.h or lv_conf_template.h by default.
*/
/*********************

View File

@@ -177,7 +177,7 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo
lv_label_set_text(label, options);
}
else {
ext->mode = LV_ROLLER_MODE_INIFINITE;
ext->mode = LV_ROLLER_MODE_INFINITE;
size_t opt_len = strlen(options) + 1; /*+1 to add '\n' after option lists*/
char * opt_extra = _lv_mem_buf_get(opt_len * LV_ROLLER_INF_PAGES);
@@ -238,7 +238,7 @@ void lv_roller_set_selected(lv_obj_t * roller, uint16_t sel_opt, lv_anim_enable_
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
/*In infinite mode interpret the new ID relative to the currently visible "page"*/
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
int32_t sel_opt_signed = sel_opt;
uint16_t page = ext->sel_opt_id / LV_ROLLER_INF_PAGES;
@@ -302,7 +302,7 @@ uint16_t lv_roller_get_selected(const lv_obj_t * roller)
LV_ASSERT_OBJ(roller, LV_OBJX_NAME);
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
uint16_t real_id_cnt = ext->option_cnt / LV_ROLLER_INF_PAGES;
return ext->sel_opt_id % real_id_cnt;
}
@@ -355,7 +355,7 @@ uint16_t lv_roller_get_option_cnt(const lv_obj_t * roller)
LV_ASSERT_OBJ(roller, LV_OBJX_NAME);
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
return ext->option_cnt / LV_ROLLER_INF_PAGES;
}
else {
@@ -1005,7 +1005,7 @@ static void inf_normalize(void * scrl)
lv_obj_t * roller = lv_obj_get_parent(roller_scrl);
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
uint16_t real_id_cnt = ext->option_cnt / LV_ROLLER_INF_PAGES;
ext->sel_opt_id = ext->sel_opt_id % real_id_cnt;
ext->sel_opt_id += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/

View File

@@ -37,7 +37,7 @@ extern "C" {
/** Roller mode. */
enum {
LV_ROLLER_MODE_NORMAL, /**< Normal mode (roller ends at the end of the options). */
LV_ROLLER_MODE_INIFINITE, /**< Infinite mode (roller can be scrolled forever). */
LV_ROLLER_MODE_INFINITE, /**< Infinite mode (roller can be scrolled forever). */
};
typedef uint8_t lv_roller_mode_t;

View File

@@ -81,6 +81,7 @@ lv_obj_t * lv_slider_create(lv_obj_t * par, const lv_obj_t * copy)
/*Initialize the allocated 'ext' */
ext->value_to_set = NULL;
ext->dragging = 0;
ext->left_knob_focus = 0;
lv_style_list_init(&ext->style_knob);
/*The signal and design functions are not copied so set them here*/
@@ -327,6 +328,8 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
}
}
else if(sign == LV_SIGNAL_PRESSING && ext->value_to_set != NULL) {
if(lv_indev_get_type(param) != LV_INDEV_TYPE_POINTER) return res;
lv_indev_get_point(param, &p);
lv_bidi_dir_t base_dir = lv_obj_get_base_dir(slider);
@@ -390,11 +393,25 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
bool editing = lv_group_get_editing(g);
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
if(indev_type == LV_INDEV_TYPE_ENCODER) {
if(editing) lv_group_set_editing(g, false);
if(editing) {
if(lv_slider_get_type(slider) == LV_SLIDER_TYPE_RANGE) {
if(ext->left_knob_focus == 0) ext->left_knob_focus = 1;
else {
ext->left_knob_focus = 0;
lv_group_set_editing(g, false);
}
}
else {
lv_group_set_editing(g, false);
}
}
}
#endif
}
else if(sign == LV_SIGNAL_FOCUS) {
ext->left_knob_focus = 0;
}
else if(sign == LV_SIGNAL_COORD_CHG) {
/* The knob size depends on slider size.
* During the drawing method the ext. size is used by the knob so refresh the ext. size.*/
@@ -425,12 +442,16 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
char c = *((char *)param);
if(c == LV_KEY_RIGHT || c == LV_KEY_UP) {
lv_slider_set_value(slider, lv_slider_get_value(slider) + 1, LV_ANIM_ON);
if(!ext->left_knob_focus) lv_slider_set_value(slider, lv_slider_get_value(slider) + 1, LV_ANIM_ON);
else lv_slider_set_left_value(slider, lv_slider_get_left_value(slider) + 1, LV_ANIM_ON);
res = lv_event_send(slider, LV_EVENT_VALUE_CHANGED, NULL);
if(res != LV_RES_OK) return res;
}
else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) {
lv_slider_set_value(slider, lv_slider_get_value(slider) - 1, LV_ANIM_ON);
if(!ext->left_knob_focus) lv_slider_set_value(slider, lv_slider_get_value(slider) - 1, LV_ANIM_ON);
else lv_slider_set_left_value(slider, lv_slider_get_left_value(slider) - 1, LV_ANIM_ON);
res = lv_event_send(slider, LV_EVENT_VALUE_CHANGED, NULL);
if(res != LV_RES_OK) return res;
}

View File

@@ -49,6 +49,7 @@ typedef struct {
lv_area_t right_knob_area;
int16_t * value_to_set; /* Which bar value to set */
uint8_t dragging : 1; /*1: the slider is being dragged*/
uint8_t left_knob_focus : 1; /*1: with encoder now the right knob can be adjusted*/
} lv_slider_ext_t;
/** Built-in styles of slider*/

View File

@@ -198,6 +198,8 @@ void lv_spinbox_set_step(lv_obj_t * spinbox, uint32_t step)
if(ext == NULL) return;
ext->step = step;
lv_spinbox_updatevalue(spinbox);
}
/**

View File

@@ -14,6 +14,7 @@
#include "../lv_misc/lv_txt.h"
#include "../lv_misc/lv_math.h"
#include "../lv_draw/lv_draw_label.h"
#include "../lv_misc/lv_printf.h"
#include "../lv_themes/lv_theme.h"
/*********************
@@ -169,11 +170,117 @@ void lv_table_set_cell_value(lv_obj_t * table, uint16_t row, uint16_t col, const
format.s.crop = 0;
}
#if LV_USE_ARABIC_PERSIAN_CHARS
/*Get the size of the Arabic text and process it*/
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(txt);
ext->cell_data[cell] = lv_mem_realloc(ext->cell_data[cell], len_ap + 1);
LV_ASSERT_MEM(ext->cell_data[cell]);
if(ext->cell_data[cell] == NULL) return;
_lv_txt_ap_proc(txt, &ext->cell_data[cell][1]);
#else
ext->cell_data[cell] = lv_mem_realloc(ext->cell_data[cell], strlen(txt) + 2); /*+1: trailing '\0; +1: format byte*/
LV_ASSERT_MEM(ext->cell_data[cell]);
if(ext->cell_data[cell] == NULL) return;
strcpy(ext->cell_data[cell] + 1, txt); /*+1 to skip the format byte*/
#endif
ext->cell_data[cell][0] = format.format_byte;
refr_size(table);
}
/**
* Set the value of a cell. Memory will be allocated to store the text by the table.
* @param table pointer to a Table object
* @param row id of the row [0 .. row_cnt -1]
* @param col id of the column [0 .. col_cnt -1]
* @param fmt `printf`-like format
*/
void lv_table_set_cell_value_fmt(lv_obj_t * table, uint16_t row, uint16_t col, const char * fmt, ...)
{
LV_ASSERT_OBJ(table, LV_OBJX_NAME);
LV_ASSERT_STR(fmt);
lv_table_ext_t * ext = lv_obj_get_ext_attr(table);
if(col >= ext->col_cnt) {
LV_LOG_WARN("lv_table_set_cell_value: invalid column");
return;
}
/*Auto expand*/
if(row >= ext->row_cnt) {
lv_table_set_row_cnt(table, row + 1);
}
uint32_t cell = row * ext->col_cnt + col;
lv_table_cell_format_t format;
/*Save the format byte*/
if(ext->cell_data[cell]) {
format.format_byte = ext->cell_data[cell][0];
}
/*Initialize the format byte*/
else {
lv_bidi_dir_t base_dir = lv_obj_get_base_dir(table);
if(base_dir == LV_BIDI_DIR_LTR) format.s.align = LV_LABEL_ALIGN_LEFT;
else if(base_dir == LV_BIDI_DIR_RTL) format.s.align = LV_LABEL_ALIGN_RIGHT;
else if(base_dir == LV_BIDI_DIR_AUTO)
#if LV_USE_BIDI
format.s.align = _lv_bidi_detect_base_dir(fmt);
#else
format.s.align = LV_LABEL_ALIGN_LEFT;
#endif
format.s.right_merge = 0;
format.s.type = 0;
format.s.crop = 0;
}
va_list ap, ap2;
va_start(ap, fmt);
va_copy(ap2, ap);
/*Allocate space for the new text by using trick from C99 standard section 7.19.6.12 */
uint32_t len = lv_vsnprintf(NULL, 0, fmt, ap);
va_end(ap);
#if LV_USE_ARABIC_PERSIAN_CHARS
/*Put together the text according to the format string*/
char * raw_txt = _lv_mem_buf_get(len + 1);
LV_ASSERT_MEM(raw_txt);
if(raw_txt == NULL) {
va_end(ap2);
return;
}
lv_vsnprintf(raw_txt, len + 1, fmt, ap2);
/*Get the size of the Arabic text and process it*/
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt);
ext->cell_data[cell] = lv_mem_realloc(ext->cell_data[cell], len_ap + 1);
LV_ASSERT_MEM(ext->cell_data[cell]);
if(ext->cell_data[cell] == NULL) {
va_end(ap2);
return;
}
_lv_txt_ap_proc(raw_txt, &ext->cell_data[cell][1]);
_lv_mem_buf_release(raw_txt);
#else
ext->cell_data[cell] = lv_mem_realloc(ext->cell_data[cell], len + 2); /*+1: trailing '\0; +1: format byte*/
LV_ASSERT_MEM(ext->cell_data[cell]);
if(ext->cell_data[cell] == NULL) {
va_end(ap2);
return;
}
ext->cell_data[cell][len + 1] = 0; /* Ensure NULL termination */
lv_vsnprintf(&ext->cell_data[cell][1], len + 1, fmt, ap2);
#endif
va_end(ap2);
ext->cell_data[cell][0] = format.format_byte;
refr_size(table);
@@ -360,6 +467,8 @@ void lv_table_set_cell_type(lv_obj_t * table, uint16_t row, uint16_t col, uint8_
ext->cell_data[cell][0] = format.format_byte;
ext->cell_types |= 1 << type;
lv_obj_invalidate(table);
}
/**
@@ -741,6 +850,8 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_
uint16_t row;
uint16_t cell = 0;
bool rtl = lv_obj_get_base_dir(table) == LV_BIDI_DIR_RTL ? true : false;
cell_area.y2 = table->coords.y1 + bg_top - 1;
for(row = 0; row < ext->row_cnt; row++) {
lv_coord_t h_row = ext->row_h[row];
@@ -750,7 +861,8 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_
if(cell_area.y1 > clip_area->y2) return LV_DESIGN_RES_OK;
cell_area.x2 = table->coords.x1 + bg_left - 1;
if(rtl) cell_area.x1 = table->coords.x2 - bg_right - 1;
else cell_area.x2 = table->coords.x1 + bg_left - 1;
for(col = 0; col < ext->col_cnt; col++) {
@@ -765,15 +877,22 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_
format.s.crop = 1;
}
cell_area.x1 = cell_area.x2 + 1;
cell_area.x2 = cell_area.x1 + ext->col_w[col] - 1;
if(rtl) {
cell_area.x2 = cell_area.x1 - 1;
cell_area.x1 = cell_area.x2 - ext->col_w[col] + 1;
}
else {
cell_area.x1 = cell_area.x2 + 1;
cell_area.x2 = cell_area.x1 + ext->col_w[col] - 1;
}
uint16_t col_merge = 0;
for(col_merge = 0; col_merge + col < ext->col_cnt - 1; col_merge++) {
if(ext->cell_data[cell + col_merge] != NULL) {
format.format_byte = ext->cell_data[cell + col_merge][0];
if(format.s.right_merge)
cell_area.x2 += ext->col_w[col + col_merge + 1];
if(rtl) cell_area.x1 -= ext->col_w[col + col_merge + 1];
else cell_area.x2 += ext->col_w[col + col_merge + 1];
else
break;
}
@@ -947,29 +1066,17 @@ static lv_style_list_t * lv_table_get_style(lv_obj_t * table, uint8_t part)
LV_ASSERT_OBJ(table, LV_OBJX_NAME);
lv_table_ext_t * ext = lv_obj_get_ext_attr(table);
lv_style_list_t * style_dsc_p;
switch(part) {
case LV_TABLE_PART_BG:
style_dsc_p = &table->style_list;
break;
case LV_TABLE_PART_CELL1:
style_dsc_p = &ext->cell_style[0];
break;
case LV_TABLE_PART_CELL2:
style_dsc_p = &ext->cell_style[1];
break;
case LV_TABLE_PART_CELL3:
style_dsc_p = &ext->cell_style[2];
break;
case LV_TABLE_PART_CELL4:
style_dsc_p = &ext->cell_style[3];
break;
default:
style_dsc_p = NULL;
/* Because of the presence of LV_TABLE_PART_BG, LV_TABLE_PART_CELL<i> has an integer value
of <i>. This comes in useful to extend above code with more cell types as follows */
if(part == LV_TABLE_PART_BG) {
return &table->style_list;
}
else if(part >= 1 && part <= LV_TABLE_CELL_STYLE_CNT) {
return &ext->cell_style[part - 1];
}
return style_dsc_p;
return NULL;
}
static void refr_size(lv_obj_t * table)

View File

@@ -32,7 +32,17 @@ extern "C" {
#define LV_TABLE_COL_MAX 12
#endif
#define LV_TABLE_CELL_STYLE_CNT 4
/*
Maximum allowable value of LV_TABLE_CELL_STYLE_CNT is 16
because of restriction of lv_table_cell_format_t.type to no more than
4 bits so that lv_table_cell_format_t.s will not exceed 8 bits
*/
#ifndef LV_TABLE_CELL_STYLE_CNT
# define LV_TABLE_CELL_STYLE_CNT 4
#endif
#if (LV_TABLE_CELL_STYLE_CNT > 16)
# error LV_TABLE_CELL_STYLE_CNT cannot exceed 16
#endif
/**********************
* TYPEDEFS
**********************/
@@ -46,7 +56,7 @@ typedef union {
struct {
uint8_t align : 2;
uint8_t right_merge : 1;
uint8_t type : 2;
uint8_t type : 4; // upto 16 values
uint8_t crop : 1;
} s;
uint8_t format_byte;
@@ -61,16 +71,18 @@ typedef struct {
lv_coord_t * row_h;
lv_style_list_t cell_style[LV_TABLE_CELL_STYLE_CNT];
lv_coord_t col_w[LV_TABLE_COL_MAX];
uint8_t cell_types : 4; /*Keep track which cell types exists to avoid dealing with unused ones*/
uint16_t cell_types :
LV_TABLE_CELL_STYLE_CNT; /*Keep track which cell types exists to avoid dealing with unused ones*/
} lv_table_ext_t;
/*Parts of the table*/
enum {
LV_TABLE_PART_BG,
LV_TABLE_PART_CELL1,
LV_TABLE_PART_CELL2,
LV_TABLE_PART_BG, /* Because of this member, LV_PART.*CELL1 has enum value of 1, */
LV_TABLE_PART_CELL1, /* LV_PART.*CELL2 has an enum value of 2 and so on upto the maximum */
LV_TABLE_PART_CELL2, /* number of styles specified by LV_TABLE_CELL_STYLE_CNT */
LV_TABLE_PART_CELL3,
LV_TABLE_PART_CELL4,
LV_TABLE_PART_CELL4, /* CELL 5-16 are not needed to be defined, the values in this enum
are there for backward compatibility */
};
/**********************
@@ -99,6 +111,15 @@ lv_obj_t * lv_table_create(lv_obj_t * par, const lv_obj_t * copy);
*/
void lv_table_set_cell_value(lv_obj_t * table, uint16_t row, uint16_t col, const char * txt);
/**
* Set the value of a cell. Memory will be allocated to store the text by the table.
* @param table pointer to a Table object
* @param row id of the row [0 .. row_cnt -1]
* @param col id of the column [0 .. col_cnt -1]
* @param fmt `printf`-like format
*/
void lv_table_set_cell_value_fmt(lv_obj_t * table, uint16_t row, uint16_t col, const char * fmt, ...);
/**
* Set the number of rows
* @param table table pointer to a Table object

View File

@@ -715,8 +715,9 @@ void lv_textarea_set_pwd_mode(lv_obj_t * ta, bool en)
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
if(ext->pwd_mode == en) return;
ext->pwd_mode = en == false ? 0 : 1;
/*Pwd mode is now enabled*/
if(ext->pwd_mode == 0 && en != false) {
if(en != false) {
char * txt = lv_label_get_text(ext->label);
size_t len = strlen(txt);
ext->pwd_tmp = lv_mem_alloc(len + 1);
@@ -730,15 +731,13 @@ void lv_textarea_set_pwd_mode(lv_obj_t * ta, bool en)
lv_textarea_clear_selection(ta);
}
/*Pwd mode is now disabled*/
else if(ext->pwd_mode == 1 && en == false) {
else {
lv_textarea_clear_selection(ta);
lv_label_set_text(ext->label, ext->pwd_tmp);
lv_mem_free(ext->pwd_tmp);
ext->pwd_tmp = NULL;
}
ext->pwd_mode = en == false ? 0 : 1;
refr_cursor_area(ta);
}

View File

@@ -172,8 +172,9 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
void lv_win_clean(lv_obj_t * win)
{
LV_ASSERT_OBJ(win, LV_OBJX_NAME);
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
lv_obj_t * scrl = lv_page_get_scrollable(win);
lv_obj_t * scrl = lv_page_get_scrollable(ext->page);
lv_obj_clean(scrl);
}

View File

@@ -7,12 +7,12 @@
* INCLUDES
*********************/
#include "lvgl/lvgl.h"
#include "../../lvgl.h"
#if LV_BUILD_TEST
#include "../lv_test_assert.h"
#include "lvgl/src/lv_font/lv_font_fmt_txt.h"
#include "lvgl/src/lv_font/lv_font.h"
#include "lvgl/src/lv_font/lv_font_loader.h"
#include "../src/lv_font/lv_font_fmt_txt.h"
#include "../src/lv_font/lv_font.h"
#include "../src/lv_font/lv_font_loader.h"
#include "lv_test_font_loader.h"

View File

@@ -1,4 +1,4 @@
#include "lvgl/lvgl.h"
#include "../../lvgl.h"
/*******************************************************************************
* Size: 8 px

View File

@@ -1,4 +1,4 @@
#include "lvgl/lvgl.h"
#include "../../lvgl.h"
/*******************************************************************************
* Size: 8 px

View File

@@ -1,4 +1,4 @@
#include "lvgl/lvgl.h"
#include "../../lvgl.h"
/*******************************************************************************
* Size: 20 px