cmd-parser
cmd-parser copied to clipboard
IAR环境,GD32F30xC,cmd.h的相关代码需要写成以下,才可以通过编译。亲试有效。
#pragma section = "CMDS" /* MUST */
#define CMD_HASH 0xb433e5c6
#if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM Compiler */ #define SECTION(x) attribute((section(x))) #define CMD_USED attribute((used))
#elif defined (ICCARM) || defined(ICCRX) /* for IAR Compiler (Will Vaild in IAR ENV)*/ #define SECTION(x) @ x #define CMD_USED __root #else #error "not supported tool chain..." #endif