Attribute VB_Name = "Module1"
'#Uses "Include.inc"
Option Explicit
'*****************************************************************************
' Module:
'        T21
'-----------------------------------------------------------------------------
' Description:
'        This file contains the 'Update' functions for the module.
'
'-----------------------------------------------------------------------------
' History:
'
'        Rev. Author         Date        Description
'        ----------------------------------------------------------------------
'        0.1  Sunil          18-01-06    Final Version
'
'
'*****************************************************************************


'*****************************************************************************
'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 successful operation
'        False           else
'*****************************************************************************
Function UpdateProjectData(r As ProjectData, vIndex As Variant, lngUpdateDescriptor As Long) As Boolean
    On Error GoTo UpdateProjectDataError

    UpdateProjectData = False

    If (lngUpdateDescriptor = 0) Then
        r.v("T21_CFile") = "T21.C"
        r.v("T21_HFile") = "T21.H"
        r.v("T21_NAME_GetRC2Reg") = "T21_uwGetRC2Reg"
        r.v("T21_NAME_Init") = "T21_vInit"
        'r.v("T21_NAME_IsrTmr") = "T21_viTmr"
         r.v("T21_NAME_IsrTmr") = "SHINT_viXINTR8Isr"
        r.v("T21_NAME_ReadTmr") = "T21_uwReadTmr"
        r.v("T21_NAME_SetRC2Reg") = "T21_vSetRC2Reg"
        r.v("T21_NAME_StartTmr") = "T21_vStartTmr"
        r.v("T21_NAME_StopTmr") = "T21_vStopTmr"
        r.v("T21_Notes") = ""
        r.v("T21_USE_GetRC2Reg") = 0
        r.v("T21_USE_Init") = 0
        r.v("T21_USE_IsrTmr") = 0
        r.v("T21_USE_ReadTmr") = 0
        r.v("T21_USE_SetRC2Reg") = 0
        r.v("T21_USE_StartTmr") = 0
        r.v("T21_USE_StopTmr") = 0
        r.v("Timer21_EXF2_Pin_P3.5_Used") = 0
        r.v("Timer21_EXF2_Pin_P4.3_Used") = 0
        r.v("Timer21_T2EX_Pin_P0.5_Used") = 0
        r.v("Timer21_T2EX_Pin_P3.4_Used") = 0
        r.v("T21_Interrupt_Select") = 0
        

    End If

    ' Some "project settings" may be changed independently from the settings
    ' of the peripheral modules. Therefore the T2 module has to solve any
    ' possible conflicts with the project settings...

    ' Nothing has to be updated here.
    ' (Timer values are entered as register values, not as clock-dependent time units)

    UpdateProjectData = True
    Exit Function

UpdateProjectDataError:
    Exit Function
End Function

