APP_FEATURE_INIT 和 SYS_RUN区别?

基于鸿蒙设备开发,启动一个业务程序,最后使用APP_FEATURE_INIT(xxx)或SYS_RUN(xxx),效果貌似相同,请问这两个宏函数主要有哪些区别呢?

鸿蒙设备开发
Hi3861’
2021-09-23 16:26:47
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
红叶亦知秋
3

SYS_RUN是标识用于初始化和启动系统运行阶段的入口

APP_FEATURE_INIT标识用于初始化和启动应用层功能的入口

可以看一下源码中对于这两个函数的注解:

/**

 * @brief Identifies the entry for initializing and starting a system running phase by the

 * priority 2.

 *

 * This macro is used to identify the entry called at the priority 2 in the system startup

 * phase of the startup process. \n

 *

 * @param func Indicates the entry function for initializing and starting a system running phase.

 * The type is void (*)(void).

 */

#define SYS_RUN(func)

 

/**

 * @brief Identifies the entry for initializing and starting an application-layer feature by the

 * priority 2.

 *

 * This macro is used to identify the entry called at the priority 2 of the application-layer

 * feature phase of the startup process. \n

 *

 * @param func Indicates the entry function for initializing and starting an application-layer

 * feature. The type is void (*)(void).

 */

#define APP_FEATURE_INIT(func)
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.

答复引用于:华为开发者联盟开发者支持团队

分享
微博
QQ
微信
回复1
2021-09-27 15:11:25


相关问题
DevEco构建HapAPP有什么区别
17540浏览 • 1回复 待解决
关于HAP包的entryfeature类型
12755浏览 • 1回复 待解决
HarmonyOS customScan.init报错1000500001
609浏览 • 1回复 待解决
app级的oh_modulemodule下的有什么区别
1335浏览 • 1回复 待解决
多个xcompnent调用init时机
789浏览 • 1回复 待解决
执行 npm run codegen 报错
1090浏览 • 1回复 待解决
如何新增 Run/Debug Configurations
988浏览 • 1回复 待解决
参数不识别(ohpm run
1330浏览 • 1回复 待解决
HarmonyOS ArkTSTS区别
930浏览 • 1回复 待解决
wampserverapache的区别
3515浏览 • 1回复 待解决
多个feature模块的问题
2431浏览 • 1回复 待解决
HarmonyOS mediarawfile区别
677浏览 • 1回复 待解决