benchmark: do not build serial driver in context_switch if CONFIG_USE_HP_TIMER is...
[bertos.git] / bertos / benchmark / context_switch.c
index 5ab77159d472cdc1b68db352e696c579d1d6314c..12298892a9c9bfebd15724ded8674b52d65e149f 100644 (file)
 #include <cpu/power.h>
 
 #include <drv/timer.h>
+#if CONFIG_USE_HP_TIMER
 #include <drv/ser.h>
+static Serial out;
+#endif
 
 #include <kern/proc.h>
 
@@ -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();