diff options
| author | hathach <[email protected]> | 2014-03-14 11:59:39 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-03-14 11:59:39 +0700 |
| commit | 5e2ed2534ebc7576f028e09023bae923965c645e (patch) | |
| tree | 1f613ccf069bcdb02d65ec91f3d1bb428a205e70 /demos/host/src/cli.c | |
| parent | 214af7e9885f100d4f4d1882e9305899b6afc2b7 (diff) | |
clean up warning in lpcxpresso
remove -Wpacked -Wpadded in gcc
Diffstat (limited to 'demos/host/src/cli.c')
| -rw-r--r-- | demos/host/src/cli.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/demos/host/src/cli.c b/demos/host/src/cli.c index 1dd2aadd9..da3f2efb8 100644 --- a/demos/host/src/cli.c +++ b/demos/host/src/cli.c @@ -206,11 +206,11 @@ void cli_poll(char ch) //------------- Separate Command & Parameter -------------//
putchar('\n');
char* p_space = strchr(cli_buffer, ' ');
- uint32_t command_len = (p_space == NULL) ? strlen(cli_buffer) : (p_space - cli_buffer);
+ uint32_t command_len = (p_space == NULL) ? strlen(cli_buffer) : (uint32_t) (p_space - cli_buffer);
char* p_para = (p_space == NULL) ? (cli_buffer+command_len) : (p_space+1); // point to NULL-character or after space
//------------- Find entered command in lookup table & execute it -------------//
- uint32_t cmd_id;
+ uint8_t cmd_id;
for(cmd_id = CLI_CMDTYPE_COUNT - 1; cmd_id > CLI_CMDTYPE_unknown; cmd_id--)
{
if( 0 == strncmp(cli_buffer, cli_string_tbl[cmd_id], command_len) ) break;
@@ -230,8 +230,9 @@ void cli_poll(char ch) //--------------------------------------------------------------------+
// UNKNOWN Command
//--------------------------------------------------------------------+
-cli_error_t cli_cmd_unknown(char * para)
+cli_error_t cli_cmd_unknown(char * p_para)
{
+ (void) p_para;
puts("unknown command, please type \"help\" for list of supported commands");
return CLI_ERROR_NONE;
}
@@ -239,10 +240,12 @@ cli_error_t cli_cmd_unknown(char * para) //--------------------------------------------------------------------+
// HELP command
//--------------------------------------------------------------------+
-cli_error_t cli_cmd_help(char * para)
+cli_error_t cli_cmd_help(char * p_para)
{
+ (void) p_para;
+
puts("current supported commands are:");
- for(uint32_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
+ for(uint8_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
{
printf("%s\t%s\n", cli_string_tbl[cmd_id], cli_description_tbl[cmd_id]);
}
@@ -255,6 +258,7 @@ cli_error_t cli_cmd_help(char * para) //--------------------------------------------------------------------+
cli_error_t cli_cmd_clear(char* p_para)
{
+ (void) p_para;
printf(ANSI_ERASE_SCREEN(2) ANSI_CURSOR_POSITION(1,1) );
return CLI_ERROR_NONE;
}
|
