add VARH functions seperate type
This commit is contained in:
parent
1ca4418292
commit
a0088db532
@ -118,6 +118,11 @@ PRIVATE BOOL boU32VarCheck( U8 u8Variable, U32 u32NewValue );
|
||||
PRIVATE BOOL boS32VarCheck( U8 u8Variable, S32 s32NewValue );
|
||||
PRIVATE BOOL boFloatVarCheck( U8 u8Variable, FLOAT flNewValue );
|
||||
|
||||
PRIVATE VOID vSetVariableData( U8 u8Variable, VARH_UVariable uData );
|
||||
PRIVATE VOID vSetVariableDataFromSystem( U8 u8Variable, VARH_UVariable uData );
|
||||
PRIVATE VARH_UVariable uGetVariableData( U8 u8Variable );
|
||||
|
||||
|
||||
//=================================================================================================
|
||||
// Section: EXTERNAL FUNCTIONS
|
||||
// Description: Definition of external (global) functions.
|
||||
@ -151,13 +156,13 @@ BOOL VARH_boInitializeModule( VOID )
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_vSetVariableData
|
||||
// Function: vSetVariableData
|
||||
// Description: Sets the Variable Data and checks the parameters (Readonly and Min/Max)
|
||||
// Parameters: U8 u8Variable
|
||||
// VARH_UVariable uData
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableData( U8 u8Variable, VARH_UVariable uData )
|
||||
VOID vSetVariableData( U8 u8Variable, VARH_UVariable uData )
|
||||
{
|
||||
// check parameters
|
||||
if( m_astVarInfo[u8Variable].u8Flags & VARH_FLAGINFO_READONLY )
|
||||
@ -171,16 +176,52 @@ VOID VARH_vSetVariableData( U8 u8Variable, VARH_UVariable uData )
|
||||
osMutexRelease( m_pstMutexID ); // release mutex
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_vSetVariableDataU32
|
||||
// Description: Sets the Variable Data and checks the parameters (Readonly and Min/Max)
|
||||
// Parameters: U8 u8Variable
|
||||
// U32 u32Data
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableDataU32( U8 u8Variable, U32 u32Data )
|
||||
{
|
||||
vSetVariableData(u8Variable, (VARH_UVariable)u32Data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_vSetVariableDataFromSystem
|
||||
// Function: VARH_vSetVariableDataS32
|
||||
// Description: Sets the Variable Data and checks the parameters (Readonly and Min/Max)
|
||||
// Parameters: U8 u8Variable
|
||||
// S32 s32Data
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableDataS32( U8 u8Variable, S32 s32Data )
|
||||
{
|
||||
vSetVariableData(u8Variable, (VARH_UVariable)s32Data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_vSetVariableDataFloat
|
||||
// Description: Sets the Variable Data and checks the parameters (Readonly and Min/Max)
|
||||
// Parameters: U8 u8Variable
|
||||
// FLOAT flData
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableDataFloat( U8 u8Variable, FLOAT flData )
|
||||
{
|
||||
vSetVariableData(u8Variable, (VARH_UVariable)flData);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: vSetVariableDataFromSystem
|
||||
// Description: Sets the Variable Data from System
|
||||
// Use only internal, not for User!
|
||||
// Parameters: U8 u8Variable
|
||||
// VARH_UVariable uData
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableDataFromSystem( U8 u8Variable, VARH_UVariable uData )
|
||||
VOID vSetVariableDataFromSystem( U8 u8Variable, VARH_UVariable uData )
|
||||
{
|
||||
osMutexAcquire( m_pstMutexID, osWaitForever ); // aquire mutex
|
||||
VARH_UVariable uOldValue = m_auVariable[u8Variable].uData; // remember old value
|
||||
@ -193,12 +234,51 @@ VOID VARH_vSetVariableDataFromSystem( U8 u8Variable, VARH_UVariable uData )
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_u32GetVariableData
|
||||
// Function: VARH_vSetVariableDataFromSystemU32
|
||||
// Description: Sets the Variable Data from System
|
||||
// Use only internal, not for User!
|
||||
// Parameters: U8 u8Variable
|
||||
// U32 u32Data
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableDataFromSystemU32( U8 u8Variable, U32 u32Data )
|
||||
{
|
||||
vSetVariableDataFromSystem(u8Variable, (VARH_UVariable)u32Data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_vSetVariableDataFromSystemS32
|
||||
// Description: Sets the Variable Data from System
|
||||
// Use only internal, not for User!
|
||||
// Parameters: U8 u8Variable
|
||||
// S32 s32Data
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableDataFromSystemS32( U8 u8Variable, S32 s32Data )
|
||||
{
|
||||
vSetVariableDataFromSystem(u8Variable, (VARH_UVariable)s32Data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_vSetVariableDataFromSystemFloat
|
||||
// Description: Sets the Variable Data from System
|
||||
// Use only internal, not for User!
|
||||
// Parameters: U8 u8Variable
|
||||
// FLOAT flData
|
||||
// Returns: None
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VOID VARH_vSetVariableDataFromSystemFloat( U8 u8Variable, FLOAT flData )
|
||||
{
|
||||
vSetVariableDataFromSystem(u8Variable, (VARH_UVariable)flData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: uGetVariableData
|
||||
// Description: Gets the Variable Data
|
||||
// Parameters: U8 u8Variable
|
||||
// Returns: VARH_UVariable
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
VARH_UVariable VARH_uGetVariableData( U8 u8Variable )
|
||||
VARH_UVariable uGetVariableData( U8 u8Variable )
|
||||
{
|
||||
osMutexAcquire( m_pstMutexID, osWaitForever ); // aquire mutex
|
||||
VARH_UVariable uVar = m_auVariable[u8Variable].uData;
|
||||
@ -206,6 +286,39 @@ VARH_UVariable VARH_uGetVariableData( U8 u8Variable )
|
||||
return( uVar );
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_u32GetVariableData
|
||||
// Description: Gets the Variable Data
|
||||
// Parameters: U8 u8Variable
|
||||
// Returns: U32
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
U32 VARH_u32GetVariableData( U8 u8Variable )
|
||||
{
|
||||
return uGetVariableData(u8Variable).u32Val;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_s32GetVariableData
|
||||
// Description: Gets the Variable Data
|
||||
// Parameters: U8 u8Variable
|
||||
// Returns: S32
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
S32 VARH_s32GetVariableData( U8 u8Variable )
|
||||
{
|
||||
return uGetVariableData(u8Variable).s32Val;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_flGetVariableData
|
||||
// Description: Gets the Variable Data
|
||||
// Parameters: U8 u8Variable
|
||||
// Returns: FLOAT
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
FLOAT VARH_flGetVariableData( U8 u8Variable )
|
||||
{
|
||||
return uGetVariableData(u8Variable).flVal;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// Function: VARH_uGetVariableFlags
|
||||
// Description: Gets the Variable Flags
|
||||
|
Loading…
x
Reference in New Issue
Block a user