这个就是rt-thread的自动初始化机制,设置了相应的函数名后,系统上电会自动将设置的函数名运行一遍
} INIT_DEVICE_EXPORT(drv_test_hw_init); 这些代码放到bsp/my_board/drivers/uart_drv.c中可以正常启动,也会有打印drv_test_hw_init; 放到另外一个c文件里面就报错,如图,从map里面看 drv_test_hw_init的地址0x8000b800 __rt_init_drv_test_hw_init的地址0x8008b460,而从报错信息看 8008b460对应的函数是...
RT-Thread Version master Hardware Type/Architectures bsp/cvitek Develop Toolchain GCC Describe the bug 不少驱动初始化都用了 INIT_BOARD_EXPORT,譬如 adc/i2c/pwm/spi/wdt, 这个感觉没有必要,建议改成 INIT_DEVICE_EXPORT Other additional context No response
1. **链接问题**:确保在编译主工程时,正确地链接了静态库。如果链接不正确,编译器可能无法找到静态库中的函数。 2. **初始化问题**:如果 INIT_DEVICE_EXPORT 函数是用于初始化设备或系统资源的,确保在主工程的适当位置调用这些函数。例如,在程序的 main 函数或某个初始化函数中调用它们。 3. **导出问题**:...
“board init functions”为所有通过 INIT_BOARD_EXPORT(fn)申明的初始化函数。 “pre-initialization functions”为所有通过 INIT_PREV_EXPORT(fn)申明的初始化函数。 “device init functions”为所有通过 INIT_DEVICE_EXPORT(fn)申明的初始化函数。 “components init functions”为所有通过 INIT_COMPONENT_EXPORT(fn...
#define INIT_BOARD_EXPORT(fn) INIT_EXPORT(fn, "1") #define INIT_CPU_EXPORT(fn) INIT_EXPORT(fn, "2") #define INIT_DEVICE_EXPORT(fn) INIT_EXPORT(fn, "3") #define INIT_COMPONENT_EXPORT(fn) INIT_EXPORT(fn, "4") #define INIT_FS_EXPORT(fn) INIT_EXPORT(fn, "5") ...
boot 当 /init.conf 加载完毕时= 当被设置为时device-added- 设备被添加时device-removed- 设备被移除时service-exited- 服务退出时 Service service就是要启动的本地服务进程service [ ]* Option option是service的修饰词,由它来指定何时并且如何启动Services程序,主要包括:critical 表示如果服务在4分钟内存在多于...
int do_device(int nargs, char **args); #define __MAKE_KEYWORD_ENUM__ //定义一个宏 /*定义KEYWORD宏,虽然有四个参数,但是这里只用第一个,其中K_##symbol中的## 表示链接的意思,即最后得到的值为K_symbol。Symbol就是init.rc中的关键字*/ ...
* path that the tick broadcast device expired * for us, we don't want to go deep idle as we * know that the IPI is going to arrive right * away */if(cpu_idle_force_poll||tick_check_broadcast_expired())cpu_idle_poll();elsecpuidle_idle_call();arch_cpu_idle_exit();}/* ...
);LogInit();// Make sure init log always output to /dev/kmsg.EnableDevKmsg();CreateDevice...