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;
}
相关推荐
≮傷£≯√19 小时前
图片合并成视频 img2video ffmpeg
ffmpeg·音视频
HY小宝F2 天前
树莓派 FFmpeg 实战笔记(二):命令行、源码编译与硬件编码的真相
学习·职场和发展·ffmpeg
qq_316837752 天前
uniapp + Vite + ffmpeg-wasm 0.12.x 集成示例
ffmpeg·uni-app·wasm
qingmiaozhuan2 天前
电脑录屏黑屏?只有声音没画面?从原理到排查一篇搞定
ffmpeg·电脑·音视频开发·录屏技术·电脑录屏
大鹅办公2 天前
酷狗音乐怎么转换MP3格式?4种方法亲测对比+避坑指南(附FFmpeg命令行教程)
ffmpeg·音视频·音频格式
工具派3 天前
记一次用在线工具压缩视频的过程(两档实测)
ffmpeg·视频压缩·crf
bu_shuo4 天前
使用ffmpeg快速截取一段视频
ffmpeg·音视频
天天进步20155 天前
Pixelle-Video 源码解析 #4:快速启动流程:uv、Streamlit、ffmpeg 分别负责什么?
ffmpeg·uv
Facechat5 天前
Seedance 2.0 + FFmpeg:我的「一句话出片」工具是怎么做出来的
ffmpeg·seedance
HY小宝F5 天前
从 APP 层打穿到传感器:树莓派 FFmpeg 底层学习笔记(一)V4L2/ALSA 踩坑与认知重构
笔记·学习·ffmpeg