diff options
author | Harald Welte <laforge@osmocom.org> | 2020-08-16 15:51:14 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-08-16 15:51:14 +0200 |
commit | 3907085239d997fb9054b6b597a187f8ba8735f6 (patch) | |
tree | 02a4e53fc04b43027560627b6cd8cab231040cfa /firmware/apps/dfu/main.c | |
parent | 9866c7373c1170cb18959664b656868dc15cd43c (diff) |
dfu: Save another 60 bytes by changing the way we print horizontal lines
Change-Id: I1660a04fb3e42200bc2fdd23aa114119620125a1
Diffstat (limited to 'firmware/apps/dfu/main.c')
-rw-r--r-- | firmware/apps/dfu/main.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index aa0adfd..f8c0c53 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -243,6 +243,17 @@ static void check_exec_dbg_cmd(void) //board_exec_dbg_cmd(ch); } +/* print a horizontal line of '=' characters; Doing this in a loop vs. using a 'const' + * string saves us ~60 bytes of executable size (matters particularly for DFU loader) */ +static void print_line(void) +{ + int i; + for (i = 0; i < 78; i++) + fputc('=', stdout); + fputc('\n', stdout); + fputc('\r', stdout); +} + /*------------------------------------------------------------------------------ * Main *------------------------------------------------------------------------------*/ @@ -267,12 +278,12 @@ extern int main(void) EEFC_ReadUniqueID(g_unique_id); - printf("\n\r\n\r" - "=============================================================================\n\r" - "DFU bootloader %s for board %s\n\r" - "(C) 2010-2017 by Harald Welte, 2018-2019 by Kevin Redon\n\r" - "=============================================================================\n\r", + printf("\n\r\n\r"); + print_line(); + printf("DFU bootloader %s for board %s\n\r" + "(C) 2010-2017 by Harald Welte, 2018-2019 by Kevin Redon\n\r", manifest_revision, manifest_board); + print_line(); #if (TRACE_LEVEL >= TRACE_LEVEL_INFO) TRACE_INFO("Chip ID: 0x%08lx (Ext 0x%08lx)\n\r", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID); |