-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCtAtSideMirrorDecoder.c
More file actions
185 lines (149 loc) · 10.5 KB
/
CtAtSideMirrorDecoder.c
File metadata and controls
185 lines (149 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/**********************************************************************************************************************
* FILE REQUIRES USER MODIFICATIONS
* Template Scope: sections marked with Start and End comments
* -------------------------------------------------------------------------------------------------------------------
* This file includes template code that must be completed and/or adapted during BSW integration.
* The template code is incomplete and only intended for providing a signature and an empty implementation.
* It is neither intended nor qualified for use in series production without applying suitable quality measures.
* The template code must be completed as described in the instructions given within this file and/or in the.
* Technical Reference.
* The completed implementation must be tested with diligent care and must comply with all quality requirements which.
* are necessary according to the state of the art before its use.
*********************************************************************************************************************/
/**********************************************************************************************************************
* Implementation template
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
*
* This implementation is incomplete and is neither intended nor qualified for use in series production
* without applying suitable quality measures. The implementation as well as any of its modifications
* must be tested with diligent care and must comply with all quality requirements which are necessary
* according to the state of the art before its use.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -------------------------------------------------------------------------------------------------------------------
* File: CtAtSideMirrorDecoder.c
* Config: 0
* SW-C Type: CtAtSideMirrorDecoder
* Generation Time: 2019-11-18 00:48:50
*
* Generator: MICROSAR RTE ContractPhase Generator Version 3.14.7
* RTE Core Version 1.21.0
* License:
*
* Description: C-Code implementation template for SW-C <CtAtSideMirrorDecoder>
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << Start of version logging area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
/* PRQA S 0777, 0779 EOF */ /* MD_MSR_Rule5.1, MD_MSR_Rule5.2 */
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << End of version logging area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
#include "Rte_CtAtSideMirrorDecoder.h"
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << Start of include and declaration area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << End of include and declaration area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
/**********************************************************************************************************************
*
* Used AUTOSAR Data Types
*
**********************************************************************************************************************
*
* Primitive Types:
* ================
* uint8: Integer in interval [0...255] (standard type)
*
*********************************************************************************************************************/
#define CtAtSideMirrorDecoder_START_SEC_CODE
#include "CtAtSideMirrorDecoder_MemMap.h" /* PRQA S 5087 */ /* MD_MSR_MemMap */
/**********************************************************************************************************************
*
* Runnable Entity Name: SetLeftRightMirror
*
*---------------------------------------------------------------------------------------------------------------------
*
* Executed if at least one of the following trigger conditions occurred:
* - triggered on DataReceivedEvent for DataElementPrototype <DeSideMirrorSelectionState> of PortPrototype <PpSideMirrorSwitchState>
*
**********************************************************************************************************************
*
* Input Interfaces:
* =================
* Explicit S/R API:
* -----------------
* Std_ReturnType Rte_Read_PpJoypadX_DeJoypadX(uint8 *data)
* Std_ReturnType Rte_Read_PpJoypadY_DeJoypadY(uint8 *data)
* Std_ReturnType Rte_Read_PpSideMirrorSwitchState_DeSideMirrorSelectionState(uint8 *data)
*
* Output Interfaces:
* ==================
* Explicit S/R API:
* -----------------
* Std_ReturnType Rte_Write_PpLeftSideMirrorState_DeSidMirrorState(uint8 data)
* Std_ReturnType Rte_Write_PpRightSideMirrorState_DeSidMirrorState(uint8 data)
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << Start of documentation area >> DO NOT CHANGE THIS COMMENT!
* Symbol: SetLeftRightMirror_doc
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << End of documentation area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
FUNC(void, CtAtSideMirrorDecoder_CODE) SetLeftRightMirror(void) /* PRQA S 0624, 3206 */ /* MD_Rte_0624, MD_Rte_3206 */
{
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << Start of runnable implementation >> DO NOT CHANGE THIS COMMENT!
* Symbol: SetLeftRightMirror
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << End of runnable implementation >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
if (REC_PpSideMirrorSwitchState_DeSideMirrorSelectionState == 1) {
REC_PpJoypadX_DeJoypadX += 1;
REC_PpJoypadY_DeJoypadY = 0;
return REC_PpJoypadX_DeJoypadX;
}
else if (REC_PpSideMirrorSwitchState_DeSideMirrorSelectionState == 2) {
REC_PpJoypadY_DeJoypadY += 1;
REC_PpJoypadX_DeJoypadX = 0;
return REC_PpJoypadY_DeJoypadY;
}
else {
REC_PpJoypadY_DeJoypadY = 0;;
REC_PpJoypadX_DeJoypadX = 0;
}
}
#define CtAtSideMirrorDecoder_STOP_SEC_CODE
#include "CtAtSideMirrorDecoder_MemMap.h" /* PRQA S 5087 */ /* MD_MSR_MemMap */
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << Start of function definition area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << End of function definition area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << Start of removed code area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
/**********************************************************************************************************************
* DO NOT CHANGE THIS COMMENT! << End of removed code area >> DO NOT CHANGE THIS COMMENT!
*********************************************************************************************************************/
/**********************************************************************************************************************
MISRA 2012 violations and justifications
*********************************************************************************************************************/
/* module specific MISRA deviations:
MD_Rte_0624: MISRA rule: Rule8.3
Reason: This MISRA violation is a consequence from the RTE requirements [SWS_Rte_01007] [SWS_Rte_01150].
The typedefs are never used in the same context.
Risk: No functional risk. Only a cast to uint8* is performed.
Prevention: Not required.
MD_Rte_3206: MISRA rule: Rule2.7
Reason: The parameter are not used by the code in all possible code variants.
Risk: No functional risk.
Prevention: Not required.
*/