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;
}
相关推荐
假装我不帅12 小时前
ffmpeg操作mp3去除封面信息
ffmpeg
封奚泽优2 天前
下载网页中的.m3u8视频文件
ffmpeg
Vertira2 天前
win10/10 下载并安装ffmpeg.exe 的官方详细方法 (已解决)
ffmpeg
xmRao2 天前
Qt+FFmpeg 实现音频重采样
qt·ffmpeg·音视频
Evonso3 天前
静态编译的ffmpeg用法
ffmpeg
_chirs5 天前
编译不依赖动态库的FFMPEG(麒麟国防 V10)
arm开发·ffmpeg
熊猫钓鱼>_>5 天前
从零到一:打造“抗造” Electron 录屏神器的故事
前端·javascript·ffmpeg·electron·node·录屏·record
UpYoung!5 天前
【格式转换工具】专业级多媒体格式转换解决方案——Freemake Video Converter 完全指南:轻量化视频剪辑媒体格式转换
ffmpeg·短视频·实用工具·开源工具·多媒体格式转换·运维必备·视频转换格式
试剂小课堂 Pro6 天前
Ald-PEG-Ald:丙醛与聚乙二醇两端连接的对称分子
java·c语言·c++·python·ffmpeg
MaoSource6 天前
Debian 12 安装 FFmpeg 命令
服务器·ffmpeg·debian