Contents ...
udn網路城邦
uboot add cmd
2016/02/16 15:13
瀏覽123
迴響0
推薦0
引用0

imx6_android_4_4_KK/bootable/bootloader/uboot-imx/include/configs/mx6q_sabresd_android.h
#define  CONFIG_CMD_HELLOWORD

imx6_android_4_4_KK/bootable/bootloader/uboot-imx/include/configs/mx6q_sabresd.h
imx6_android_4_4_KK/bootable/bootloader/uboot-imx/include/config_cmd_default.h

imx6_android_4_4_KK/bootable/bootloader/uboot-imx/common/cmd_helloword.c
#include
#include

#ifdef CONFIG_CMD_HELLOWORD
void helloword(void)
{
 printf("-----------------------------------------------Hello Word!\n");
}

U_BOOT_CMD(
 hello,
 1,
 2,
 helloword,
       "uboot hello word command ",
       "This is Usage field"
);
#endif

imx6_android_4_4_KK/bootable/bootloader/uboot-imx/common/Makefile
COBJS-$(CONFIG_CMD_HELLOWORD) += cmd_helloword.o

test:
help hello
hello

 

你可能會有興趣的文章:

限會員,要發表迴響,請先登入