Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

嵌入式Linux运行官方的demoui可以进入函数main_loop_init,运行部署的项目却无法进入函数main_loop_init #104

Open
zyafly opened this issue Jul 25, 2023 · 5 comments

Comments

@zyafly
Copy link

zyafly commented Jul 25, 2023

我用的是Ubuntu18.04,平台是全志R528-s3

1.在“awtk-linux-fb/awtk-port/main_loop_linux.c”加入以下打印信息:

  main_loop_t* main_loop_init(int w, int h) {
  main_loop_simple_t* loop = NULL;

log_debug("\n++++++++++12213132132313+++++++\n");
#ifdef WITH_LINUX_EGL
  lcd_egl_context_t* lcd = lcd_linux_egl_create(FB_DEVICE_FILENAME);
#elif WITH_LINUX_DRM
  lcd_t* lcd = lcd_linux_drm_create(DRM_DEVICE_FILENAME);
#else
  lcd_t* lcd = lcd_linux_fb_create(FB_DEVICE_FILENAME);
#endif

  return_value_if_fail(lcd != NULL, NULL);

#ifdef WITH_LINUX_EGL
#else
  native_window_raw_init(lcd);
#endif

  loop = main_loop_simple_init(lcd->w, lcd->h, NULL, NULL);
  loop->base.destroy = main_loop_linux_destroy;

#ifdef HAS_TSLIB

  s_ts_thread =
      tslib_thread_run(TS_DEVICE_FILENAME, input_dispatch_to_main_loop, loop, lcd->w, lcd->h);
#endif /*HAS_TSLIB*/
log_debug("\n+++++++++++++++++\n");
  s_kb_thread =
      input_thread_run(KB_DEVICE_FILENAME, input_dispatch_to_main_loop, loop, lcd->w, lcd->h);
  s_mice_thread =
      mouse_thread_run(MICE_DEVICE_FILENAME, input_dispatch_to_main_loop, loop, lcd->w, lcd->h);
log_debug("\n---------------------------\n");


  atexit(on_app_exit);

  return (main_loop_t*)loop;
}

2.按移植流程,在“awtk-linux-fb”文件夹中执行“scons”->"sh ./release.sh"->拷到开发板解压->运行"./release/bin/demoui",可以打印以下信息

++++++++++12213132132313+++++++
fb_info_t: /dev/fb0
xres=320 yres=480
xres_virtual=320 yres_virtual=960
bits_per_pixel=32 line_length=1280
fb_info_t: red(16 8) green(8 8) blue(0 8)
xpanstep=1 ywrapstep=0
fb_size=614400 fb_total_size=1228800 fb_nr=2 smem_len=1228800
fb_open clear
fb_open ok
sh: dmidecode: not found
=========fb_number=2
ratio=1.000000 320 480
ratio=1.000000 320 480

+++++++++++++++++
tslib_run:116: open tslib successful, filename=/dev/input/event2
input_run:313: open keyboard successful, fd=7, filename=/dev/input/event1

---------------------------

3.我编译自己的项目,在“awtk-linux-fb”文件夹中执行“scons APP=../user_apps/awtkdemo2”->"./release.sh ../user_apps/awtkdemo2/res demo"->拷到开发板解压->运行"./release/bin/demo",可以打印以下信息

fb_open clear
fb_open ok
sh: dmidecode: not found
=========fb_number=2
ratio=1.000000 320 480
ratio=1.000000 320 480
input_run:313: open keyboard successful, fd=5, filename=/dev/input/event1
input_run:255: open mouse failed, fd=-1, filename=
Build at: Jul 24 2023 17:30:22
fps=30.000000 duration=2.500000 w=1024 h=1024 n=76
window home_page open

请问是我哪里搞错了吗?

@xianjimli
Copy link
Member

把代码贴上来看看。

@zyafly
Copy link
Author

zyafly commented Jul 25, 2023

把代码贴上来看看。

我看了官方例程根目录下的“SConstruct”,代码如下
`import os
import scripts.app_helper as app

ARGUMENTS['SHARED'] = 'False'
ARGUMENTS['IDL_DEF'] = 'False'
helper = app.Helper(ARGUMENTS)
helper.call(DefaultEnvironment)

SConscriptFiles = ['src/SConscript']
SConscript(SConscriptFiles)`

ARGUMENTS['SHARED'] = 'False' ARGUMENTS['IDL_DEF'] = 'False'贴到我部署项目的“SConstruct”,代码如下:

`import os
import scripts.app_helper as app

ARGUMENTS['SHARED'] = 'False'
ARGUMENTS['IDL_DEF'] = 'False'

CUSTOM_WIDGET_LIBS = [{
"root" : '3rd/awtk-widget-rlottie-main',
'shared_libs': ['rlottie'],
'static_libs': []
},
{
"root" : '3rd/awtk-widget-table-view',
'shared_libs': ['table_view'],
'static_libs': []
}]

DEPENDS_LIBS = CUSTOM_WIDGET_LIBS + []

helper = app.Helper(ARGUMENTS)
helper.set_deps(DEPENDS_LIBS)

app.prepare_depends_libs(ARGUMENTS, helper, DEPENDS_LIBS)
helper.call(DefaultEnvironment)

SConscriptFiles = ['src/SConscript', 'tests/SConscript']
helper.SConscript(SConscriptFiles)`

之后就正常了,我请问一下,这脚本“SConstruct”中这些是什么意思?

@xianjimli
Copy link
Member

你最好用designer创建项目,不需要了解这些东西。

@zyafly
Copy link
Author

zyafly commented Jul 25, 2023

你最好用designer创建项目,不需要了解这些东西。

使用designer创建的项目放到Ubuntu编译,就会出现上述说的问题,已经试过了全志R528和sigmastart 的ssd201,均需要修改SConstruct脚本文件

@xianjimli
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants