LVGL 驱动地址自动变更为32 位的问题

cpp 复制代码
lv_indev_t * kb = NULL;
lv_display_t * sdl_hal_init(int32_t w, int32_t h)
{

  lv_group_set_default(lv_group_create());

  lv_display_t * disp = lv_sdl_window_create(w, h);

  lv_indev_t * mouse = lv_sdl_mouse_create();
  lv_indev_set_group(mouse, lv_group_get_default());
  lv_indev_set_display(mouse, disp);
  lv_display_set_default(disp);
  /*Declare the image file.*/
  LV_IMAGE_DECLARE(mouse_cursor_icon);
  lv_obj_t * cursor_obj;
  /*Create an image object for the cursor */
  cursor_obj = lv_image_create(lv_screen_active());
  /*Set the image source*/
  lv_image_set_src(cursor_obj, &mouse_cursor_icon);
  /*Connect the image  object to the driver*/
  lv_indev_set_cursor(mouse, cursor_obj);

  // lv_indev_t * mousewheel = lv_sdl_mousewheel_create();
  // lv_indev_set_display(mousewheel, disp);
  // lv_indev_set_group(mousewheel, lv_group_get_default());

    kb = lv_sdl_keyboard_create();
  lv_indev_set_display(kb, disp);
  lv_indev_set_group(kb, lv_group_get_default());
    LV_LOG_WARN(" sdl_hal_init kb:%p \n",kb);
  return disp;
}

核心原因是 get_indev 是一个 static 函数。。。。

他获取到的地址会自动将 高32 截取掉, 仅保留低32 位地址。

因此 函数在使用的时候一定注意!!! 静态函数的使用范围!

cpp 复制代码
static lv_indev_t * get_indev(const lv_group_t * g)
{
    lv_indev_t * indev_guess = NULL;
    lv_indev_t * indev = lv_indev_get_next(NULL);

    while(indev) {
        lv_indev_type_t indev_type = lv_indev_get_type(indev);
        /*Prefer POINTER*/
        if(indev_type == LV_INDEV_TYPE_KEYPAD) return indev;
        if(lv_indev_get_group(indev) == g) {
            indev_guess = indev;
        }
        indev = lv_indev_get_next(indev);
    }

    return indev_guess;
}
相关推荐
happybasic1 小时前
在CMD下使用FFmpeg将.wav文件转换成指定的格式~
ffmpeg
shao9185165 小时前
第10章 Streaming(上):初级音频应用(1)——项目三:自建服务器的Mini-Omni实时语音聊天机器人
ffmpeg·whisper·asr·mini-omni·自建语音服务器
Leon_Chenl1 天前
【已开源】【嵌入式 Linux 音视频+ AI 实战项目】瑞芯微 Rockchip 系列 RK3588-基于深度学习的人脸门禁+ IPC 智能安防监控系统
深度学习·opencv·yolo·ffmpeg·音视频·边缘计算·人脸识别+检测
antzou1 天前
视频图片/文字水印
ffmpeg·视频水印·批量水印
AC赳赳老秦2 天前
DBA 专属方案:用 OpenClaw 实现 SQL 语句优化、慢查询分析、数据库备份巡检全自动化
服务器·前端·数据库·ffmpeg·自动化·deepseek·openclaw
小叮当⇔3 天前
M4A 转 MP3 桌面转换器(PyQt5 + FFmpeg)
开发语言·qt·ffmpeg
aovenus6 天前
FFmpeg 官网及文档
ffmpeg
aovenus6 天前
FFmpeg 工具介绍
ffmpeg
jr-create(•̀⌄•́)6 天前
简单视频编辑tools
python·ffmpeg
山栀shanzhi7 天前
在做直播时,I帧的间隔(GOP)一般是多少?
网络·c++·面试·ffmpeg