annotate gsm-fw/g23m-aci/uart/uart_rxp.c @ 775:eedbf248bac0

gsm-fw/g23m-aci subtree: initial import from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 12 Oct 2014 01:45:14 +0000
parents
children f54080301c98
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
775
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | Project :
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 | Modul :
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 | All rights reserved.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 | Instruments Berlin, AG
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 | Purpose : This modul is part of the entity UART and implements all
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 | functions to handles the incoming primitives as described in
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 | the SDL-documentation (RX-statemachine)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 +-----------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 #ifndef UART_RXP_C
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 #define UART_RXP_C
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 #endif /* !UART_RXP_C */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 #define ENTITY_UART
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 #ifndef FF_MULTI_PORT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 /*==== INCLUDES =============================================================*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 #ifdef WIN32
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "nucleus.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 #endif /* WIN32 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #include "typedefs.h" /* to get Condat data types */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 #include "vsi.h" /* to get a lot of macros */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 #include "macdef.h" /* to get a lot of macros */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 #include "custom.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 #include "gsm.h" /* to get a lot of macros */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 #include "cnf_uart.h" /* to get cnf-definitions */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 #include "mon_uart.h" /* to get mon-definitions */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 #include "prim.h" /* to get the definitions of used SAP and directions */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 #include "dti.h" /* to get dti lib */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 #include "pei.h" /* to get PEI interfac */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 #ifdef _TARGET_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 #include "uart/serialswitch.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 #include "uart/traceswitch.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 #else /* _TARGET_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 #include "serial_dat.h" /* to get definitions of serial driver */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 #endif /* _TARGET_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 #include "uart.h" /* to get the global entity definitions */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 #include "uart_rxf.h" /* to get rx functions */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 #include "uart_kers.h" /* to get ker signals */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 #include "uart_dtxs.h" /* to get dtx signals */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 #include <stdio.h> /* to get sprintf */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 #include "uart_rxp.h" /* to get rx_readdata */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 #endif /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 /*==== CONST ================================================================*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 /*==== LOCAL VARS ===========================================================*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 /*==== PRIVATE FUNCTIONS ====================================================*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 /*==== PUBLIC FUNCTIONS =====================================================*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 | Function : rx_uart_driver_received_ind
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 | Description : Handles the primitive UART_DRIVER_RECEIVED_IND
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 | Parameters : *uart_device - affected device database
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 GLOBAL void rx_uart_driver_received_ind ( T_UART_DATA* uart_device )
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 USHORT i;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 BOOL continuous;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 T_DLC* dlc;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 T_desc2* temp_desc = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 ULONG line_states;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 TRACE_EVENT( "rx_uart_driver_received_ind()" );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93 * set affected instance
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 uart_data = uart_device;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 * inform about new line states
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 if(uart_data->rx.lines NEQ uart_data->rx.prev_lines)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 * convert line states and send it
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 line_states = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 if(uart_data->rx.lines & X_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 line_states|= UART_X_RX_MASK;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 if(!(uart_data->rx.prev_lines & X_MASK))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 TRACE_EVENT("RX Flow Control: stop");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 else if(uart_data->rx.prev_lines & X_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 TRACE_EVENT("RX Flow Control: start");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 if(uart_data->rx.lines & SA_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121 line_states|= UART_SA_RX_MASK;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 if(!(uart_data->rx.prev_lines & SA_MASK))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 TRACE_EVENT("DTR: drop");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127 else if(uart_data->rx.prev_lines & SA_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 TRACE_EVENT("DTR: on");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 if(uart_data->rx.lines & SB_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 line_states|= UART_SB_RX_MASK;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 if(!(uart_data->rx.prev_lines & SB_MASK))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 TRACE_EVENT("RTS: off");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 else if(uart_data->rx.prev_lines & SB_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 TRACE_EVENT("RTS: on");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 if(uart_data->rx.lines & ESC_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 line_states|= UART_ESC_RX_MASK;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 TRACE_EVENT("Escape Sequence detected");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 if(uart_data->rx.lines & BRK_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 line_states|= UART_BRK_RX_MASK;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 line_states|= (((uart_data->rx.lines & BRK_LEN_MASK)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155 >> BRKLEN) << UART_BRKLEN_RX_POS);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 TRACE_EVENT("Break detected");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 * store new line states
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 uart_data->rx.lines&= ~(ESC_MASK |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 BRK_MASK |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 BRK_LEN_MASK);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 uart_data->rx.prev_lines = uart_data->rx.lines;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 * inform MMI
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 sig_rx_ker_line_states_ind(line_states);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 switch( GET_STATE( UART_SERVICE_RX ) )
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 case RX_READY:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174 dlc = &uart_data->dlc_table[UART_CONTROL_INSTANCE];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 if(uart_data->rx.dlc_instance NEQ UART_EMPTY_INSTANCE)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 uart_data->rx.dlc_instance = UART_EMPTY_INSTANCE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 uart_data->rx.analyze_state = UART_RX_ERROR;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 * if ISR has read out some data
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181 * inform all channels about data reception
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 if(uart_data->rx.read_permission)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 for(i = 0; i <= UART_MAX_NUMBER_OF_CHANNELS; i++)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 switch(uart_data->dlc_table[i].receive_process)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 case UART_RX_PROCESS_READY:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 case UART_RX_PROCESS_COMPLETE:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 * inform all channels about data reception
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 uart_data->dlc_table[i].receive_process = UART_RX_PROCESS_STOP;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 temp_desc = uart_data->dlc_table[i].receive_data;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 uart_data->dlc_table[i].receive_data = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 if(i EQ UART_CONTROL_INSTANCE)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 * Control channel
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 sig_rx_ker_data_received_ind(
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203 temp_desc,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 uart_data->dlc_table[i].receive_pos);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 * Data channel
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211 uart_data->dtx = uart_data->dlc_table[i].dtx;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212 sig_rx_dtx_data_received_ind(
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 temp_desc,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 uart_data->dlc_table[i].receive_pos);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 /* fall through */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 case UART_RX_PROCESS_STOP:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 * add new channels which want to receive
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221 if(uart_data->dlc_table[i].receive_data)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 uart_data->dlc_table[i].receive_process = UART_RX_PROCESS_READY;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226 TRACE_EVENT_P2("Unexpected DLC process state: %d | uart_rxp.c(%d)",
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 dlc->receive_process, __LINE__);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
232 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
233 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
234 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
235 switch(dlc->receive_process)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
236 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
237 case UART_RX_PROCESS_READY:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
238 case UART_RX_PROCESS_COMPLETE:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
239 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
240 * if ISR has read out some data
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
241 * inform channel about data reception
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
242 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
243 if(uart_data->rx.read_permission)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
244 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
245 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
246 * inform channel about data reception
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
247 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
248 dlc->receive_process = UART_RX_PROCESS_STOP;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
249 temp_desc = dlc->receive_data;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
250 dlc->receive_data = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
251 uart_data->dtx = dlc->dtx;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
252 sig_rx_dtx_data_received_ind(temp_desc, dlc->receive_pos);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
253 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
254 /* fall through */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
255 case UART_RX_PROCESS_STOP:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
256 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
257 * add new channel which want to receive
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
258 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
259 if(dlc->receive_data)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
260 dlc->receive_process = UART_RX_PROCESS_READY;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
261 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
262
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
263 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
264 TRACE_EVENT_P2("Unexpected DLC process state: %d | uart_rxp.c(%d)",
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
265 dlc->receive_process, __LINE__);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
266 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
267 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
268 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
269 if(dlc->receive_process EQ UART_RX_PROCESS_STOP)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
270 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
271 uart_data->rx.receive_state = UART_RX_NOT_RECEIVING;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
272 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
273 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
274
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
275 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
276 if(rx_inpavail(uart_data->device) > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
277 #else /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
278 if(UF_InpAvail (uart_data->device) > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
279 #endif /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
280 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
281 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
282 * inform channel about reading
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
283 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
284 uart_data->rx.read_permission = TRUE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
285 uart_data->dtx = dlc->dtx;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
286 sig_rx_dtx_receiving_ind();
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
287 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
288 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
289 uart_data->rx.read_permission = FALSE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
290
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
291 if(uart_data EQ (&(uart_data_base[0])))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
292 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
293 TRACE_EVENT("UF_ReadData()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
294 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
295 rx_readdata(0);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
296 #else /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
297 UF_ReadData (uart_data->device, sm_suspend, rx_readOutFunc_0);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
298 #endif /* else _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
299 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
300 #ifdef FF_TWO_UART_PORTS
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
301 else if(uart_data EQ (&(uart_data_base[1])))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
302 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
303 TRACE_EVENT("UF_ReadData()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
304 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
305 rx_readdata(1);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
306 #else /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
307 UF_ReadData (uart_data->device, sm_suspend, rx_readOutFunc_1);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
308 #endif /* else _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
309 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
310 #endif /* FF_TWO_UART_PORTS */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
311 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
312 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
313 TRACE_ERROR("wrong value of uart_data");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
314 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
315 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
316
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
317 case RX_MUX:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
318 if(uart_data->rx.dlc_instance EQ UART_EMPTY_INSTANCE)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
319 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
320 uart_data->rx.dlc_instance = UART_CONTROL_INSTANCE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
321 uart_data->rx.analyze_state = UART_RX_ERROR;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
322 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
323 continuous = FALSE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
324 for(i = 0; i <= UART_MAX_NUMBER_OF_CHANNELS; i++)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
325 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
326 dlc = &uart_data->dlc_table[i];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
327 switch(dlc->receive_process)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
328 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
329 case UART_RX_PROCESS_READY:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
330 case UART_RX_PROCESS_COMPLETE:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
331 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
332 * if ISR has read out some data
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
333 * inform all channels about data reception
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
334 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
335 if(uart_data->rx.read_permission)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
336 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
337 dlc->receive_process = UART_RX_PROCESS_STOP;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
338 temp_desc = dlc->receive_data;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
339 dlc->receive_data = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
340 if(i EQ UART_CONTROL_INSTANCE)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
341 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
342 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
343 * Control channel
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
344 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
345 sig_rx_ker_data_received_ind(temp_desc, dlc->receive_pos);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
346 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
347 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
348 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
349 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
350 * Data channel
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
351 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
352 uart_data->dtx = dlc->dtx;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
353 sig_rx_dtx_data_received_ind(temp_desc, dlc->receive_pos);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
354 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
355 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
356 /* fall through */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
357 case UART_RX_PROCESS_STOP:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
358 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
359 * add new channels which want to receive
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
360 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
361 if(dlc->receive_data)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
362 dlc->receive_process = UART_RX_PROCESS_READY;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
363 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
364
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
365 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
366 TRACE_EVENT_P2("Unexpected DLC process state: %d, uart_rxp.c(%d)",
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
367 dlc->receive_process, __LINE__);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
368 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
369 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
370 if(dlc->receive_process NEQ UART_RX_PROCESS_STOP)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
371 continuous = TRUE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
372 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
373 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
374 * check whether there is a channel to receive
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
375 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
376 if(continuous NEQ TRUE)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
377 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
378 uart_data->rx.receive_state = UART_RX_NOT_RECEIVING;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
379 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
380 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
381 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
382 if(rx_inpavail(uart_data->device) > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
383 #else /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
384 if(UF_InpAvail (uart_data->device) > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
385 #endif /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
386 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
387 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
388 * inform each channel about reading
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
389 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
390 uart_data->rx.read_permission = TRUE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
391 for(i = 0; i <= UART_MAX_NUMBER_OF_CHANNELS; i++)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
392 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
393 if(uart_data->dlc_table[i].receive_process EQ UART_RX_PROCESS_READY)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
394 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
395 if(i EQ UART_CONTROL_INSTANCE)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
396 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
397 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
398 * Control channel
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
399 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
400 sig_rx_ker_receiving_ind();
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
401 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
402 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
403 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
404 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
405 * Data channel
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
406 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
407 uart_data->dtx = uart_data->dlc_table[i].dtx;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
408 sig_rx_dtx_receiving_ind();
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
409 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
410 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
411 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
412 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
413 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
414 uart_data->rx.read_permission = FALSE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
415
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
416 if(uart_data EQ (&(uart_data_base[0])))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
417 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
418 TRACE_EVENT("UF_ReadData()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
419 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
420 rx_readdata(0);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
421 #else /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
422 UF_ReadData (uart_data->device, sm_suspend, rx_readOutFunc_0);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
423 #endif /* else _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
424 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
425 #ifdef FF_TWO_UART_PORTS
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
426 else if(uart_data EQ (&(uart_data_base[1])))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
427 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
428 TRACE_EVENT("UF_ReadData()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
429 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
430 rx_readdata(1);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
431 #else /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
432 UF_ReadData (uart_data->device, sm_suspend, rx_readOutFunc_1);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
433 #endif /* else _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
434 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
435 #endif /* FF_TWO_UART_PORTS */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
436 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
437 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
438 TRACE_ERROR("wrong value of uart_data");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
439 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
440 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
441
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
442 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
443 TRACE_ERROR( "UART_DRIVER_RECEIVED_IND unexpected" );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
444 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
445 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
446 } /* rx_uart_driver_received_ind() */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
447
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
448
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
449
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
450 #ifdef _SIMULATION_
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
451 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
452 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
453 | Function : rx_dti_data_test_ind
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
454 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
455 | Description : Handles the primitive DTI_DATA_TEST_IND
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
456 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
457 | Parameters : *dti_data_test_ind - Ptr to primitive payload
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
458 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
459 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
460 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
461 GLOBAL void rx_dti_data_test_ind ( T_DTI2_DATA_TEST_IND *dti_data_test_ind )
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
462 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
463 char buf[100];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
464 T_reInstMode reInstall;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
465 USHORT size[2];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
466 USHORT pos;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
467 USHORT i;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
468 T_UART_DATA* uart_device;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
469
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
470 TRACE_FUNCTION( "rx_dti_data_test_ind" );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
471
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
472 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
473 * set UART instance
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
474 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
475 uart_device = &(uart_data_base[UART_TEST_C_ID_1]);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
476 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
477 * copy data to simulation buffer
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
478 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
479 MFREE_DESC2(uart_device->rx.sim_buffer);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
480 MALLOC(uart_device->rx.sim_buffer, (USHORT)(sizeof(T_desc2) - 1 +
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
481 (dti_data_test_ind->sdu.l_buf >> 3)));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
482 memcpy(uart_device->rx.sim_buffer->buffer,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
483 &dti_data_test_ind->sdu.buf[dti_data_test_ind->sdu.o_buf >> 3],
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
484 dti_data_test_ind->sdu.l_buf >> 3);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
485 uart_device->rx.sim_buffer->len = dti_data_test_ind->sdu.l_buf >> 3;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
486 uart_device->rx.sim_buffer->next = (ULONG)NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
487 uart_device->rx.sim_pos = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
488 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
489 * trace output
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
490 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
491 sprintf(buf, "UART device %d:", dti_data_test_ind->link_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
492 TRACE_FUNCTION( buf );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
493 i = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
494 pos = uart_device->rx.sim_pos;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
495 while(pos < uart_device->rx.sim_buffer->len)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
496 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
497 i+= sprintf(&buf[i], "0x%02x, ", uart_device->rx.sim_buffer->buffer[pos]);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
498 pos++;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
499 if(i > 80)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
500 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
501 TRACE_FUNCTION( buf );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
502 i = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
503 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
504 else if(pos >= uart_device->rx.sim_buffer->len)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
505 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
506 TRACE_FUNCTION( buf );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
507 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
508 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
509 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
510 * set values for ISR
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
511 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
512 uart_device->rx.source[0] = &uart_device->rx.sim_buffer->buffer[
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
513 uart_device->rx.sim_pos];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
514 uart_device->rx.source[1] = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
515 size[0] = uart_device->rx.sim_buffer->len -
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
516 uart_device->rx.sim_pos;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
517 size[1] = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
518
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
519 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
520 * call actual function
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
521 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
522 rx_readOutFunc_0 (FALSE, &reInstall, 1, uart_device->rx.source, size, 0);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
523
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
524 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
525 * store return values
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
526 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
527 if(size[0] EQ 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
528 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
529 MFREE_DESC2(uart_device->rx.sim_buffer);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
530 uart_device->rx.sim_buffer = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
531 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
532 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
533 uart_device->rx.sim_pos = uart_device->rx.sim_buffer->len - size[0];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
534
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
535 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
536 * free the primitive
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
537 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
538 PFREE(dti_data_test_ind);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
539 } /* rx_dti_data_test_ind() */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
540
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
541
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
542
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
543 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
544 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
545 | Function : rx_readdata
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
546 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
547 | Description : Simulates a UF_ReadData() call.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
548 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
549 | Parameters : caller - calling UART instance
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
550 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
551 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
552 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
553 GLOBAL void rx_readdata (UBYTE caller)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
554 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
555 T_reInstMode reInstall;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
556 USHORT size[2];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
557 T_UART_DATA* uart_device;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
558
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
559 TRACE_FUNCTION( "rx_readdata" );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
560
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
561 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
562 * set UART instance
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
563 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
564 uart_device = &(uart_data_base[caller]);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
565
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
566 if(uart_device->rx.sim_buffer EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
567 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
568 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
569 * send DTI_GETDATA_REQ
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
570 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
571 PALLOC (dti_getdata_req, DTI2_GETDATA_REQ);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
572 dti_getdata_req->link_id = LINK_READDATA_PORT_1; /* for usual read_data */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
573 PSEND (hCommMMI, dti_getdata_req);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
574 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
575 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
576 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
577 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
578 * set values for ISR
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
579 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
580 uart_device->rx.source[0] = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
581 uart_device->rx.source[1] = &uart_device->rx.sim_buffer->buffer[
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
582 uart_device->rx.sim_pos];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
583 size[0] = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
584 size[1] = uart_device->rx.sim_buffer->len -
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
585 uart_device->rx.sim_pos;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
586
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
587 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
588 * call actual function
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
589 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
590 if(caller EQ 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
591 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
592 rx_readOutFunc_0 (FALSE, &reInstall, 2, uart_device->rx.source, size, 0);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
593 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
594 #ifdef FF_TWO_UART_PORTS
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
595 else if(caller EQ 1)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
596 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
597 rx_readOutFunc_1 (FALSE, &reInstall, 2, uart_device->rx.source, size, 0);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
598 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
599 #endif /* FF_TWO_UART_PORTS */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
600 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
601 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
602 TRACE_ERROR("wrong caller value");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
603 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
604
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
605 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
606 * store return values
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
607 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
608 if(size[1] EQ 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
609 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
610 MFREE_DESC2(uart_device->rx.sim_buffer);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
611 uart_device->rx.sim_buffer = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
612 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
613 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
614 uart_device->rx.sim_pos = uart_device->rx.sim_buffer->len - size[1];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
615 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
616 } /* rx_readdata() */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
617
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
618
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
619
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
620 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
621 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
622 | Function : rx_inpavail
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
623 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
624 | Description : Simulates a UF_InpAvail() call.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
625 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
626 | Parameters : caller - calling UART instance
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
627 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
628 | Return : number of octets in Input Queue
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
629 |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
630 +------------------------------------------------------------------------------
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
631 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
632 GLOBAL USHORT rx_inpavail (UBYTE caller)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
633 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
634 T_UART_DATA* uart_device;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
635
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
636 TRACE_FUNCTION( "rx_inpavail" );
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
637
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
638 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
639 * set UART instance
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
640 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
641 uart_device = &(uart_data_base[caller]);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
642
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
643 if(uart_device->rx.sim_buffer)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
644 return uart_device->rx.sim_buffer->len - uart_device->rx.sim_pos;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
645 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
646 return 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
647 } /* rx_inpavail() */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
648 #endif /* _SIMULATION_ */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
649 #endif /* !FF_MULTI_PORT */