1 /************************************************************/
2 /* ZREM_RestrictionMode.c */
3 /* RestrictionMode State transition model source file */
4 /* ZIPC Designer Version 1.2.0 */
5 /************************************************************/
6 #include "../ZST_include.h"
8 /* State management variable */
9 static uint8_t ZREM_RestrictionModeState[ZREM_RESTRICTIONMODESTATENOMAX];
11 static void ZREM_RestrictionModes0e1( void );
12 static void ZREM_RestrictionModes0e2( void );
13 static void ZREM_RestrictionModes1e0( void );
14 static void ZREM_RestrictionModes0Event( void );
15 static void ZREM_RestrictionModes1Event( void );
16 static void ZREM_RestrictionModes2Event( void );
18 /****************************************/
20 /* STM : RestrictionMode */
21 /* State : restriction_mode_off( No 0 ) */
22 /* Event : evt_restriction_mode_1_on( No 1 ) */
23 /****************************************/
24 static void ZREM_RestrictionModes0e1( void )
26 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
27 stm_rem_start_activity_restriction_mode_1_on();
30 /****************************************/
32 /* STM : RestrictionMode */
33 /* State : restriction_mode_off( No 0 ) */
34 /* Event : evt_restriction_mode_2_on( No 2 ) */
35 /****************************************/
36 static void ZREM_RestrictionModes0e2( void )
38 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES2;
39 stm_rem_start_activity_restriction_mode_2_on();
42 /****************************************/
44 /* STM : RestrictionMode */
45 /* State : restriction_mode_1_on( No 1 ) */
46 /* Event : evt_restriction_mode_off( No 0 ) */
47 /****************************************/
48 static void ZREM_RestrictionModes1e0( void )
50 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
51 stm_rem_start_activity_restriction_mode_off();
54 /****************************************/
55 /* Event appraisal function */
56 /* STM : RestrictionMode */
57 /* State : restriction_mode_off( No 0 ) */
58 /****************************************/
59 static void ZREM_RestrictionModes0Event( void )
61 /*evt_restriction_mode_1_on*/
62 if( g_stm_event == StmEvtNoRestrictionMode1On )
64 ZREM_RestrictionModes0e1();
66 /*evt_restriction_mode_2_on*/
67 else if( g_stm_event == StmEvtNoRestrictionMode2On )
69 ZREM_RestrictionModes0e2();
73 /*Else and default design have not done.*/
74 /*Please confirm the STM and design else and default.*/
78 /****************************************/
79 /* Event appraisal function */
80 /* STM : RestrictionMode */
81 /* State : restriction_mode_1_on( No 1 ) */
82 /****************************************/
83 static void ZREM_RestrictionModes1Event( void )
85 /*evt_restriction_mode_off*/
86 if( g_stm_event == StmEvtNoRestrictionModeOff )
88 ZREM_RestrictionModes1e0();
90 /*evt_restriction_mode_2_on*/
91 else if( g_stm_event == StmEvtNoRestrictionMode2On )
93 ZREM_RestrictionModes0e2();
97 /*Else and default design have not done.*/
98 /*Please confirm the STM and design else and default.*/
102 /****************************************/
103 /* Event appraisal function */
104 /* STM : RestrictionMode */
105 /* State : restriction_mode_2_on( No 2 ) */
106 /****************************************/
107 static void ZREM_RestrictionModes2Event( void )
109 /*evt_restriction_mode_off*/
110 if( g_stm_event == StmEvtNoRestrictionModeOff )
112 ZREM_RestrictionModes1e0();
114 /*evt_restriction_mode_1_on*/
115 else if( g_stm_event == StmEvtNoRestrictionMode1On )
117 ZREM_RestrictionModes0e1();
121 /*Else and default design have not done.*/
122 /*Please confirm the STM and design else and default.*/
126 /****************************************/
127 /* Event call function */
128 /* STM : RestrictionMode */
129 /****************************************/
130 void stm_rem_event_call( void )
133 switch( ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] )
135 case ZREM_RESTRICTIONMODES0:
136 ZREM_RestrictionModes0Event();
138 case ZREM_RESTRICTIONMODES1:
139 ZREM_RestrictionModes1Event();
141 case ZREM_RESTRICTIONMODES2:
142 ZREM_RestrictionModes2Event();
145 /*Not accessible to this else (default).*/
150 /****************************************/
151 /* Initial function */
152 /* STM : RestrictionMode */
153 /****************************************/
154 void stm_rem_initialize( void )
156 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
157 stm_rem_start_activity_restriction_mode_off();
160 /****************************************/
161 /* Terminate function */
162 /* STM : RestrictionMode */
163 /****************************************/
164 void ZREM_RestrictionModeTerminate( void )
166 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODETERMINATE;