luat_easylvgl_conf.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * @file luat_easylvgl_conf.h
  3. * @summary EasyLVGL 平台相关配置
  4. * @description 根据不同的平台(SDL2、BK7258等)配置 LVGL 参数
  5. *
  6. * 注意:此文件会被 lv_conf.h 包含,用于覆盖默认配置
  7. */
  8. #ifndef LUAT_EASYLVGL_CONF_H
  9. #define LUAT_EASYLVGL_CONF_H
  10. /*=================
  11. * PLATFORM CONFIGURATION
  12. *=================*/
  13. // 打开png支持
  14. #define LV_USE_LODEPNG 1
  15. #if defined(LUAT_USE_EASYLVGL_SDL2)
  16. /* SDL2 平台配置 */
  17. #define LV_USE_OS LV_OS_NONE /* SDL2 平台可能不需要 OSAL */
  18. #define LV_USE_LOG 0
  19. #define LV_LOG_LEVEL LV_LOG_LEVEL_INFO
  20. // 打开png支持
  21. #define LV_USE_LODEPNG 1
  22. #define LV_MEM_SIZE (256 * 1024U)
  23. // 默认字体设置
  24. #define LV_FONT_FMT_TXT_LARGE 1
  25. #define LV_USE_FONT_COMPRESSED 1
  26. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_misans_20) LV_FONT_DECLARE(lv_font_misans_14)
  27. // #define LV_FONT_DEFAULT &lv_font_misans_20
  28. // #define LV_FONT_DEFAULT &lv_font_misans_14
  29. #elif defined(__BK72XX__)
  30. /* BK7258 平台配置:使用 FreeRTOS 以支持 LVGL 多线程渲染 */
  31. #define LV_USE_OS LV_OS_FREERTOS
  32. #define LV_DRAW_SW_DRAW_UNIT_CNT 2 // 开启2个软件渲染单元以并行绘制
  33. #define LV_USE_PARALLEL_DRAW_DEBUG 0 // 开启并行绘制调试
  34. #define LV_USE_LOG 1
  35. /** Set value to one of the following levels of logging detail:
  36. * - LV_LOG_LEVEL_TRACE Log detailed information.
  37. * - LV_LOG_LEVEL_INFO Log important events.
  38. * - LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem.
  39. * - LV_LOG_LEVEL_ERROR Log only critical issues, when system may fail.
  40. * - LV_LOG_LEVEL_USER Log only custom log messages added by the user.
  41. * - LV_LOG_LEVEL_NONE Do not log anything. */
  42. #define LV_LOG_LEVEL LV_LOG_LEVEL_INFO
  43. #define LV_MEM_SIZE (128 * 1024U)
  44. // 打开png支持
  45. #define LV_USE_LODEPNG 1
  46. #else
  47. /* 默认配置(如果未定义平台) */
  48. /* 使用 lv_conf.h 中的默认值,这里不需要重新定义 */
  49. #endif
  50. #endif /* LUAT_EASYLVGL_CONF_H */