1
0
mirror of https://github.com/NevermindZZT/letter-shell.git synced 2025-01-01 09:58:41 +08:00

移除 命令结构体填充

This commit is contained in:
Letter 2023-05-27 08:23:01 +00:00
parent e9375840bd
commit 1725f88d1e
5 changed files with 2 additions and 43 deletions

View File

@ -181,7 +181,6 @@
| SHELL_DEFAULT_USER_PASSWORD | 默认用户密码 |
| SHELL_LOCK_TIMEOUT | shell自动锁定超时 |
| SHELL_USING_FUNC_SIGNATURE | 使用函数签名 |
| SHELL_COMMAND_FILL_BYTES | 命令结构体填充字节数 |
## 使用方式

View File

@ -73,14 +73,4 @@ unsigned int userGetTick();
*/
#define SHELL_USING_FUNC_SIGNATURE 1
/**
* @brief
* `SHELL_COMMAND_FILL_BYTES`
*
* 使 shell
* sizeof
* 使 shell
*/
#define SHELL_COMMAND_FILL_BYTES 24
#endif

View File

@ -28,9 +28,6 @@ typedef struct shell_command_cpp_cmd
#if SHELL_USING_FUNC_SIGNATURE == 1
const char *signature; /**< 函数签名 */
#endif
#if SHELL_COMMAND_FILL_BYTES != 0
char fill[SHELL_COMMAND_FILL_BYTES]; /**< 填充字节 */
#endif
} ShellCommandCppCmd;
/**
@ -45,9 +42,6 @@ typedef struct shell_command_cpp_var
#if SHELL_USING_FUNC_SIGNATURE == 1
void *unused; /**< 未使用成员,需要保持和 ShellCommandCppCmd 大小一致 */
#endif
#if SHELL_COMMAND_FILL_BYTES != 0
char fill[SHELL_COMMAND_FILL_BYTES]; /**< 填充字节 */
#endif
} ShellCommandCppVar;
/**
@ -62,9 +56,6 @@ typedef struct shell_command_cpp_user
#if SHELL_USING_FUNC_SIGNATURE == 1
void *unused; /**< 未使用成员,需要保持和 ShellCommandCppCmd 大小一致 */
#endif
#if SHELL_COMMAND_FILL_BYTES != 0
char fill[SHELL_COMMAND_FILL_BYTES]; /**< 填充字节 */
#endif
} ShellCommandCppUser;
/**
@ -79,9 +70,6 @@ typedef struct shell_command_cpp_key
#if SHELL_USING_FUNC_SIGNATURE == 1
void *unused; /**< 未使用成员,需要保持和 ShellCommandCppCmd 大小一致 */
#endif
#if SHELL_COMMAND_FILL_BYTES != 0
char fill[SHELL_COMMAND_FILL_BYTES]; /**< 填充字节 */
#endif
} ShellCommandCppKey;
#if SHELL_USING_FUNC_SIGNATURE == 1
@ -92,9 +80,6 @@ typedef struct shell_command_cpp_param_parser
int (*parser)(char *, void **);; /**< 解析函数 */
int (*cleaner)(void *); /**< 清理函数 */
void *unsed; /**< 未使用成员,需要保持和 ShellCommandCppCmd 大小一致 */
#if SHELL_COMMAND_FILL_BYTES != 0
char fill[SHELL_COMMAND_FILL_BYTES]; /**< 填充字节 */
#endif
} ShellCommandCppParamParser;
#endif

View File

@ -77,11 +77,11 @@
#ifndef SHELL_SECTION
#if defined(__CC_ARM) || defined(__CLANG_ARM)
#define SHELL_SECTION(x) __attribute__((section(x)))
#define SHELL_SECTION(x) __attribute__((section(x), aligned(1)))
#elif defined (__IAR_SYSTEMS_ICC__)
#define SHELL_SECTION(x) @ x
#elif defined(__GNUC__)
#define SHELL_SECTION(x) __attribute__((section(x)))
#define SHELL_SECTION(x) __attribute__((section(x), aligned(1)))
#else
#define SHELL_SECTION(x)
#endif
@ -503,9 +503,6 @@ typedef struct shell_command
} paramParser; /**< 参数解析器 */
#endif
} data;
#if SHELL_COMMAND_FILL_BYTES != 0
char fill[SHELL_COMMAND_FILL_BYTES]; /**< 填充字节 */
#endif
} ShellCommand;
/**

View File

@ -255,16 +255,4 @@
#define SHELL_USING_FUNC_SIGNATURE 0
#endif /** SHELL_USING_FUNC_SIGNATURE */
#ifndef SHELL_COMMAND_FILL_BYTES
/**
* @brief
* `SHELL_COMMAND_FILL_BYTES`
*
* 使 shell
* sizeof
* 使 shell
*/
#define SHELL_COMMAND_FILL_BYTES 0
#endif /** SHELL_COMMAND_FILL_BYTES */
#endif