1.优化export。
This commit is contained in:
@@ -30,7 +30,7 @@ static struct
|
|||||||
} msh;
|
} msh;
|
||||||
|
|
||||||
#define MR_MSH_EXPORT(name, fn, help, level) \
|
#define MR_MSH_EXPORT(name, fn, help, level) \
|
||||||
MR_USED const struct mr_msh_cmd _mr_msh_cmd_##name MR_SECTION(".mr_msh_cmd."level) = {#name, fn, help};
|
MR_USED const struct mr_msh_cmd _mr_msh_cmd_##name MR_SECTION("mr_msh_cmd."level) = {#name, fn, help};
|
||||||
|
|
||||||
MR_MSH_EXPORT(start, MR_NULL, MR_NULL, "0");
|
MR_MSH_EXPORT(start, MR_NULL, MR_NULL, "0");
|
||||||
MR_MSH_EXPORT(end, MR_NULL, MR_NULL, "1.end");
|
MR_MSH_EXPORT(end, MR_NULL, MR_NULL, "1.end");
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ struct mr_msh_cmd
|
|||||||
* @param help The help information.
|
* @param help The help information.
|
||||||
*/
|
*/
|
||||||
#define MR_MSH_CMD_EXPORT(name, fn, help) \
|
#define MR_MSH_CMD_EXPORT(name, fn, help) \
|
||||||
MR_USED const struct mr_msh_cmd _mr_msh_cmd_##name MR_SECTION(".mr_msh_cmd.1") = {#name, fn, help};
|
MR_USED const struct mr_msh_cmd _mr_msh_cmd_##name MR_SECTION("mr_msh_cmd.1") = {#name, fn, help};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This macro function gets the argument at the specified index.
|
* @brief This macro function gets the argument at the specified index.
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ typedef int (*mr_init_fn_t)(void);
|
|||||||
* @brief Exports an auto initialization function with level.
|
* @brief Exports an auto initialization function with level.
|
||||||
*/
|
*/
|
||||||
#define _MR_INIT_EXPORT(fn, level) \
|
#define _MR_INIT_EXPORT(fn, level) \
|
||||||
MR_USED const mr_init_fn_t _mr_auto_init_##fn MR_SECTION(".mr_auto_init."level) = fn
|
MR_USED const mr_init_fn_t _mr_auto_init_##fn MR_SECTION("mr_auto_init."level) = fn
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Exports a board auto initialization function.
|
* @brief Exports a board auto initialization function.
|
||||||
|
|||||||
5
tool.py
5
tool.py
@@ -246,8 +246,9 @@ class Eclipse:
|
|||||||
link_config = """
|
link_config = """
|
||||||
/* mr-library */
|
/* mr-library */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
KEEP(*(SORT(.mr_auto_init*)))
|
KEEP(*(SORT(mr_auto_init.*)))
|
||||||
KEEP(*(SORT(.mr_msh_cmd.*)))
|
KEEP(*(SORT(mr_msh_cmd.*)))
|
||||||
|
. = ALIGN(4);
|
||||||
"""
|
"""
|
||||||
back = content[pos:]
|
back = content[pos:]
|
||||||
fw.write(front + link_config + back)
|
fw.write(front + link_config + back)
|
||||||
|
|||||||
Reference in New Issue
Block a user