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_RestrictionModes1e0( void );
13 static void ZREM_RestrictionModes0Event( void );
14 static void ZREM_RestrictionModes1Event( void );
16 /****************************************/
18 /* STM : RestrictionMode */
19 /* State : restriction_mode_on( No 0 )*/
20 /* Event : evt_restriction_mode_off( No 1 ) */
21 /****************************************/
22 static void ZREM_RestrictionModes0e1( void )
24 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
25 stm_rem_start_activity_restriction_mode_off();
28 /****************************************/
30 /* STM : RestrictionMode */
31 /* State : restriction_mode_off( No 1 ) */
32 /* Event : evt_restriction_mode_on( No 0 ) */
33 /****************************************/
34 static void ZREM_RestrictionModes1e0( void )
36 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
37 stm_rem_start_activity_restriction_mode_on();
40 /****************************************/
41 /* Event appraisal function */
42 /* STM : RestrictionMode */
43 /* State : restriction_mode_on( No 0 )*/
44 /****************************************/
45 static void ZREM_RestrictionModes0Event( void )
47 /*evt_restriction_mode_off*/
48 if( g_stm_event == StmEvtNoRestrictionModeOff )
50 ZREM_RestrictionModes0e1();
54 /*Else and default design have not done.*/
55 /*Please confirm the STM and design else and default.*/
59 /****************************************/
60 /* Event appraisal function */
61 /* STM : RestrictionMode */
62 /* State : restriction_mode_off( No 1 ) */
63 /****************************************/
64 static void ZREM_RestrictionModes1Event( void )
66 /*evt_restriction_mode_on*/
67 if( g_stm_event == StmEvtNoRestrictionModeOn )
69 ZREM_RestrictionModes1e0();
73 /*Else and default design have not done.*/
74 /*Please confirm the STM and design else and default.*/
78 /****************************************/
79 /* Event call function */
80 /* STM : RestrictionMode */
81 /****************************************/
82 void stm_rem_event_call( void )
85 switch( ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] )
87 case ZREM_RESTRICTIONMODES0:
88 ZREM_RestrictionModes0Event();
90 case ZREM_RESTRICTIONMODES1:
91 ZREM_RestrictionModes1Event();
94 /*Not accessible to this else (default).*/
99 /****************************************/
100 /* Initial function */
101 /* STM : RestrictionMode */
102 /****************************************/
103 void stm_rem_initialize( void )
105 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
106 stm_rem_start_activity_restriction_mode_off();
109 /****************************************/
110 /* Terminate function */
111 /* STM : RestrictionMode */
112 /****************************************/
113 void ZREM_RestrictionModeTerminate( void )
115 ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODETERMINATE;