Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbcfd8a9

Browse files
Customize lv_conf.h
1 parent2ad6e7e commitbcfd8a9

File tree

1 file changed

+36
-29
lines changed

1 file changed

+36
-29
lines changed

‎lib/lv_conf.h‎

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#defineMICROPY_SDL 0
1515
#endif
1616
#ifndefMICROPY_FFMPEG
17-
#defineMICROPY_FFMPEG 0
17+
#defineMICROPY_FFMPEG 0 // works on unix/desktop but not on esp32 (conflicting time.h time_t in /home/user/sources/lvgl_micropython/lib/esp-idf/components/mbedtls/mbedtls/include/mbedtls/platform_time.h)
1818
#endif
1919
#ifndefMICROPY_RLOTTIE
2020
#defineMICROPY_RLOTTIE 0
@@ -23,10 +23,12 @@
2323
#defineMICROPY_TINY_TTF 0
2424
#endif
2525
#ifndefMICROPY_CACHE_SIZE
26-
#defineMICROPY_CACHE_SIZE 0
26+
//#define MICROPY_CACHE_SIZE 50 * 64 * 64 * 2 // 50 images of 64x64 pixels at 2 bytes per pixel
27+
//#define MICROPY_CACHE_SIZE 1320000 // one image of 1100x600 pixels at 2 bytes per pixel
28+
#defineMICROPY_CACHE_SIZE 2518040 // one image of 1058x595 pixels at 4 bytes per pixel
2729
#endif
2830
#ifndefMICROPY_COLOR_DEPTH
29-
#defineMICROPY_COLOR_DEPTH32
31+
#defineMICROPY_COLOR_DEPTH16
3032
#endif
3133
#ifndefMICROPY_FLOAT
3234
#defineMICROPY_FLOAT 0
@@ -216,7 +218,7 @@ extern void *mp_lv_roots;
216218
* The circumference of 1/4 circle are saved for anti-aliasing
217219
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
218220
* 0: to disable caching */
219-
#defineLV_DRAW_SW_CIRCLE_CACHE_SIZE4
221+
#defineLV_DRAW_SW_CIRCLE_CACHE_SIZE40
220222
#endif
221223

222224
#defineLV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
@@ -293,7 +295,7 @@ extern void *mp_lv_roots;
293295
*-----------*/
294296

295297
/*Enable the log module*/
296-
#defineLV_USE_LOG0
298+
#defineLV_USE_LOG1
297299
#ifLV_USE_LOG
298300

299301
/*How important log should be added:
@@ -303,11 +305,14 @@ extern void *mp_lv_roots;
303305
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
304306
*LV_LOG_LEVEL_USER Only logs added by the user
305307
*LV_LOG_LEVEL_NONE Do not log anything*/
306-
#defineLV_LOG_LEVEL LV_LOG_LEVEL_WARN
308+
// // 0 is trace, 1 is info, 2 is warn, 3 is error, 4 is user (FPS is here as 'sysmon' user)
309+
// trace is useful but logs a LOT for every screen draw...
310+
//#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
311+
#defineLV_LOG_LEVEL LV_LOG_LEVEL_INFO
307312

308313
/*1: Print the log with 'printf';
309314
*0: User need to register a callback with `lv_log_register_print_cb()`*/
310-
#defineLV_LOG_PRINTF 0
315+
#defineLV_LOG_PRINTF 0 // this doesn't seem to print anything to the serial port, so don't use it
311316

312317
/*Set callback to print the logs.
313318
*E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)`
@@ -344,12 +349,14 @@ extern void *mp_lv_roots;
344349
*If LV_USE_LOG is enabled an error message will be printed on failure*/
345350
#defineLV_USE_ASSERT_NULL 1/*Check if the parameter is NULL. (Very fast, recommended)*/
346351
#defineLV_USE_ASSERT_MALLOC 1/*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
347-
#defineLV_USE_ASSERT_STYLE0/*Check if the styles are properly initialized. (Very fast, recommended)*/
352+
#defineLV_USE_ASSERT_STYLE1/*Check if the styles are properly initialized. (Very fast, recommended)*/
348353
#defineLV_USE_ASSERT_MEM_INTEGRITY 0/*Check the integrity of `lv_mem` after critical operations. (Slow)*/
349354
#defineLV_USE_ASSERT_OBJ 0/*Check the object's type and existence (e.g. not deleted). (Slow)*/
350355

351356
/*Add a custom handler when assert happens e.g. to restart the MCU*/
352357
#defineLV_ASSERT_HANDLER_INCLUDE <stdint.h>
358+
///home/user/sources/lvgl_micropython/lib/lv_conf.h:353:27: error: implicit declaration of function 'printf' [-Werror=implicit-function-declaration]
359+
//#define LV_ASSERT_HANDLER printf("custom handler when assert happens e.g. to restart the MCU"); while(1); /*Halt by default*/
353360
#defineLV_ASSERT_HANDLER while(1);/*Halt by default*/
354361

355362
/*-------------
@@ -385,7 +392,7 @@ extern void *mp_lv_roots;
385392

386393
/*Default number of image header cache entries. The cache is used to store the headers of images
387394
*The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/
388-
#defineLV_IMAGE_HEADER_CACHE_DEF_CNT0
395+
#defineLV_IMAGE_HEADER_CACHE_DEF_CNT24
389396

390397
/*Number of stops allowed per gradient. Increase this to allow more stops.
391398
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
@@ -492,18 +499,18 @@ extern void *mp_lv_roots;
492499

493500
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
494501
*https://fonts.google.com/specimen/Montserrat*/
495-
#defineLV_FONT_MONTSERRAT_80
496-
#defineLV_FONT_MONTSERRAT_100
502+
#defineLV_FONT_MONTSERRAT_81
503+
#defineLV_FONT_MONTSERRAT_101
497504
#defineLV_FONT_MONTSERRAT_12 1
498505
#defineLV_FONT_MONTSERRAT_14 1
499506
#defineLV_FONT_MONTSERRAT_16 1
500-
#defineLV_FONT_MONTSERRAT_180
501-
#defineLV_FONT_MONTSERRAT_200
502-
#defineLV_FONT_MONTSERRAT_220
503-
#defineLV_FONT_MONTSERRAT_240
504-
#defineLV_FONT_MONTSERRAT_260
505-
#defineLV_FONT_MONTSERRAT_280
506-
#defineLV_FONT_MONTSERRAT_300
507+
#defineLV_FONT_MONTSERRAT_181
508+
#defineLV_FONT_MONTSERRAT_201
509+
#defineLV_FONT_MONTSERRAT_221
510+
#defineLV_FONT_MONTSERRAT_241
511+
#defineLV_FONT_MONTSERRAT_261
512+
#defineLV_FONT_MONTSERRAT_281
513+
#defineLV_FONT_MONTSERRAT_301
507514
#defineLV_FONT_MONTSERRAT_32 0
508515
#defineLV_FONT_MONTSERRAT_34 0
509516
#defineLV_FONT_MONTSERRAT_36 0
@@ -516,13 +523,13 @@ extern void *mp_lv_roots;
516523

517524
/*Demonstrate special features*/
518525
#defineLV_FONT_MONTSERRAT_28_COMPRESSED 0/*bpp = 3*/
519-
#defineLV_FONT_DEJAVU_16_PERSIAN_HEBREW0/*Hebrew, Arabic, Persian letters and all their forms*/
526+
#defineLV_FONT_DEJAVU_16_PERSIAN_HEBREW1/*Hebrew, Arabic, Persian letters and all their forms*/
520527
#defineLV_FONT_SIMSUN_14_CJK 0/*1000 most common CJK radicals*/
521528
#defineLV_FONT_SIMSUN_16_CJK 0/*1000 most common CJK radicals*/
522529

523530
/*Pixel perfect monospace fonts*/
524-
#defineLV_FONT_UNSCII_80
525-
#defineLV_FONT_UNSCII_160
531+
#defineLV_FONT_UNSCII_81
532+
#defineLV_FONT_UNSCII_161
526533

527534
/*Optionally declare custom fonts here.
528535
*You can use these fonts as default font too and they will be available globally.
@@ -606,7 +613,7 @@ extern void *mp_lv_roots;
606613

607614
#defineLV_USE_CALENDAR 1
608615
#ifLV_USE_CALENDAR
609-
#defineLV_CALENDAR_WEEK_STARTS_MONDAY0
616+
#defineLV_CALENDAR_WEEK_STARTS_MONDAY1
610617
#ifLV_CALENDAR_WEEK_STARTS_MONDAY
611618
#defineLV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
612619
#else
@@ -795,13 +802,13 @@ extern void *mp_lv_roots;
795802

796803
/* libjpeg-turbo decoder library.
797804
* Supports complete JPEG specifications and high-performance JPEG decoding. */
798-
#defineLV_USE_LIBJPEG_TURBO 0
805+
#defineLV_USE_LIBJPEG_TURBO 0 // needs LDFLAGS += -ljpeg in MicroPython's Makefile for this port. Only got it working on unix, not esp32 yet, needs libjpeg probably.
799806

800807
/*GIF decoder library*/
801808
#defineLV_USE_GIF 1
802809
#ifLV_USE_GIF
803810
/*GIF decoder accelerate*/
804-
#defineLV_GIF_CACHE_DECODE_DATA0
811+
#defineLV_GIF_CACHE_DECODE_DATA1
805812
#endif
806813

807814

@@ -869,19 +876,19 @@ extern void *mp_lv_roots;
869876
#defineLV_USE_SNAPSHOT 1
870877

871878
/*1: Enable system monitor component*/
872-
#defineLV_USE_SYSMON0
879+
#defineLV_USE_SYSMON1
873880
#ifLV_USE_SYSMON
874881
/*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/
875882
#defineLV_SYSMON_GET_IDLE lv_timer_get_idle
876883

877884
/*1: Show CPU usage and FPS count
878885
* Requires `LV_USE_SYSMON = 1`*/
879-
#defineLV_USE_PERF_MONITOR0
886+
#defineLV_USE_PERF_MONITOR1
880887
#ifLV_USE_PERF_MONITOR
881888
#defineLV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
882889

883890
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
884-
#defineLV_USE_PERF_MONITOR_LOG_MODE0
891+
#defineLV_USE_PERF_MONITOR_LOG_MODE1
885892
#endif
886893

887894
/*1: Show the used memory and the memory fragmentation
@@ -936,7 +943,7 @@ extern void *mp_lv_roots;
936943
#defineLV_IMGFONT_PATH_MAX_LEN 64
937944

938945
/*1: Use img cache to buffer header information*/
939-
#defineLV_IMGFONT_USE_IMAGE_CACHE_HEADER0
946+
#defineLV_IMGFONT_USE_IMAGE_CACHE_HEADER1
940947
#endif
941948

942949
/*1: Enable an observer pattern implementation*/
@@ -962,7 +969,7 @@ extern void *mp_lv_roots;
962969

963970
/*1: Enable file explorer*/
964971
/*Requires: lv_table*/
965-
#defineLV_USE_FILE_EXPLORER0
972+
#defineLV_USE_FILE_EXPLORER1
966973
#ifLV_USE_FILE_EXPLORER
967974
/*Maximum length of path*/
968975
#defineLV_FILE_EXPLORER_PATH_MAX_LEN (128)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp