Simplified the cc2530dk STARTUP_CONF_VERBOSE spaghetti and made it project-configurable

This commit is contained in:
George Oikonomou 2012-04-20 13:56:51 +01:00
parent 6fb48174ba
commit 4a78021c62
2 changed files with 9 additions and 13 deletions

View File

@ -24,7 +24,9 @@
#endif #endif
/* Verbose Startup? Turning this off saves plenty of bytes of CODE in HOME */ /* Verbose Startup? Turning this off saves plenty of bytes of CODE in HOME */
#ifndef STARTUP_CONF_VERBOSE
#define STARTUP_CONF_VERBOSE 0 #define STARTUP_CONF_VERBOSE 0
#endif
/* More CODE space savings by turning off process names */ /* More CODE space savings by turning off process names */
#define PROCESS_CONF_NO_PROCESS_NAMES 1 #define PROCESS_CONF_NO_PROCESS_NAMES 1

View File

@ -27,22 +27,16 @@
PROCESS_NAME(viztool_process); PROCESS_NAME(viztool_process);
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#ifdef STARTUP_CONF_VERBOSE #if STARTUP_CONF_VERBOSE
#define STARTUP_VERBOSE STARTUP_CONF_VERBOSE
#else
#define STARTUP_VERBOSE 0
#endif
#if STARTUP_VERBOSE
#define PUTSTRING(...) putstring(__VA_ARGS__) #define PUTSTRING(...) putstring(__VA_ARGS__)
#define PUTHEX(...) puthex(__VA_ARGS__) #define PUTHEX(...) puthex(__VA_ARGS__)
#define PUTBIN(...) putbin(__VA_ARGS__) #define PUTBIN(...) putbin(__VA_ARGS__)
#define PUTCHAR(...) putchar(__VA_ARGS__) #define PUTCHAR(...) putchar(__VA_ARGS__)
#else #else
#define PUTSTRING(...) do {} while(0) #define PUTSTRING(...)
#define PUTHEX(...) do {} while(0) #define PUTHEX(...)
#define PUTBIN(...) do {} while(0) #define PUTBIN(...)
#define PUTCHAR(...) do {} while(0) #define PUTCHAR(...)
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#if CLOCK_CONF_STACK_FRIENDLY #if CLOCK_CONF_STACK_FRIENDLY
@ -104,7 +98,7 @@ set_rime_addr(void)
} }
/* Now the address is stored MSB first */ /* Now the address is stored MSB first */
#if STARTUP_VERBOSE #if STARTUP_CONF_VERBOSE
PUTSTRING("Rime configured with address "); PUTSTRING("Rime configured with address ");
for(i = 0; i < RIMEADDR_SIZE - 1; i++) { for(i = 0; i < RIMEADDR_SIZE - 1; i++) {
PUTHEX(rimeaddr_node_addr.u8[i]); PUTHEX(rimeaddr_node_addr.u8[i]);
@ -185,7 +179,7 @@ main(void)
putstring("KB SRAM\n"); putstring("KB SRAM\n");
PUTSTRING("\nSDCC Build:\n"); PUTSTRING("\nSDCC Build:\n");
#if STARTUP_VERBOSE #if STARTUP_CONF_VERBOSE
#ifdef HAVE_SDCC_BANKING #ifdef HAVE_SDCC_BANKING
PUTSTRING(" With Banking.\n"); PUTSTRING(" With Banking.\n");
#endif /* HAVE_SDCC_BANKING */ #endif /* HAVE_SDCC_BANKING */