how the function like “fmu_main(int argc, char * argv[])” is called?
Maybe, It is called as a command in a script. But I can’t find it.
could you help me ?
how the function like “fmu_main(int argc, char * argv[])” is called?
Maybe, It is called as a command in a script. But I can’t find it.
could you help me ?
It’s started by script ROMFS/px4fmu_common/init.d/rcS. See http://dev.px4.io/advanced-system-startup.html
Thank you very much.
I found the code is used in a structure in the same file. Then I inference the structure and didn’t find the source which call the fmu_main() function.
I had found the rcs file, and I had known that the rcs script call other scripts in the same folder. However I don’t know the detailed process.
You can see the array of struct builtin_s g_builtins[]
. This is a map of the “module names” to the main functions. You could now grep for where this table is used e. g. somewhere in NuttX.
If the question is “how is a builtin function invoked using the NSH shell”,
perhaps this Eclipse screen capture will help. I’m happy to report that no “grep” was necessary, just a C++ symbol search starting with references to g_builtins:
Hehe, sure grep or search in your favorite text editor ;). Thanks for sharing!
O~~ I’ll find it. Thank you !~!~!~!~
I’m using the Qt Creator
The “find in files” is very fast after once operate “find”.
MAYBE the environment could be set up for compiling the code in Qt, though I haven’t finish it…