Files

44 lines
902 B
C++
Raw Permalink Normal View History

2025-01-12 18:08:57 +01:00
#include "graphics/LVGL/LVGLGraphics.h"
2024-02-24 17:19:27 +01:00
#include "assert.h"
2025-01-12 18:08:57 +01:00
#include "util/ILog.h"
2024-02-24 17:19:27 +01:00
2024-05-09 12:33:56 +02:00
LVGLGraphics::LVGLGraphics(uint16_t width, uint16_t height) : screenWidth(width), screenHeight(height) {}
2024-02-24 17:19:27 +01:00
2024-03-08 11:45:41 +01:00
void LVGLGraphics::init(void)
{
2024-10-17 09:06:42 +02:00
ILOG_DEBUG("LV init...");
2024-05-09 12:33:56 +02:00
#if LV_USE_LOG
lv_log_register_print_cb(lv_debug);
2024-02-24 17:19:27 +01:00
#endif
2024-05-09 12:33:56 +02:00
lv_init();
2024-05-25 01:08:29 +02:00
#if LV_USE_LOG
lv_log_register_print_cb(lv_debug);
#endif
2024-02-24 17:19:27 +01:00
}
2024-03-19 21:08:28 +01:00
// debugging callback
2024-05-09 12:33:56 +02:00
void LVGLGraphics::lv_debug(lv_log_level_t level, const char *buf)
2024-03-08 11:45:41 +01:00
{
2024-05-09 12:33:56 +02:00
switch (level) {
case LV_LOG_LEVEL_TRACE: {
ILOG_DEBUG("%s", buf);
break;
}
case LV_LOG_LEVEL_INFO: {
ILOG_INFO("%s", buf);
break;
}
case LV_LOG_LEVEL_WARN: {
ILOG_WARN("%s", buf);
break;
}
case LV_LOG_LEVEL_ERROR: {
ILOG_ERROR("%s", buf);
break;
}
default:
ILOG_DEBUG("%s", buf);
break;
}
2024-02-24 17:19:27 +01:00
}