aboutsummaryrefslogtreecommitdiffstats
path: root/policy_manager/stm/zipc/StateTransitionor/RestrictionMode
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-10-30 14:36:16 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-10-30 14:36:16 +0900
commitde492ca32c0cc4eb7e090ba33945eb75a21cc14a (patch)
treec81e48f9fa7199afa87a25781599ed6d963989b1 /policy_manager/stm/zipc/StateTransitionor/RestrictionMode
parent3ae8e9b6a7947b91409b112e1a699385627c5945 (diff)
add source for ces2019
Diffstat (limited to 'policy_manager/stm/zipc/StateTransitionor/RestrictionMode')
-rw-r--r--policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c77
-rw-r--r--policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h7
-rw-r--r--policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c32
-rw-r--r--policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h3
4 files changed, 27 insertions, 92 deletions
diff --git a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
index 7fe5700..2ba6a87 100644
--- a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
+++ b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
@@ -9,88 +9,45 @@
static uint8_t ZREM_RestrictionModeState[ZREM_RESTRICTIONMODESTATENOMAX];
static void ZREM_RestrictionModes0e1( void );
-static void ZREM_RestrictionModes0e2( void );
static void ZREM_RestrictionModes1e0( void );
static void ZREM_RestrictionModes0Event( void );
static void ZREM_RestrictionModes1Event( void );
-static void ZREM_RestrictionModes2Event( void );
/****************************************/
/* Action function */
/* STM : RestrictionMode */
-/* State : restriction_mode_off( No 0 ) */
-/* Event : evt_restriction_mode_1_on( No 1 ) */
+/* State : restriction_mode_on( No 0 )*/
+/* Event : evt_restriction_mode_off( No 1 ) */
/****************************************/
static void ZREM_RestrictionModes0e1( void )
{
ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
- stm_rem_start_activity_restriction_mode_1_on();
-}
-
-/****************************************/
-/* Action function */
-/* STM : RestrictionMode */
-/* State : restriction_mode_off( No 0 ) */
-/* Event : evt_restriction_mode_2_on( No 2 ) */
-/****************************************/
-static void ZREM_RestrictionModes0e2( void )
-{
- ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES2;
- stm_rem_start_activity_restriction_mode_2_on();
+ stm_rem_start_activity_restriction_mode_off();
}
/****************************************/
/* Action function */
/* STM : RestrictionMode */
-/* State : restriction_mode_1_on( No 1 ) */
-/* Event : evt_restriction_mode_off( No 0 ) */
+/* State : restriction_mode_off( No 1 ) */
+/* Event : evt_restriction_mode_on( No 0 ) */
/****************************************/
static void ZREM_RestrictionModes1e0( void )
{
ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
- stm_rem_start_activity_restriction_mode_off();
+ stm_rem_start_activity_restriction_mode_on();
}
/****************************************/
/* Event appraisal function */
/* STM : RestrictionMode */
-/* State : restriction_mode_off( No 0 ) */
+/* State : restriction_mode_on( No 0 )*/
/****************************************/
static void ZREM_RestrictionModes0Event( void )
{
- /*evt_restriction_mode_1_on*/
- if( g_stm_event == StmEvtNoRestrictionMode1On )
- {
- ZREM_RestrictionModes0e1();
- }
- /*evt_restriction_mode_2_on*/
- else if( g_stm_event == StmEvtNoRestrictionMode2On )
- {
- ZREM_RestrictionModes0e2();
- }
- else
- {
- /*Else and default design have not done.*/
- /*Please confirm the STM and design else and default.*/
- }
-}
-
-/****************************************/
-/* Event appraisal function */
-/* STM : RestrictionMode */
-/* State : restriction_mode_1_on( No 1 ) */
-/****************************************/
-static void ZREM_RestrictionModes1Event( void )
-{
/*evt_restriction_mode_off*/
if( g_stm_event == StmEvtNoRestrictionModeOff )
{
- ZREM_RestrictionModes1e0();
- }
- /*evt_restriction_mode_2_on*/
- else if( g_stm_event == StmEvtNoRestrictionMode2On )
- {
- ZREM_RestrictionModes0e2();
+ ZREM_RestrictionModes0e1();
}
else
{
@@ -102,20 +59,15 @@ static void ZREM_RestrictionModes1Event( void )
/****************************************/
/* Event appraisal function */
/* STM : RestrictionMode */
-/* State : restriction_mode_2_on( No 2 ) */
+/* State : restriction_mode_off( No 1 ) */
/****************************************/
-static void ZREM_RestrictionModes2Event( void )
+static void ZREM_RestrictionModes1Event( void )
{
- /*evt_restriction_mode_off*/
- if( g_stm_event == StmEvtNoRestrictionModeOff )
+ /*evt_restriction_mode_on*/
+ if( g_stm_event == StmEvtNoRestrictionModeOn )
{
ZREM_RestrictionModes1e0();
}
- /*evt_restriction_mode_1_on*/
- else if( g_stm_event == StmEvtNoRestrictionMode1On )
- {
- ZREM_RestrictionModes0e1();
- }
else
{
/*Else and default design have not done.*/
@@ -138,9 +90,6 @@ void stm_rem_event_call( void )
case ZREM_RESTRICTIONMODES1:
ZREM_RestrictionModes1Event();
break;
- case ZREM_RESTRICTIONMODES2:
- ZREM_RestrictionModes2Event();
- break;
default:
/*Not accessible to this else (default).*/
break;
@@ -153,7 +102,7 @@ void stm_rem_event_call( void )
/****************************************/
void stm_rem_initialize( void )
{
- ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
stm_rem_start_activity_restriction_mode_off();
}
diff --git a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h
index f2c2026..4ce0cac 100644
--- a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h
+++ b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h
@@ -10,33 +10,28 @@
#define ZREM_RESTRICTIONMODE ( 0U )
#define ZREM_RESTRICTIONMODES0 ( 0U )
#define ZREM_RESTRICTIONMODES1 ( 1U )
-#define ZREM_RESTRICTIONMODES2 ( 2U )
#define ZREM_RESTRICTIONMODESTATENOMAX ( 1U )
/*End state define*/
-#define ZREM_RESTRICTIONMODEEND ( 3U )
+#define ZREM_RESTRICTIONMODEEND ( 2U )
/*Terminate state define*/
#define ZREM_RESTRICTIONMODETERMINATE ( ZREM_RESTRICTIONMODEEND + 1U )
/*State no define*/
#define ZREM_RESTRICTIONMODES0STATENO ( 0U )
#define ZREM_RESTRICTIONMODES1STATENO ( 1U )
-#define ZREM_RESTRICTIONMODES2STATENO ( 2U )
/*State serial no define*/
#define ZREM_RESTRICTIONMODES0STATESERIALNO ( 0U )
#define ZREM_RESTRICTIONMODES1STATESERIALNO ( 1U )
-#define ZREM_RESTRICTIONMODES2STATESERIALNO ( 2U )
/*Event no define*/
#define ZREM_RESTRICTIONMODEE0EVENTNO ( 0U )
#define ZREM_RESTRICTIONMODEE1EVENTNO ( 1U )
-#define ZREM_RESTRICTIONMODEE2EVENTNO ( 2U )
/*Event serial no define*/
#define ZREM_RESTRICTIONMODEE0EVENTSERIALNO ( 0U )
#define ZREM_RESTRICTIONMODEE1EVENTSERIALNO ( 1U )
-#define ZREM_RESTRICTIONMODEE2EVENTSERIALNO ( 2U )
/*Extern function*/
extern void stm_rem_event_call( void );
diff --git a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c
index 94807f8..e920916 100644
--- a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c
+++ b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c
@@ -10,44 +10,36 @@
*************************************************************/
/*
- * @name stm_rem_start_activity_restriction_mode_1_on
+ * @name stm_rem_start_activity_restriction_mode_on
*/
-void stm_rem_start_activity_restriction_mode_1_on() {
- g_stm_crr_state.mode[StmModeNoRestrictionMode].state = StmRestrictionModeSttNo1On;
- g_stm_crr_state.mode[StmModeNoRestrictionMode].changed = STM_TRUE;
-}
-
-/*
- * @name stm_rem_start_activity_restriction_mode_2_on
- */
-void stm_rem_start_activity_restriction_mode_2_on() {
- g_stm_crr_state.mode[StmModeNoRestrictionMode].state = StmRestrictionModeSttNo2On;
- g_stm_crr_state.mode[StmModeNoRestrictionMode].changed = STM_TRUE;
+void stm_rem_start_activity_restriction_mode_on() {
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOn;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_TRUE;
}
/*
* @name stm_rem_start_activity_restriction_mode_off
*/
void stm_rem_start_activity_restriction_mode_off() {
- g_stm_crr_state.mode[StmModeNoRestrictionMode].state = StmRestrictionModeSttNoOff;
- g_stm_crr_state.mode[StmModeNoRestrictionMode].changed = STM_TRUE;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOff;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_TRUE;
}
/*
* @name stm_rem_initialize_variable
*/
void stm_rem_initialize_variable() {
- g_stm_prv_state.mode[StmModeNoRestrictionMode].state = StmRestrictionModeSttNoOff;
- g_stm_prv_state.mode[StmModeNoRestrictionMode].changed = STM_FALSE;
+ g_stm_prv_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOff;
+ g_stm_prv_state.car_element[StmCarElementNoRestrictionMode].changed = STM_FALSE;
- g_stm_crr_state.mode[StmModeNoRestrictionMode].state = StmRestrictionModeSttNoOff;
- g_stm_crr_state.mode[StmModeNoRestrictionMode].changed = STM_FALSE;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOff;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_FALSE;
}
/*
* @name stm_rem_start_stm
*/
void stm_rem_start_stm() {
- g_stm_prv_state.mode[StmModeNoRestrictionMode].state = g_stm_crr_state.mode[StmModeNoRestrictionMode].state;
- g_stm_crr_state.mode[StmModeNoRestrictionMode].changed = STM_FALSE;
+ g_stm_prv_state.car_element[StmCarElementNoRestrictionMode].state = g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_FALSE;
}
diff --git a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h
index f85ab14..bbb6edf 100644
--- a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h
+++ b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h
@@ -6,8 +6,7 @@
#ifndef ZHEADER_ZREM_RESTRICTIONMODE_FUNC_H
#define ZHEADER_ZREM_RESTRICTIONMODE_FUNC_H
-extern void stm_rem_start_activity_restriction_mode_1_on();
-extern void stm_rem_start_activity_restriction_mode_2_on();
+extern void stm_rem_start_activity_restriction_mode_on();
extern void stm_rem_start_activity_restriction_mode_off();
extern void stm_rem_initialize_variable();
extern void stm_rem_start_stm();