diff --git a/src/dev/nuttx/lv_nuttx_entry.c b/src/dev/nuttx/lv_nuttx_entry.c index 50f86877f..4fda074b4 100644 --- a/src/dev/nuttx/lv_nuttx_entry.c +++ b/src/dev/nuttx/lv_nuttx_entry.c @@ -12,7 +12,7 @@ #include #include - +#include #include /********************* @@ -28,6 +28,7 @@ **********************/ static uint32_t millis(void); +static void syslog_print(lv_log_level_t level, const char * buf); /********************** * STATIC VARIABLES @@ -82,6 +83,9 @@ lv_display_t * lv_nuttx_init(lv_nuttx_t * info) { lv_display_t * disp = NULL; + lv_log_register_print_cb(syslog_print); + lv_tick_set_cb(millis); + #if !LV_USE_NUTTX_CUSTOM_INIT if(info && info->fb_path) { @@ -107,8 +111,6 @@ lv_display_t * lv_nuttx_init(lv_nuttx_t * info) disp = lv_nuttx_init_custom(info); #endif - lv_tick_set_cb(millis); - return disp; } @@ -126,4 +128,13 @@ static uint32_t millis(void) return tick; } +static void syslog_print(lv_log_level_t level, const char * buf) +{ + static const int priority[_LV_LOG_LEVEL_NUM] = { + LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT + }; + + syslog(priority[level], "[LVGL] %s", buf); +} + #endif /*LV_USE_NUTTX*/