comparison gsm-fw/g23m-gsm/mm/mm_tim.c @ 729:acc31840d51c

mm_tim.c compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 04 Oct 2014 23:29:33 +0000
parents 2f7df7a314f8
children
comparison
equal deleted inserted replaced
728:832e5506c598 729:acc31840d51c
20 */ 20 */
21 21
22 #ifndef MM_TIM_C 22 #ifndef MM_TIM_C
23 #define MM_TIM_C 23 #define MM_TIM_C
24 24
25 #include "config.h"
26 #include "fixedconf.h"
27 #include "condat-features.h"
28
25 #define ENTITY_MM 29 #define ENTITY_MM
26 30
27 /*==== INCLUDES ===================================================*/ 31 /*==== INCLUDES ===================================================*/
28 #if defined (NEW_FRAME) 32 #if defined (NEW_FRAME)
29 33
212 GET_INSTANCE_DATA; 216 GET_INSTANCE_DATA;
213 assert (index < NUM_OF_MM_TIMERS); 217 assert (index < NUM_OF_MM_TIMERS);
214 218
215 if (index < NUM_OF_MM_TIMERS) 219 if (index < NUM_OF_MM_TIMERS)
216 { 220 {
217 /* Implements Measure#36 */ 221 /* Implements Measure#36 */
218 #if defined(NCONFIG) 222 #if defined(NCONFIG)
219 /* partab is not defined when NCONFIG is defined */ 223 /* partab is not defined when NCONFIG is defined */
220 TRACE_EVENT_P1 ("tim_stop_timer: index (%d)", index); 224 TRACE_EVENT_P1 ("tim_stop_timer: index (%d)", index);
221 #else /* not (NCONFIG) */ 225 #else /* not (NCONFIG) */
222 #if defined (TRACE_PRIM) AND defined(OPTION_TIMER) 226 #if defined (TRACE_PRIM) AND defined(OPTION_TIMER)
223 TRACE_EVENT_P1 ("tim_stop_timer (%s)", partab[index].keyword); 227 TRACE_EVENT_P1 ("tim_stop_timer (%s)", partab[index].keyword);
224 #endif 228 #endif
225 #endif /* NCONFIG */ 229 #endif /* NCONFIG */
226 230
227 mm_data->t_running[index] = FALSE; 231 mm_data->t_running[index] = FALSE;
228 TIMER_STOP (mm_handle, index); 232 TIMER_STOP (mm_handle, index);
229 } 233 }
230 else 234 else
231 { 235 {
232 TRACE_ERROR ("tim_stop_timer(): index out of range"); 236 TRACE_ERROR ("tim_stop_timer(): index out of range");
233 } 237 }
234 } 238 }
248 GET_INSTANCE_DATA; 252 GET_INSTANCE_DATA;
249 assert (index < NUM_OF_MM_TIMERS); 253 assert (index < NUM_OF_MM_TIMERS);
250 254
251 if (index < NUM_OF_MM_TIMERS) 255 if (index < NUM_OF_MM_TIMERS)
252 { 256 {
253 /* Implements Measure#36 */ 257 /* Implements Measure#36 */
254 #if defined(NCONFIG) 258 #if defined(NCONFIG)
255 /* partab is not defined when NCONFIG is defined */ 259 /* partab is not defined when NCONFIG is defined */
256 TRACE_EVENT_P1 ("tim_start_timer: index (%d)", index); 260 TRACE_EVENT_P1 ("tim_start_timer: index (%d)", index);
257 #else /* not (NCONFIG) */ 261 #else /* not (NCONFIG) */
258 #if defined (TRACE_PRIM) AND defined(OPTION_TIMER) 262 #if defined (TRACE_PRIM) AND defined(OPTION_TIMER)
259 TRACE_EVENT_P1 ("tim_start_timer (%s)", partab[index].keyword); 263 TRACE_EVENT_P1 ("tim_start_timer (%s)", partab[index].keyword);
260 #endif 264 #endif
261 #endif /* NCONFIG */ 265 #endif /* NCONFIG */
262 #if defined (OPTION_TIMER) 266 #if defined (OPTION_TIMER)
263 switch (config_table[index].t_mode) 267 switch (config_table[index].t_mode)
264 { 268 {
265 case TIMER_SET: 269 case TIMER_SET:
266 value = config_table[index].t_val; 270 value = config_table[index].t_val;
267 break; 271 break;
268 272
269 case TIMER_RESET: 273 case TIMER_RESET:
270 value = value; 274 value = value;
271 break; 275 break;
272 276
273 case TIMER_SPEED_UP: 277 case TIMER_SPEED_UP:
274 value = value / config_table[index].t_val; 278 value = value / config_table[index].t_val;
275 if (value == 0) 279 if (value == 0)
276 value = 1; 280 value = 1;
277 TRACE_EVENT_P1 ("timer_speed_up (%d)", value); 281 TRACE_EVENT_P1 ("timer_speed_up (%d)", value);
278 break; 282 break;
279 283
280 case TIMER_SLOW_DOWN: 284 case TIMER_SLOW_DOWN:
281 value = value * config_table[index].t_val; 285 value = value * config_table[index].t_val;
282 TRACE_EVENT_P1 ("timer_speed_down (%d)", value); 286 TRACE_EVENT_P1 ("timer_speed_down (%d)", value);
283 break; 287 break;
284 288
285 default: 289 default:
286 TRACE_FUNCTION ("ERROR: UNKNOWN MODE"); 290 TRACE_FUNCTION ("ERROR: UNKNOWN MODE");
287 return; 291 return;
288 } 292 }
289 #endif 293 #endif
290 294
291 mm_data->t_running[index] = TRUE; 295 mm_data->t_running[index] = TRUE;
292 296
293 TIMER_START (mm_handle, index, value); 297 TIMER_START (mm_handle, index, value);
294 } 298 }
295 else 299 else
296 { 300 {
297 TRACE_ERROR ("tim_start_timer(): index out of range"); 301 TRACE_ERROR ("tim_start_timer(): index out of range");
298 } 302 }
299 } 303 }