FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/gpf/osl/os_tim_fl.c @ 455:2081103418e9
os_tim_fl.c: os_set_tick() done
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 23 Jun 2014 04:44:10 +0000 |
parents | 8d5a9f254dfc |
children | 6e54a3fb01b9 |
rev | line source |
---|---|
454
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * This C module is a reconstruction based on the disassembly of |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * os_tim.obj in frame_na7_db_fl.lib from the Leonardo package. |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 */ |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 /* set of included headers from COFF symtab: */ |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <stdio.h> |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include "gpfconf.h" /* FreeCalypso addition */ |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 #include "../../nucleus/nucleus.h" |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 #include "typedefs.h" |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 #include "os.h" |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 #include "gdi.h" |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 #include "os_types.h" |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 #include "os_glob.h" |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 extern UNSIGNED TMD_Timer; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 extern INT TMD_Timer_State; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 extern T_OS_TIMER_ENTRY TimerTable[]; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 extern T_OS_TIMER_TABLE_ENTRY *p_list[]; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 extern void os_Timeout(unsigned t_handle); |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 extern void timer_error(int err); |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 unsigned os_time_to_tick_multiplier = TIME_TO_TICK_TDMA_FRAME_MULTIPLIER; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 unsigned os_tick_to_time_multiplier = TICK_TO_TIME_TDMA_FRAME_MULTIPLIER; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 unsigned t_start_ticks; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 T_OS_TIMER_TABLE_ENTRY *t_running; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 int used_timers; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 int next_t_handle; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 int t_list_access; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 int max_used_timers; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 NU_SEMAPHORE TimSemCB; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 NU_TIMER os_timer_cb; |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 |
8d5a9f254dfc
OSL: os_tim_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 static int t_info_read; |
455
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
38 |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
39 GLOBAL LONG |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
40 os_set_tick(int os_system_tick) |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
41 { |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
42 switch (os_system_tick) { |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
43 case SYSTEM_TICK_TDMA_FRAME: |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
44 os_time_to_tick_multiplier = TIME_TO_TICK_TDMA_FRAME_MULTIPLIER; |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
45 os_tick_to_time_multiplier = TICK_TO_TIME_TDMA_FRAME_MULTIPLIER; |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
46 return(OS_OK); |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
47 case SYSTEM_TICK_10_MS: |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
48 os_time_to_tick_multiplier = TIME_TO_TICK_10MS_MULTIPLIER; |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
49 os_tick_to_time_multiplier = TICK_TO_TIME_10MS_MULTIPLIER; |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
50 return(OS_OK); |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
51 default: |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
52 return(OS_ERROR); |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
53 } |
2081103418e9
os_tim_fl.c: os_set_tick() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
454
diff
changeset
|
54 } |