comparison gsm-fw/gpf/conf/gpf_misc_init.c @ 485:890ffca53a09

gsm-fw/gpf/conf: started
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 29 Jun 2014 19:49:29 +0000
parents
children
comparison
equal deleted inserted replaced
484:c617a6adcb69 485:890ffca53a09
1 /*
2 * This module is our FreeCalypso adaptation of
3 * g23m/condat/frame/config/gprsinit.c from the Leonardo semi-src.
4 * I renamed it from gprsinit.c to gpf_misc_init.c because nothing
5 * in this module is specific to the GPRS configuration.
6 */
7
8 #include "gpfconf.h"
9
10 #ifndef _TARGET_
11 #define NEW_ENTITY
12 #endif
13
14 /*==== INCLUDES ===================================================*/
15
16 #ifdef _TARGET_
17 #include "../../serial/serialswitch.h"
18 #endif
19
20 #include "../../nucleus/nucleus.h"
21 #include "typedefs.h"
22 #include "os.h"
23 #include "vsi.h"
24 #include "os_types.h"
25 #include "pcon.h"
26 #include "p_mem.h"
27
28 /*==== CONSTANTS ==================================================*/
29
30 /*==== TYPES ======================================================*/
31
32 /*==== EXTERMALS ==================================================*/
33
34 #ifndef _TARGET_
35 extern void GpInitTarget (void);
36 extern void Cust_Init_Layer1 (void);
37 extern void GpUnmaskInterrupts (void);
38 extern void GpInitExternalDevices (void);
39 #endif
40
41 /*==== PROTOTYPES =================================================*/
42
43 short StartFrame (void);
44
45 /*==== VARIABLES ==================================================*/
46
47 T_PCON_PROPERTIES *pcon = NULL;
48 T_MEM_PROPERTIES *mem = NULL;
49
50 /*==== FUNCTIONS ==================================================*/
51
52 #ifdef _TARGET_
53
54 void DummyCallback ( void )
55 {
56 }
57
58 #endif
59 /*
60 +--------------------------------------------------------------------+
61 | PROJECT : GSM-PS (6147) MODULE : GPRSINIT |
62 | STATE : code ROUTINE : Application_Initialize |
63 +--------------------------------------------------------------------+
64
65 PURPOSE : Main entry function for NUCLEUS
66
67 */
68 /*
69 * NOTE: Application_Initalize() must not be used when compiling for target,
70 * because it is already defined in a TI lib (as of TI 5.1.1).
71 */
72 #ifndef _TARGET_
73 void Application_Initialize (void *first_available_memory)
74 {
75
76 #ifdef _TARGET_
77 GpInitTarget ();
78 Cust_Init_Layer1 ();
79 GpInitExternalDevices ();
80 SER_tr_Init ( 0, 2, DummyCallback );
81 #endif
82
83 StartFrame();
84
85 #ifdef _TARGET_
86 GpUnmaskInterrupts ();
87 #endif
88 }
89 #endif /* !_TARGET_ */
90
91 /*
92 +----------------------------------------------------------------------+
93 | PROJECT : xxx MODULE : GPRSINIT |
94 | STATE : code ROUTINE : InitializeApplication |
95 +----------------------------------------------------------------------+
96
97 PURPOSE : General initialization function to be filled with
98 application specific initializations. Function is
99 called by the frame after creation of all tasks
100 prior to the starting of the tasks.
101
102 */
103 void InitializeApplication ( void )
104 {
105 /*
106 * It has to defined if the allocated partition memory shall be
107 * initialized with a dedicated pattern. Select
108 * ENABLE_PARTITON_INIT or DISABLE_PARTITON_INIT
109 * and a pattern to be used for initialization
110 */
111 #ifdef _TARGET_
112 vsi_m_init ( DISABLE_PARTITON_INIT, (char)0x00 );
113 #else
114 vsi_m_init ( ENABLE_PARTITON_INIT, (char)0x00 );
115 #endif
116
117 #ifdef _TARGET_
118 /*
119 * The RTOS tick has to be set.Currently it can be set to
120 * SYSTEM_TICK_TDMA_FRAME for the TDMA frame system tick of 4.615ms
121 * or
122 * SYSTEM_TICK_10_MS for the 10ms tick used for UMTS
123 */
124 os_set_tick ( SYSTEM_TICK_TDMA_FRAME );
125 #endif
126 }