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;
}
相关推荐
紫金修道20 小时前
【编解码】RK3588 平台基于 FFmpeg RKMPP 硬解的多路 RTSP 抓帧插件实战
ffmpeg·rkmpp
QMCY_jason1 天前
RK3588 交叉编译ffmpeg提示rockchip_mpp>=1.3.9 错误的问题
ffmpeg
Memory_荒年3 天前
FFmpeg:音视频界的“万能瑞士军刀”
ffmpeg
QJtDK1R5a3 天前
V4L2 vs GStreamer vs FFmpeg:Linux多媒体处理的三个层级
linux·运维·ffmpeg
AI视觉网奇6 天前
webrtc 硬编码
ffmpeg·webrtc
九转成圣6 天前
避坑指南:彻底解决 FFmpeg drawtext 烧录多行文本出现“方块(□)”乱码的终极方案
ffmpeg
bbq烤鸡6 天前
ffmpeg精确极速剪辑方案
ffmpeg
小镇学者6 天前
【python】 macos 安装ffmpeg 命令行工具
python·macos·ffmpeg
QMCY_jason6 天前
RK3588平台编译 ffmpeg-rockchip 使用rkmpp rkrga 进行硬件转码
ffmpeg
悢七7 天前
单机部署 OceanBase 集群
数据库·ffmpeg·oceanbase