Attribute VB_Name = "Module1"
'#Uses "Include.inc"
Option Explicit
'*****************************************************************************
' Module:
'        T01
'-----------------------------------------------------------------------------
' Description:
'        This file contains the 'Update' functions for the module.
'
'-----------------------------------------------------------------------------
' History:
'
'        Rev. Author         Date        Description
'        ----------------------------------------------------------------------
'        0.1  Sunil         12-10-04     Initial 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 successfull operation
'        False           else
'*****************************************************************************
Function UpdateProjectData(r As ProjectData, vIndex As Variant, lngUpdateDescriptor As Long) As Boolean
    On Error GoTo UpdateProjectDataError

    Dim iPar As Integer

    UpdateProjectData = False

    If (lngUpdateDescriptor = 0) Then
        r.v("T01_CFile") = "T01.C"
        r.v("T01_HFile") = "T01.H"
        r.v("T01_NAME_ClearTmr") = "T01_vClearTmr"
        r.v("T01_NAME_Init") = "T01_vInit"
        r.v("T01_NAME_IsrTmr0") = "T01_viTmr0"
        r.v("T01_NAME_IsrTmr1") = "T01_viTmr1"
        r.v("T01_NAME_LoadTmr") = "T01_vLoadTmr"
        r.v("T01_NAME_ReadTmr") = "T01_ReadTmr"
        r.v("T01_NAME_StartTmr") = "T01_vStartTmr"
        r.v("T01_NAME_StartTmr1") = "T01_vStartTmr1"
        r.v("T01_NAME_StopTmr") = "T01_vStopTmr"
        r.v("T01_NAME_StopTmr1") = "T01_vStopTmr1"
        r.v("T01_Notes") = ""

        For iPar = 0 To NUMBER_OF_T01_PARAMETERS - 1
            r.v("T01_PARA_" & T01ParId(iPar)) = T01ParId(iPar)
        Next iPar

        r.v("T01_USE_ClearTmr") = 0
        r.v("T01_USE_Init") = 0
        r.v("T01_USE_IsrTmr0") = 0
        r.v("T01_USE_IsrTmr1") = 0
        r.v("T01_USE_LoadTmr") = 0
        r.v("T01_USE_ReadTmr") = 0
        r.v("T01_USE_StartTmr") = 0
        r.v("T01_USE_StartTmr1") = 0
        r.v("T01_USE_StopTmr") = 0
        r.v("T01_USE_StopTmr1") = 0
    End If

    ' Some "project settings" may be changed independently from the settings
    ' of the peripheral modules. Therefore the T01 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

