From: arighi Date: Thu, 20 May 2010 13:26:43 +0000 (+0000) Subject: benchmark: do not build serial driver in context_switch if CONFIG_USE_HP_TIMER is... X-Git-Tag: 2.5.0~179 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=316505254b7c56603441d01182c5e71470f1a3ff;p=bertos.git benchmark: do not build serial driver in context_switch if CONFIG_USE_HP_TIMER is not enabled. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3738 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/benchmark/context_switch.c b/bertos/benchmark/context_switch.c index 5ab77159..12298892 100644 --- a/bertos/benchmark/context_switch.c +++ b/bertos/benchmark/context_switch.c @@ -47,7 +47,10 @@ #include #include +#if CONFIG_USE_HP_TIMER #include +static Serial out; +#endif #include @@ -57,8 +60,6 @@ static PROC_DEFINE_STACK(hp_stack, PROC_STACK_SIZE); static PROC_DEFINE_STACK(lp_stack, PROC_STACK_SIZE); static Process *hp_proc, *lp_proc, *main_proc; -static Serial out; - #if CONFIG_USE_HP_TIMER static hptime_t start, end; #endif @@ -101,8 +102,10 @@ void NORETURN context_switch(void) timer_init(); proc_init(); - ser_init(&out, CONFIG_CTX_DEBUG_PORT); - ser_setbaudrate(&out, CONFIG_CTX_DEBUG_BAUDRATE); + #if CONFIG_USE_HP_TIMER + ser_init(&out, CONFIG_CTX_DEBUG_PORT); + ser_setbaudrate(&out, CONFIG_CTX_DEBUG_BAUDRATE); + #endif #if CONFIG_USE_LED LED_INIT(); diff --git a/bertos/benchmark/context_switch.h b/bertos/benchmark/context_switch.h index e17921ae..350a5312 100644 --- a/bertos/benchmark/context_switch.h +++ b/bertos/benchmark/context_switch.h @@ -36,7 +36,7 @@ * \author Daniele Basiele * * $WIZ$ module_name = "context_switch" - * $WIZ$ module_depends = "kfile", "kern", "signal", "timer", "ser" + * $WIZ$ module_depends = "kfile", "kern", "signal", "timer" * $WIZ$ module_configuration = "bertos/cfg/cfg_context_switch.h" * $WIZ$ module_hw = "bertos/hw/hw_led.h" */ diff --git a/bertos/cfg/cfg_context_switch.h b/bertos/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/bertos/cfg/cfg_context_switch.h +++ b/bertos/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/bertos/gui/menu.h b/bertos/gui/menu.h index d5b516ae..9e6e58ad 100644 --- a/bertos/gui/menu.h +++ b/bertos/gui/menu.h @@ -37,7 +37,6 @@ * \brief Common menu handling API * * $WIZ$ module_name = "menu" - * $WIZ$ module_configuration = "bertos/cfg/cfg_menu.h" * $WIZ$ module_depends = "text", "gfx", "timer", "kbd" */ diff --git a/boards/arduino/examples/aprs/cfg/cfg_context_switch.h b/boards/arduino/examples/aprs/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/arduino/examples/aprs/cfg/cfg_context_switch.h +++ b/boards/arduino/examples/aprs/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/at91sam7x-ek/benchmark/context_switch/cfg/cfg_context_switch.h b/boards/at91sam7x-ek/benchmark/context_switch/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/at91sam7x-ek/benchmark/context_switch/cfg/cfg_context_switch.h +++ b/boards/at91sam7x-ek/benchmark/context_switch/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/at91sam7x-ek/benchmark/kernel_footprint/cfg/cfg_context_switch.h b/boards/at91sam7x-ek/benchmark/kernel_footprint/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/at91sam7x-ek/benchmark/kernel_footprint/cfg/cfg_context_switch.h +++ b/boards/at91sam7x-ek/benchmark/kernel_footprint/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/ek-lm3s1968/benchmark/context_switch/cfg/cfg_context_switch.h b/boards/ek-lm3s1968/benchmark/context_switch/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/ek-lm3s1968/benchmark/context_switch/cfg/cfg_context_switch.h +++ b/boards/ek-lm3s1968/benchmark/context_switch/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/ek-lm3s1968/benchmark/kernel_footprint/cfg/cfg_context_switch.h b/boards/ek-lm3s1968/benchmark/kernel_footprint/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/ek-lm3s1968/benchmark/kernel_footprint/cfg/cfg_context_switch.h +++ b/boards/ek-lm3s1968/benchmark/kernel_footprint/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/ek-lm3s1968/examples/gps/cfg/cfg_context_switch.h b/boards/ek-lm3s1968/examples/gps/cfg/cfg_context_switch.h index 46abc5d2..fe0b4f87 100644 --- a/boards/ek-lm3s1968/examples/gps/cfg/cfg_context_switch.h +++ b/boards/ek-lm3s1968/examples/gps/cfg/cfg_context_switch.h @@ -39,14 +39,23 @@ #define CFG_CONTEXT_SWITCH_H /** - * Use hp timer for the bechmark, otherwise it use - * one led. + * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 +/** + * Use board led for benchmark. + * + * $WIZ$ type = "boolean" + */ +#define CONFIG_USE_LED 1 + + /** * Debug console port. * $WIZ$ type = "int"; min = 0 diff --git a/boards/lpc-p2378/benchmark/context_switch/cfg/cfg_context_switch.h b/boards/lpc-p2378/benchmark/context_switch/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/lpc-p2378/benchmark/context_switch/cfg/cfg_context_switch.h +++ b/boards/lpc-p2378/benchmark/context_switch/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/lpc-p2378/benchmark/kernel_footprint/cfg/cfg_context_switch.h b/boards/lpc-p2378/benchmark/kernel_footprint/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/lpc-p2378/benchmark/kernel_footprint/cfg/cfg_context_switch.h +++ b/boards/lpc-p2378/benchmark/kernel_footprint/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/triface/benchmark/context_switch/cfg/cfg_context_switch.h b/boards/triface/benchmark/context_switch/cfg/cfg_context_switch.h index aebb221e..be15cf2f 100644 --- a/boards/triface/benchmark/context_switch/cfg/cfg_context_switch.h +++ b/boards/triface/benchmark/context_switch/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/triface/benchmark/kernel_footprint/cfg/cfg_context_switch.h b/boards/triface/benchmark/kernel_footprint/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/triface/benchmark/kernel_footprint/cfg/cfg_context_switch.h +++ b/boards/triface/benchmark/kernel_footprint/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1 diff --git a/boards/triface/examples/triface/cfg/cfg_context_switch.h b/boards/triface/examples/triface/cfg/cfg_context_switch.h index 05386929..fe0b4f87 100644 --- a/boards/triface/examples/triface/cfg/cfg_context_switch.h +++ b/boards/triface/examples/triface/cfg/cfg_context_switch.h @@ -42,6 +42,8 @@ * Use hp timer for the bechmark. * * $WIZ$ type = "boolean" + * $WIZ$ module= "boolean" + * $WIZ$ conditional_deps = "ser" */ #define CONFIG_USE_HP_TIMER 1