annotate chipsetsw/layer1/dl1/dl1_com.c @ 299:3d0f510f0420

l1p_cmpl.c: l1ps_read_single() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 02 Oct 2017 06:44:23 +0000
parents c19fb53b730b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
1 /*
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
2 * This module contains the LISR and HISR glue functions for L1
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
3 * which used to be in the dl1_com module in the Leonardo version.
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
4 * The LoCosto source from which we got our L1 code no longer has a
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
5 * dl1_com.c module, and the ISR glue functions in question have been
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
6 * moved into csw-system/init_common/init.c - an incredibly messy C
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
7 * module that is mostly devoted to LoCosto BSP initialization.
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
8 *
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
9 * The present C code has been extracted from LoCosto's init.c,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
10 * guided by the disassembly of dl1_com.obj from the Leonardo version.
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
11 */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
12
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
13 /* Include Files */
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
14 #include <assert.h>
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
15 #include <stdarg.h>
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
16 #include <stdio.h>
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
17 #include <stdlib.h>
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
18 #include <string.h>
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
19
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
20 #include "nucleus.h"
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
21
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
22 #include "l1_types.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
23 #include "l1_confg.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
24 #include "l1_const.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
25
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
26 #if TESTMODE
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
27 #include "l1tm_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
28 #endif // TESTMODE
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
29
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
30 #if (AUDIO_TASK == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
31 #include "l1audio_const.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
32 #include "l1audio_cust.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
33 #include "l1audio_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
34 #endif // AUDIO_TASK
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
35
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
36 #if (L1_GTT == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
37 #include "l1gtt_const.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
38 #include "l1gtt_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
39 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
40
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
41 #if (L1_MP3 == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
42 #include "l1mp3_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
43 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
44
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
45 #if (L1_MIDI == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
46 #include "l1midi_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
47 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
48
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
49 #if (L1_AAC == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
50 #include "l1aac_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
51 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
52 #if (L1_DYN_DSP_DWNLD == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
53 #include "l1_dyn_dwl_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
54 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
55
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
56 #if (TRACE_TYPE == 4)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
57 #include "l1_defty.h"
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
58 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
59
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
60 #include "armio.h"
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
61 #include "timer.h"
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
62
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
63 #include "iq.h"
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
64 #include "mem.h"
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
65 #include "clkm.h"
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
66 #include "inth.h"
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
67
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
68 /*
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
69 * Timing monitor
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
70 */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
71 #if (TRACE_TYPE == 4)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
72 extern T_L1A_L1S_COM l1a_l1s_com;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
73 extern T_L1S_GLOBAL l1s;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
74 UNSIGNED max_cpu, fn_max_cpu;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
75 unsigned short layer_1_sync_end_time;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
76 unsigned short max_cpu_flag;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
77 #if (DSP >= 38)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
78 // DSP CPU load measurement trace variables
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
79 UWORD32 dsp_max_cpu_load_trace_array[4];
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
80 UWORD32 dsp_max_cpu_load_idle_frame;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
81 unsigned short l1_dsp_cpu_load_trace_flag;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
82 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
83 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
84
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
85 #if (L1_EXT_AUDIO_MGT == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
86 NU_HISR EXT_AUDIO_MGT_hisr;
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
87 char FAR ext_audio_mgt_hisr_stack[500];
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
88 extern void Cust_ext_audio_mgt_hisr(void);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
89 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
90
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
91 #if ( (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC == 1) || (L1_DYN_DSP_DWNLD == 1) ) // equivalent to an API_HISR flag
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
92 extern void api_hisr(void);
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
93 #pragma DATA_SECTION (API_HISR_stack,"API_HISR_stack");
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
94 char FAR API_HISR_stack[0x400];
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
95 NU_HISR apiHISR;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
96 #endif // (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_DYN_DSP_DWNLD == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
97
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
98 #if (FF_L1_IT_DSP_USF == 1) || (FF_L1_IT_DSP_DTX == 1)
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
99 char FAR API_MODEM_HISR_stack[0x400]; // stack size to be tuned
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
100 NU_HISR api_modemHISR;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
101 #endif // FF_L1_IT_DSP_USF
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
102
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
103 /*
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
104 * HISR stack and semaphore needed by L1
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
105 */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
106 #if (OP_L1_STANDALONE == 0)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
107 #define LAYER_1_SYNC_STACK_SIZE 4000 /* matching Leonardo version */
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
108 unsigned char layer_1_sync_stack[LAYER_1_SYNC_STACK_SIZE];
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
109 #else
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
110 #if TESTMODE
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
111 char FAR layer_1_sync_stack[2600 /*3600*/]; // Frame interrupt task stack for EVA3
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
112 #else
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
113 char FAR layer_1_sync_stack[1600 /* 2600 */]; // Frame interrupt task stack for EVA3
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
114 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
115 #endif /* OP_L1_STANDALONE */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
116
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
117 NU_HISR layer_1_sync_HISR; // Frame interrupt task stack for EVA3
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
118
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
119 /* forward declaration */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
120 void layer_1_sync_HISR_entry (void);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
121
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
122 /*
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
123 * l1_create_ISR
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
124 *
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
125 * Create L1 HISR. This function is called from l1_pei.
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
126 */
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
127 void l1_create_ISR (void)
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
128 {
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
129 STATUS status;
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
130
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
131 #if (OP_L1_STANDALONE == 0)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
132 // Fill the entire stack with the pattern 0xFE
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
133 memset (layer_1_sync_stack, 0xFE, LAYER_1_SYNC_STACK_SIZE);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
134 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
135
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
136 status = NU_Create_HISR (&layer_1_sync_HISR,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
137 "L1_HISR",
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
138 layer_1_sync_HISR_entry,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
139 #if (OP_L1_STANDALONE == 0)
166
5bad5a0bdec2 dl1_com.c: HISR priorities restored to TCS211 way
Mychaela Falconia <falcon@freecalypso.org>
parents: 165
diff changeset
140 0,
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
141 layer_1_sync_stack,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
142 LAYER_1_SYNC_STACK_SIZE);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
143 #else
166
5bad5a0bdec2 dl1_com.c: HISR priorities restored to TCS211 way
Mychaela Falconia <falcon@freecalypso.org>
parents: 165
diff changeset
144 0,
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
145 layer_1_sync_stack,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
146 sizeof(layer_1_sync_stack));
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
147 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
148
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
149 #if (L1_EXT_AUDIO_MGT)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
150 // Create HISR for Ext MIDI activity
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
151 //==================================
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
152 status += NU_Create_HISR(&EXT_AUDIO_MGT_hisr,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
153 "H_EXT_AUDIO_MGT",
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
154 Cust_ext_audio_mgt_hisr,
166
5bad5a0bdec2 dl1_com.c: HISR priorities restored to TCS211 way
Mychaela Falconia <falcon@freecalypso.org>
parents: 165
diff changeset
155 1,
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
156 ext_audio_mgt_hisr_stack,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
157 sizeof(ext_audio_mgt_hisr_stack));
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
158 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
159
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
160 #if ( (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC == 1) || (L1_DYN_DSP_DWNLD == 1) ) // equivalent to an API_HISR flag
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
161 status += NU_Create_HISR(&apiHISR,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
162 "API_HISR",
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
163 api_hisr,
166
5bad5a0bdec2 dl1_com.c: HISR priorities restored to TCS211 way
Mychaela Falconia <falcon@freecalypso.org>
parents: 165
diff changeset
164 1,
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
165 API_HISR_stack,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
166 sizeof(API_HISR_stack));
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
167 #endif // (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC == 1) || (L1_DYN_DSP_DWNLD == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
168
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
169 #if (FF_L1_IT_DSP_USF == 1) || (FF_L1_IT_DSP_DTX == 1) // equivalent to an API_MODEM_HISR flag
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
170 // Create HISR for USF DSP interrupt !!!!. This HISR needs
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
171 // to have the highest priority since the USF status needs
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
172 // to be known before the next block starts.
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
173 //========================================================
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
174 status += NU_Create_HISR(&api_modemHISR,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
175 "MODEM",
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
176 api_modem_hisr,
166
5bad5a0bdec2 dl1_com.c: HISR priorities restored to TCS211 way
Mychaela Falconia <falcon@freecalypso.org>
parents: 165
diff changeset
177 0,
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
178 API_MODEM_HISR_stack,
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
179 sizeof(API_MODEM_HISR_stack));
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
180 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
181
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
182 assert (status == 0);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
183 }
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
184
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
185 /*
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
186 * The versions of TP_FrameIntHandler() and layer_1_sync_HISR_entry()
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
187 * in the TCS211 dl1_com.obj module contain CPU load measurement
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
188 * code. TI changed things for LoCosto, so we have to revert their
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
189 * changes and restore the TCS211 way.
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
190 */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
191
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
192 #if (TRACE_TYPE == 4)
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
193 #define TIMER_RESET_VALUE (0xFFFF)
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
194 #define TICKS_PER_TDMA (1875)
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
195 #endif
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
196
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
197 /*-------------------------------------------------------*/
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
198 /* TP_FrameIntHandler() Low Interrupt service routine */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
199 /*-------------------------------------------------------*/
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
200 /* Parameters : */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
201 /* Return : */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
202 /* Functionality : activate Hisr on each frame interrupt*/
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
203 /*-------------------------------------------------------*/
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
204 void TP_FrameIntHandler(void)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
205 {
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
206
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
207 #if (OP_L1_STANDALONE == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
208
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
209 #if (TRACE_TYPE==1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
210 if (trace_info.current_config->l1_dyn_trace & 1<<L1_DYN_TRACE_L1S_CPU_LOAD)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
211 {
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
212 TM_ResetTimer (2, 0xFFFF, 1, 0);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
213 TM_StartTimer (2);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
214 }
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
215 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
216
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
217 #if (TRACE_TYPE==6)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
218 TM_ResetTimer (2, 0xFFFF, 1, 0);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
219 TM_StartTimer (2);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
220 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
221
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
222 #if (TRACE_TYPE==7) /* CPU_LOAD */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
223 l1_cpu_load_start();
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
224 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
225
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
226 #else
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
227
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
228 #if (TRACE_TYPE == 4) && (TI_NUC_MONITOR != 1)
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
229 TM_ResetTimer (2, TIMER_RESET_VALUE, 1, 0);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
230 TM_StartTimer (2);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
231 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
232
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
233 #if (TI_NUC_MONITOR == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
234 /* Copy LISR buffer in Log buffer each end of HISR */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
235 ti_nuc_monitor_tdma_action();
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
236 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
237
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
238 #if WCP_PROF == 1
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
239 prf_LogFNSwitch(l1s.actual_time.fn_mod42432);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
240 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
241
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
242 #endif /* OP_L1_STANDALONE */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
243
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
244 NU_Activate_HISR(&layer_1_sync_HISR); /* Activate HISR interrupt */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
245
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
246 #if (OP_L1_STANDALONE == 0)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
247 #if (WCP_PROF == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
248 #if (PRF_CALIBRATION == 1)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
249 NU_Activate_HISR(&prf_CalibrationHISR);
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
250 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
251 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
252 #endif
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
253
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
254 }
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
255
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
256 /*
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
257 * layer_1_sync_HISR_entry
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
258 *
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
259 * HISR associated to layer 1 sync.
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
260 */
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
261
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
262 void layer_1_sync_HISR_entry (void)
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
263 {
167
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
264 /* automatic var for the CPU load measurement code below */
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
265 #if (TRACE_TYPE == 4)
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
266 unsigned long cpu;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
267 #endif
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
268
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
269 // Call Synchronous Layer1
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
270 hisr();
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
271
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
272 /*
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
273 * FreeCalypso: the following code has been reconstructed from
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
274 * the disassembly of the TCS211 binary object; it was found to be
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
275 * similar to the Trace_L1S_CPU_load() function in l1_trace.c
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
276 * which appears to have been only for (TRACE_TYPE == 1) originally.
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
277 */
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
278 #if (TRACE_TYPE == 4)
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
279 layer_1_sync_end_time = TIMER_RESET_VALUE - TM_ReadTimer(2);
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
280
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
281 cpu = (100 * layer_1_sync_end_time) / TICKS_PER_TDMA;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
282 if (cpu > max_cpu)
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
283 {
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
284 max_cpu=cpu;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
285 fn_max_cpu=l1s.actual_time.fn;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
286 max_cpu_flag = 1;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
287 /*
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
288 * TCS211 object has this bogus code here:
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
289
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
290 if (some non-understood condition) {
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
291 static int i;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
292 i++; // static var never used anywhere
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
293 max_cpu_flag = 1;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
294 }
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
295
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
296 * Because this bogus code does not change the result,
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
297 * I decided not to bother with reconstructing it.
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
298 */
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
299 }
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
300
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
301 if (((l1s.actual_time.fn%1326) == 0) && (max_cpu_flag == 0))
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
302 max_cpu = 0;
c19fb53b730b dl1_com.c: reconstructed CPU load measurement code in layer_1_sync_HISR_entry()
Mychaela Falconia <falcon@freecalypso.org>
parents: 166
diff changeset
303 #endif
164
10fc1fb079d7 dl1_com.c: starting with an import of l1_isr_glue.c from gcc version
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
304 }
165
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
305
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
306 /* the following stub functions live in the dl1_com module per TCS211 */
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
307
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
308 void rx_tch_data (API *data_address,
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
309 UWORD8 channel_mode,
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
310 UWORD8 blk_seq_number)
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
311 {
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
312 }
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
313
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
314 UWORD8 *tx_tch_data (void)
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
315 {
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
316 return(NULL);
4e72d69319d6 dl1_com.c: beginning of reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents: 164
diff changeset
317 }