1 /************************************************************/
3 /* OslMain 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 ZOSL_OslMainState[ZOSL_OSLMAINSTATENOMAX];
11 static void ZOSL_OslMains0StateEntry( void );
12 static void ZOSL_OslMains1StateEntry( void );
13 static void ZOSL_OslMains0e1( void );
14 static void ZOSL_OslMains0e2( void );
15 static void ZOSL_OslMains1e0( void );
16 static void ZOSL_OslRestOffs0e0( void );
17 static void ZOSL_OslRestOffs0e1( void );
18 static void ZOSL_OslRestOffs0e4( void );
19 static void ZOSL_OslRestOffs1e0( void );
20 static void ZOSL_OslRestOffs1e2( void );
21 static void ZOSL_OslRestOffs2e1( void );
22 static void ZOSL_OslRestOns0e0( void );
23 static void ZOSL_OslRestOns0e2( void );
24 static void ZOSL_OslRestOns1e0( void );
25 static void ZOSL_OslRestOns1e1( void );
26 static void ZOSL_OslMains0Event( void );
27 static void ZOSL_OslRestOffs0Event( void );
28 static void ZOSL_OslRestOffs1Event( void );
29 static void ZOSL_OslRestOffs2Event( void );
30 static void ZOSL_OslMains1Event( void );
31 static void ZOSL_OslRestOns0Event( void );
32 static void ZOSL_OslRestOns1Event( void );
34 /****************************************/
35 /* State start activity function */
37 /* State : restriction_mode_off( No 0 ) */
38 /****************************************/
39 static void ZOSL_OslMains0StateEntry( void )
41 switch( ZOSL_OslMainState[ZOSL_OSLMAINS0F] )
43 case ZOSL_OSLRESTOFFS0:
44 stm_osl_start_activity_none();
46 case ZOSL_OSLRESTOFFS1:
47 stm_osl_start_activity_pop_up();
49 case ZOSL_OSLRESTOFFS2:
50 stm_osl_start_activity_system_alert();
53 /*Not accessible to this else (default).*/
58 /****************************************/
59 /* State start activity function */
61 /* State : restriction_mode_2_on( No 1 ) */
62 /****************************************/
63 static void ZOSL_OslMains1StateEntry( void )
65 switch( ZOSL_OslMainState[ZOSL_OSLMAINS1F] )
67 case ZOSL_OSLRESTONS0:
68 stm_osl_start_activity_none();
70 case ZOSL_OSLRESTONS1:
71 stm_osl_start_activity_system_alert();
74 /*Not accessible to this else (default).*/
79 /****************************************/
82 /* State : restriction_mode_off( No 0 ) */
83 /* Event : stt_crr_layer_on_screen_pop( No 1 ) */
84 /****************************************/
85 static void ZOSL_OslMains0e1( void )
87 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS1;
88 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
89 ZOSL_OslMains1StateEntry();
92 /****************************************/
95 /* State : restriction_mode_off( No 0 ) */
96 /* Event : stt_crr_layer_on_screen_sys( No 2 ) */
97 /****************************************/
98 static void ZOSL_OslMains0e2( void )
100 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS1;
101 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS1;
102 ZOSL_OslMains1StateEntry();
105 /****************************************/
106 /* Action function */
108 /* State : restriction_mode_2_on( No 1 ) */
109 /* Event : stt_restriction_mode_off( No 0 ) */
110 /****************************************/
111 static void ZOSL_OslMains1e0( void )
113 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS0;
114 ZOSL_OslMains0StateEntry();
117 /****************************************/
118 /* Action function */
119 /* STM : OslRestOff */
120 /* State : none( No 0 ) */
121 /* Event : ara_onscreen( No 0 ) */
122 /****************************************/
123 static void ZOSL_OslRestOffs0e0( void )
125 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS1;
126 stm_osl_start_activity_pop_up();
129 /****************************************/
130 /* Action function */
131 /* STM : OslRestOff */
132 /* State : none( No 0 ) */
133 /* Event : ara_onscreen( No 1 ) */
134 /****************************************/
135 static void ZOSL_OslRestOffs0e1( void )
137 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS2;
138 stm_osl_start_activity_system_alert();
141 /****************************************/
142 /* Action function */
143 /* STM : OslRestOff */
144 /* State : none( No 0 ) */
145 /* Event : stt_prv_layer_on_screen_none( No 4 ) */
146 /****************************************/
147 static void ZOSL_OslRestOffs0e4( void )
149 stm_osl_start_activity_none();
152 /****************************************/
153 /* Action function */
154 /* STM : OslRestOff */
155 /* State : popup( No 1 ) */
156 /* Event : ara_onscreen( No 0 ) */
157 /****************************************/
158 static void ZOSL_OslRestOffs1e0( void )
160 stm_osl_start_activity_pop_up();
163 /****************************************/
164 /* Action function */
165 /* STM : OslRestOff */
166 /* State : popup( No 1 ) */
167 /* Event : ctg_popup( No 2 ) */
168 /****************************************/
169 static void ZOSL_OslRestOffs1e2( void )
171 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS0;
172 stm_osl_start_activity_none();
175 /****************************************/
176 /* Action function */
177 /* STM : OslRestOff */
178 /* State : system_alert( No 2 ) */
179 /* Event : ara_onscreen( No 1 ) */
180 /****************************************/
181 static void ZOSL_OslRestOffs2e1( void )
183 stm_osl_start_activity_system_alert();
186 /****************************************/
187 /* Action function */
188 /* STM : OslRestOn */
189 /* State : none( No 0 ) */
190 /* Event : ara_onscreen( No 0 ) */
191 /****************************************/
192 static void ZOSL_OslRestOns0e0( void )
194 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS1;
195 stm_osl_start_activity_system_alert();
198 /****************************************/
199 /* Action function */
200 /* STM : OslRestOn */
201 /* State : none( No 0 ) */
202 /* Event : stt_prv_layer_on_screen_none( No 2 ) */
203 /****************************************/
204 static void ZOSL_OslRestOns0e2( void )
206 stm_osl_start_activity_none();
209 /****************************************/
210 /* Action function */
211 /* STM : OslRestOn */
212 /* State : system_alert( No 1 ) */
213 /* Event : ara_onscreen( No 0 ) */
214 /****************************************/
215 static void ZOSL_OslRestOns1e0( void )
217 stm_osl_start_activity_system_alert();
220 /****************************************/
221 /* Action function */
222 /* STM : OslRestOn */
223 /* State : system_alert( No 1 ) */
224 /* Event : ctg_systemalert( No 1 ) */
225 /****************************************/
226 static void ZOSL_OslRestOns1e1( void )
228 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
229 stm_osl_start_activity_none();
232 /****************************************/
233 /* Event appraisal function */
235 /* State : restriction_mode_off( No 0 ) */
236 /****************************************/
237 static void ZOSL_OslMains0Event( void )
239 /*stt_restriction_mode_2_on*/
240 if( g_stm_crr_state.mode[StmModeNoRestrictionMode].state == StmRestrictionModeSttNo2On )
242 stm_rel_event_restriction_mode_2_on();
243 /*stt_crr_layer_on_screen_pop*/
244 if( g_stm_crr_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
248 /*stt_crr_layer_on_screen_sys*/
249 else if( g_stm_crr_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
255 /*Else and default design have not done.*/
256 /*Please confirm the STM and design else and default.*/
261 /*Else and default design have not done.*/
262 /*Please confirm the STM and design else and default.*/
266 /****************************************/
267 /* Event appraisal function */
268 /* STM : OslRestOff */
269 /* State : none( No 0 ) */
270 /****************************************/
271 static void ZOSL_OslRestOffs0Event( void )
273 /*stt_restriction_mode_off*/
274 if( g_stm_crr_state.mode[StmModeNoRestrictionMode].state == StmRestrictionModeSttNoOff )
277 if( g_stm_event == StmEvtNoActivate )
280 if( g_stm_category == StmCtgNoPopUp )
283 if( g_stm_area == StmAreaNoOnScreen )
285 ZOSL_OslRestOffs0e0();
289 /*Else and default design have not done.*/
290 /*Please confirm the STM and design else and default.*/
294 else if( g_stm_category == StmCtgNoSystemAlert )
297 if( g_stm_area == StmAreaNoOnScreen )
299 ZOSL_OslRestOffs0e1();
303 /*Else and default design have not done.*/
304 /*Please confirm the STM and design else and default.*/
309 /*Else and default design have not done.*/
310 /*Please confirm the STM and design else and default.*/
314 else if( g_stm_event == StmEvtNoUndo )
316 /*stt_prv_layer_on_screen_none*/
317 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
319 ZOSL_OslRestOffs0e4();
321 /*stt_prv_layer_on_screen_pop_up*/
322 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
324 ZOSL_OslRestOffs0e0();
326 /*stt_prv_layer_on_screen_sys_alt*/
327 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
329 ZOSL_OslRestOffs0e1();
333 /*Else and default design have not done.*/
334 /*Please confirm the STM and design else and default.*/
339 /*Else and default design have not done.*/
340 /*Please confirm the STM and design else and default.*/
345 /*Else and default design have not done.*/
346 /*Please confirm the STM and design else and default.*/
350 /****************************************/
351 /* Event appraisal function */
352 /* STM : OslRestOff */
353 /* State : popup( No 1 ) */
354 /****************************************/
355 static void ZOSL_OslRestOffs1Event( void )
357 /*stt_restriction_mode_off*/
358 if( g_stm_crr_state.mode[StmModeNoRestrictionMode].state == StmRestrictionModeSttNoOff )
361 if( g_stm_event == StmEvtNoActivate )
364 if( g_stm_category == StmCtgNoPopUp )
367 if( g_stm_area == StmAreaNoOnScreen )
369 ZOSL_OslRestOffs1e0();
373 /*Else and default design have not done.*/
374 /*Please confirm the STM and design else and default.*/
378 else if( g_stm_category == StmCtgNoSystemAlert )
381 if( g_stm_area == StmAreaNoOnScreen )
383 ZOSL_OslRestOffs0e1();
387 /*Else and default design have not done.*/
388 /*Please confirm the STM and design else and default.*/
393 /*Else and default design have not done.*/
394 /*Please confirm the STM and design else and default.*/
398 else if( g_stm_event == StmEvtNoDeactivate )
401 if( g_stm_category == StmCtgNoPopUp )
403 ZOSL_OslRestOffs1e2();
407 /*Else and default design have not done.*/
408 /*Please confirm the STM and design else and default.*/
412 else if( g_stm_event == StmEvtNoUndo )
414 /*stt_prv_layer_on_screen_none*/
415 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
417 ZOSL_OslRestOffs1e2();
419 /*stt_prv_layer_on_screen_pop_up*/
420 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
422 ZOSL_OslRestOffs1e0();
424 /*stt_prv_layer_on_screen_sys_alt*/
425 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
427 ZOSL_OslRestOffs0e1();
431 /*Else and default design have not done.*/
432 /*Please confirm the STM and design else and default.*/
437 /*Else and default design have not done.*/
438 /*Please confirm the STM and design else and default.*/
443 /*Else and default design have not done.*/
444 /*Please confirm the STM and design else and default.*/
448 /****************************************/
449 /* Event appraisal function */
450 /* STM : OslRestOff */
451 /* State : system_alert( No 2 ) */
452 /****************************************/
453 static void ZOSL_OslRestOffs2Event( void )
455 /*stt_restriction_mode_off*/
456 if( g_stm_crr_state.mode[StmModeNoRestrictionMode].state == StmRestrictionModeSttNoOff )
459 if( g_stm_event == StmEvtNoActivate )
462 if( g_stm_category == StmCtgNoSystemAlert )
465 if( g_stm_area == StmAreaNoOnScreen )
467 ZOSL_OslRestOffs2e1();
471 /*Else and default design have not done.*/
472 /*Please confirm the STM and design else and default.*/
477 /*Else and default design have not done.*/
478 /*Please confirm the STM and design else and default.*/
482 else if( g_stm_event == StmEvtNoDeactivate )
485 if( g_stm_category == StmCtgNoSystemAlert )
487 ZOSL_OslRestOffs1e2();
491 /*Else and default design have not done.*/
492 /*Please confirm the STM and design else and default.*/
496 else if( g_stm_event == StmEvtNoUndo )
498 /*stt_prv_layer_on_screen_none*/
499 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
501 ZOSL_OslRestOffs1e2();
503 /*stt_prv_layer_on_screen_pop_up*/
504 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
506 ZOSL_OslRestOffs0e0();
508 /*stt_prv_layer_on_screen_sys_alt*/
509 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
511 ZOSL_OslRestOffs2e1();
515 /*Else and default design have not done.*/
516 /*Please confirm the STM and design else and default.*/
521 /*Else and default design have not done.*/
522 /*Please confirm the STM and design else and default.*/
527 /*Else and default design have not done.*/
528 /*Please confirm the STM and design else and default.*/
532 /****************************************/
533 /* Event appraisal function */
535 /* State : restriction_mode_2_on( No 1 ) */
536 /****************************************/
537 static void ZOSL_OslMains1Event( void )
539 /*stt_restriction_mode_off*/
540 if( g_stm_crr_state.mode[StmModeNoRestrictionMode].state == StmRestrictionModeSttNoOff )
542 stm_rel_event_restriction_mode_off();
547 /*Else and default design have not done.*/
548 /*Please confirm the STM and design else and default.*/
552 /****************************************/
553 /* Event appraisal function */
554 /* STM : OslRestOn */
555 /* State : none( No 0 ) */
556 /****************************************/
557 static void ZOSL_OslRestOns0Event( void )
559 /*stt_restriction_mode_2_on*/
560 if( g_stm_crr_state.mode[StmModeNoRestrictionMode].state == StmRestrictionModeSttNo2On )
563 if( g_stm_event == StmEvtNoActivate )
566 if( g_stm_category == StmCtgNoSystemAlert )
569 if( g_stm_area == StmAreaNoOnScreen )
571 ZOSL_OslRestOns0e0();
575 /*Else and default design have not done.*/
576 /*Please confirm the STM and design else and default.*/
581 /*Else and default design have not done.*/
582 /*Please confirm the STM and design else and default.*/
586 else if( g_stm_event == StmEvtNoUndo )
588 /*stt_prv_layer_on_screen_none*/
589 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
591 ZOSL_OslRestOns0e2();
593 /*stt_prv_layer_on_screen_sys_alt*/
594 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
596 ZOSL_OslRestOns0e0();
600 /*Else and default design have not done.*/
601 /*Please confirm the STM and design else and default.*/
606 /*Else and default design have not done.*/
607 /*Please confirm the STM and design else and default.*/
612 /*Else and default design have not done.*/
613 /*Please confirm the STM and design else and default.*/
617 /****************************************/
618 /* Event appraisal function */
619 /* STM : OslRestOn */
620 /* State : system_alert( No 1 ) */
621 /****************************************/
622 static void ZOSL_OslRestOns1Event( void )
624 /*stt_restriction_mode_2_on*/
625 if( g_stm_crr_state.mode[StmModeNoRestrictionMode].state == StmRestrictionModeSttNo2On )
628 if( g_stm_event == StmEvtNoActivate )
631 if( g_stm_category == StmCtgNoSystemAlert )
634 if( g_stm_area == StmAreaNoOnScreen )
636 ZOSL_OslRestOns1e0();
640 /*Else and default design have not done.*/
641 /*Please confirm the STM and design else and default.*/
646 /*Else and default design have not done.*/
647 /*Please confirm the STM and design else and default.*/
651 else if( g_stm_event == StmEvtNoDeactivate )
654 if( g_stm_category == StmCtgNoSystemAlert )
656 ZOSL_OslRestOns1e1();
660 /*Else and default design have not done.*/
661 /*Please confirm the STM and design else and default.*/
665 else if( g_stm_event == StmEvtNoUndo )
667 /*stt_prv_layer_on_screen_none*/
668 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
670 ZOSL_OslRestOns1e1();
672 /*stt_prv_layer_on_screen_sys_alt*/
673 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
675 ZOSL_OslRestOns1e0();
679 /*Else and default design have not done.*/
680 /*Please confirm the STM and design else and default.*/
685 /*Else and default design have not done.*/
686 /*Please confirm the STM and design else and default.*/
691 /*Else and default design have not done.*/
692 /*Please confirm the STM and design else and default.*/
696 /****************************************/
697 /* Event call function */
699 /****************************************/
700 void stm_osl_event_call( void )
703 switch( ZOSL_OslMainState[ZOSL_OSLMAIN] )
706 switch( ZOSL_OslMainState[ZOSL_OSLMAINS0F] )
708 case ZOSL_OSLRESTOFFS0:
709 ZOSL_OslRestOffs0Event();
711 case ZOSL_OSLRESTOFFS1:
712 ZOSL_OslRestOffs1Event();
714 case ZOSL_OSLRESTOFFS2:
715 ZOSL_OslRestOffs2Event();
718 /*Not accessible to this else (default).*/
721 ZOSL_OslMains0Event();
724 switch( ZOSL_OslMainState[ZOSL_OSLMAINS1F] )
726 case ZOSL_OSLRESTONS0:
727 ZOSL_OslRestOns0Event();
729 case ZOSL_OSLRESTONS1:
730 ZOSL_OslRestOns1Event();
733 /*Not accessible to this else (default).*/
736 ZOSL_OslMains1Event();
739 /*Not accessible to this else (default).*/
744 /****************************************/
745 /* Initial function */
747 /****************************************/
748 void stm_osl_initialize( void )
750 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS0;
751 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS0;
752 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
753 ZOSL_OslMains0StateEntry();
756 /****************************************/
757 /* Terminate function */
759 /****************************************/
760 void ZOSL_OslMainTerminate( void )
762 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINTERMINATE;