From: Oleksij Rempel Date: Tue, 23 Apr 2013 20:11:50 +0000 (+0200) Subject: dbg: add new db_unknown_command function to reduce redundand code X-Git-Tag: 1.3.2~3^2~1 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8564cbf08ef61bd2fad82b48f0e7276744b44b1f;p=open-ath9k-htc-firmware.git dbg: add new db_unknown_command function to reduce redundand code Signed-off-by: Oleksij Rempel --- diff --git a/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c b/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c index 66b25a5..d6e96bb 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c +++ b/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c @@ -123,6 +123,11 @@ static void db_incorect_format(void) A_PRINTF("Error! Incorrect format.\n\r"); } +static void db_unknown_command(void) +{ + A_PRINTF("Error! Unknown command.\n\r"); +} + static void zf_debug_init(void) { uint8_t ch; @@ -823,11 +828,9 @@ static int db_cmd_sferase(char *cmd, char *param1, char *param2, char *param3) A_PRINTF("\n\r"); return 0; } - else - { - A_PRINTF("Error! Unknown command.\n\r"); - return -1; - } + + db_unknown_command(); + return -1; } /* Serial Flash -> Program */ @@ -865,7 +868,7 @@ static int db_cmd_sfru(char *cmd, char *param1, char *param2, char *param3) fast = 1; else { - A_PRINTF("Error! Unknown command.\n\r"); + db_unknown_command(); return -1; } @@ -908,7 +911,7 @@ static int db_cmd_sfrm(char *cmd, char *param1, char *param2, char *param3) fast = 1; else { - A_PRINTF("Error! Unknown command.\n\r"); + db_unknown_command(); return -1; }