
Option Explicit
'*****************************************************************************
' Module:
'        ASC
'-----------------------------------------------------------------------------
' Description:
'        This file contains the 'Update' functions for the module.
'
'-----------------------------------------------------------------------------
' History:
'                 
'        Rev. Author         Date        Description
'        ----------------------------------------------------------------------
'        1.0  ahe            27.04.00     final version for C165UTAH
'
'        ----------------------------------------------------------------------
'        2.0  ahe            15.06.00     final version for C167CS
'
'        ----------------------------------------------------------------------
'        2.1  ahe            20.10.00     final version for C167CS
'                                         - no changes
'
'        ----------------------------------------------------------------------
'             ahe            26.10.00     final version for 
'                                           C167CS
'                                           C161PI
'                                           C167CR/SR r2
'
'        ----------------------------------------------------------------------
'        7.0  ahe            24.04.01     final version for Pegasus
'
'        7.1  ahe            08.08.02     no changes
'        7.2  ste            20.12.02     no changes
'        ----------------------------------------------------------------------
'             ste            24.11.03     new function _viSOFTBRKTrap added
'
'
'*****************************************************************************


'*****************************************************************************
'Description:
'        This function is called by the main module in order to reset or update
'        the project variables and register contents of this peripheral
'-----------------------------------------------------------------------------
'Parameters:
'        r                      reference to the project data variables
'        vIndex                 a parameter
'        lngUpdateDescriptor    identification of the update context
'                  0          = initialization for a new project
'                  1, 2, 3... = value that identifies which project settings have
'                               been changed (e.g. CPU-Type, CPU-Clock etc.)
'-----------------------------------------------------------------------------
'Returns:
'        True            on successfull operation
'        False           else
'*****************************************************************************
Function UpdateProjectData(r As ProjectData, vIndex As Variant, lngUpdateDescriptor As Long) As Boolean
    On Error GoTo UpdateProjectDataError

    UpdateProjectData = False

    Dim sRegPre As String
    Dim sVarPre As String
    Dim i       As Integer

    sVarPre = "INT" & vIndex


    Select Case lngUpdateDescriptor
        Case 0 
            r.v(sVarPre & "_NAME_Init")             = sVarPre & "_vInit"
            r.v(sVarPre & "_CFile")                 = sVarPre & ".C"
            r.v(sVarPre & "_HFile")                 = sVarPre & ".H"
            r.v(sVarPre & "_Notes")                 = "" 
            
            r.v(sVarPre & "_NAME_EnableInterrupt")  = sVarPre & "_vEnableInterrupt"
            r.v(sVarPre & "_NAME_DisableInterrupt") = sVarPre & "_vDisableInterrupt"
            r.v(sVarPre & "_NAME_SetPecCount")      = sVarPre & "_vSetPecCount"
            r.v(sVarPre & "_NAME_SetPecSrcP")       = sVarPre & "_vSetPecSrcP"
            r.v(sVarPre & "_NAME_SetPecDesP")       = sVarPre & "_vSetPecDesP"
            r.v(sVarPre & "_NAME_Ex0")           = sVarPre & "_viEx0"
            r.v(sVarPre & "_NAME_Ex1")           = sVarPre & "_viEx1"
            r.v(sVarPre & "_NAME_Ex2")           = sVarPre & "_viEx2"
            r.v(sVarPre & "_NAME_Ex3")           = sVarPre & "_viEx3"
            r.v(sVarPre & "_NAME_Ex4")           = sVarPre & "_viEx4"
            r.v(sVarPre & "_NAME_Ex5")           = sVarPre & "_viEx5"
            r.v(sVarPre & "_NAME_EOP")           = sVarPre & "_viEOP"
            r.v(sVarPre & "_NAME_NMITrap")       = sVarPre & "_viNMITrap"
            r.v(sVarPre & "_NAME_STKOFTrap")     = sVarPre & "_viSTKOFTrap"
            r.v(sVarPre & "_NAME_STKUFTrap")     = sVarPre & "_viSTKUFTrap"
            r.v(sVarPre & "_NAME_SOFTBRKTrap")   = sVarPre & "_viSOFTBRKTrap"
            r.v(sVarPre & "_NAME_ClassBTrap")    = sVarPre & "_viClassBTrap"

            r.v(sVarPre & "_NAME_ConfigureFastISR") = sVarPre & "_vConfigureFastISR"
            r.v(sVarPre & "_NAME_EnableFastISR")  = sVarPre & "_vEnableFastISR"
            r.v(sVarPre & "_NAME_DisableFastISR") = sVarPre & "_vDisableFastISR"

            For i = 0 To 5
              r.v(sVarPre & "_Ex" & i & "_Use") = 0
            Next i



        Case 1
            '...
       'Case...
    End Select

    UpdateProjectData = True
    Exit Function

UpdateProjectDataError:
    ErrorBox "Error in function UpdateProjectData", Err.Description
    Exit Function
End Function

