FreeCalypso > hg > freecalypso-sw
changeset 729:acc31840d51c
mm_tim.c compiles
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sat, 04 Oct 2014 23:29:33 +0000 |
parents | 832e5506c598 |
children | af82698f039e |
files | gsm-fw/g23m-gsm/mm/Makefile gsm-fw/g23m-gsm/mm/mm_tim.c |
diffstat | 2 files changed, 53 insertions(+), 49 deletions(-) [+] |
line wrap: on
line diff
--- a/gsm-fw/g23m-gsm/mm/Makefile Sat Oct 04 22:51:36 2014 +0000 +++ b/gsm-fw/g23m-gsm/mm/Makefile Sat Oct 04 23:29:33 2014 +0000 @@ -6,7 +6,7 @@ -I../../cdginc OBJS= mm_csf.o mm_em.o mm_forf.o mm_forp.o mm_fors.o mm_mmf.o mm_mmp.o \ - mm_mms.o mm_pei.o mm_regf.o mm_regp.o mm_regs.o + mm_mms.o mm_pei.o mm_regf.o mm_regp.o mm_regs.o mm_tim.o all: ${OBJS}
--- a/gsm-fw/g23m-gsm/mm/mm_tim.c Sat Oct 04 22:51:36 2014 +0000 +++ b/gsm-fw/g23m-gsm/mm/mm_tim.c Sat Oct 04 23:29:33 2014 +0000 @@ -22,6 +22,10 @@ #ifndef MM_TIM_C #define MM_TIM_C +#include "config.h" +#include "fixedconf.h" +#include "condat-features.h" + #define ENTITY_MM /*==== INCLUDES ===================================================*/ @@ -214,19 +218,19 @@ if (index < NUM_OF_MM_TIMERS) { -/* Implements Measure#36 */ -#if defined(NCONFIG) + /* Implements Measure#36 */ + #if defined(NCONFIG) /* partab is not defined when NCONFIG is defined */ - TRACE_EVENT_P1 ("tim_stop_timer: index (%d)", index); -#else /* not (NCONFIG) */ -#if defined (TRACE_PRIM) AND defined(OPTION_TIMER) - TRACE_EVENT_P1 ("tim_stop_timer (%s)", partab[index].keyword); -#endif -#endif /* NCONFIG */ - - mm_data->t_running[index] = FALSE; - TIMER_STOP (mm_handle, index); -} + TRACE_EVENT_P1 ("tim_stop_timer: index (%d)", index); + #else /* not (NCONFIG) */ + #if defined (TRACE_PRIM) AND defined(OPTION_TIMER) + TRACE_EVENT_P1 ("tim_stop_timer (%s)", partab[index].keyword); + #endif + #endif /* NCONFIG */ + + mm_data->t_running[index] = FALSE; + TIMER_STOP (mm_handle, index); + } else { TRACE_ERROR ("tim_stop_timer(): index out of range"); @@ -250,48 +254,48 @@ if (index < NUM_OF_MM_TIMERS) { -/* Implements Measure#36 */ -#if defined(NCONFIG) + /* Implements Measure#36 */ + #if defined(NCONFIG) /* partab is not defined when NCONFIG is defined */ - TRACE_EVENT_P1 ("tim_start_timer: index (%d)", index); -#else /* not (NCONFIG) */ -#if defined (TRACE_PRIM) AND defined(OPTION_TIMER) - TRACE_EVENT_P1 ("tim_start_timer (%s)", partab[index].keyword); -#endif -#endif /* NCONFIG */ -#if defined (OPTION_TIMER) - switch (config_table[index].t_mode) - { - case TIMER_SET: - value = config_table[index].t_val; - break; + TRACE_EVENT_P1 ("tim_start_timer: index (%d)", index); + #else /* not (NCONFIG) */ + #if defined (TRACE_PRIM) AND defined(OPTION_TIMER) + TRACE_EVENT_P1 ("tim_start_timer (%s)", partab[index].keyword); + #endif + #endif /* NCONFIG */ + #if defined (OPTION_TIMER) + switch (config_table[index].t_mode) + { + case TIMER_SET: + value = config_table[index].t_val; + break; - case TIMER_RESET: - value = value; - break; + case TIMER_RESET: + value = value; + break; - case TIMER_SPEED_UP: - value = value / config_table[index].t_val; - if (value == 0) - value = 1; - TRACE_EVENT_P1 ("timer_speed_up (%d)", value); - break; + case TIMER_SPEED_UP: + value = value / config_table[index].t_val; + if (value == 0) + value = 1; + TRACE_EVENT_P1 ("timer_speed_up (%d)", value); + break; - case TIMER_SLOW_DOWN: - value = value * config_table[index].t_val; - TRACE_EVENT_P1 ("timer_speed_down (%d)", value); - break; + case TIMER_SLOW_DOWN: + value = value * config_table[index].t_val; + TRACE_EVENT_P1 ("timer_speed_down (%d)", value); + break; - default: - TRACE_FUNCTION ("ERROR: UNKNOWN MODE"); - return; + default: + TRACE_FUNCTION ("ERROR: UNKNOWN MODE"); + return; + } + #endif + + mm_data->t_running[index] = TRUE; + + TIMER_START (mm_handle, index, value); } -#endif - - mm_data->t_running[index] = TRUE; - - TIMER_START (mm_handle, index, value); -} else { TRACE_ERROR ("tim_start_timer(): index out of range");