;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (c) 2000 - 2002 TIMEX Corporation.
; 
; This document is the property of, and contains information proprietary to
; TIMEX Corporation.  It is to be returned upon request.  Reproduction by any
; means, disclosure, or use of its contents for other than the expressed
; purpose for which it is loaned, without the written consent of TIMEX
; Corporation, is strictly prohibited.
;
; File Name   : tmrvars.h
;
; Purpose     : Countdown Timer Application Variable Offsets.
;
; File Change History:
;
;               08/03/2000 HSB - Created tmrvars.h for m841
;
;   m851 Development:
;
;               12/11/2001 FSU - Modified for M851.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;==============================================================================
;
; TIMER APPLICATION SYSTEM DATA
;
;==============================================================================


TMRSYSTEMDATASTARTOFFSET    equ     0


; TMR resource index allocated for Countdown Timer application.
TMRRESOURCEINDEX0OFFSET     equ     0

; Record number of the last viewed entry.
TMRLASTVIEWEDENTRYOFFSET    equ     1


TMRFLAGS1OFFSET             equ     2

    bTMRActionAtEnd0        equ     bCTMRActionAtEnd0   ; b0 & b1: 00 - Stop At End.        
    bTMRActionAtEnd1        equ     bCTMRActionAtEnd1   ;          01 - Repeat At End.
                                                        ;          10 - Chrono At End.

    bTMRHalfwayEnable       equ     bCTMRHalfwayEnable  ; b2     : 0 - Disable halfway reminder
                                                        ;        : 1 - Enable halfway reminder

    bTMRDataIsZero          equ     bCTMRDataIsZero     ; b3     : 0 - Data is not zero.
                                                        ;        : 1 - Data is zero.

    bTMRLess15Sec           equ     bCTMRLess15Sec      ; b4     : 0 - Data is not less than 15 seconds.
                                                        ;        : 1 - Data is less than 15 seconds.

    bTMRLess1Min            equ     bCTMRLess1Min       ; b5     : 0 - Data is not less than 1 minute.
                                                        ;        : 1 - Data is less than 1 minute.


TMRFLAGS2OFFSET				equ		3

    bTMRUpdRepeatNumDisplay equ     00000001B           ; b0     : 0 - Do not update repeat number display.
                                                        ;        : 1 - Update repeat number display.

	bTMRNewTimerData		equ		00000010B			; b1	 : 0 - No new interval timer has started.
														;		 : 1 - New interval timer has started.

	bTMRCameFromPopup		equ		00000100B			; b2	 : 0 - Default state entry came from a mode change.
														;        : 1 - Default state entry came from an interval popup.

; Holds the type of popup that had been requested.
TMRPOPUPTYPEOFFSET          equ     4

TMRSYSTEMDATASIZE           equ     5


;==============================================================================
;
; TIMER APPLICATION DATABASE
;
;==============================================================================

TMRDATABASESTARTOFFSET      equ     TMRSYSTEMDATASIZE

TMRRAMDATABASEDATASIZE      equ     0


;------------------------------------------------------------------------------
; Total RAM allocation
;------------------------------------------------------------------------------
TMRHEAPSIZEREQUIREMENTS     equ     TMRSYSTEMDATASIZE + TMRRAMDATABASEDATASIZE


;------------------------------------------------------------------------------
; Total EEPROM allocation
;------------------------------------------------------------------------------

; Size of the generic database header.  2 bytes for allocation size, 2 bytes
;   for database size and 1 byte for app specific header size.
TMRADDGENERICHEADERSIZE     equ     5

; Size of the application specific header.  2 bytes for the number of records
;   and 1 byte for the record size.
TMRAPPSPECIFICHEADERSIZE    equ     3

; Initial number of timer records.
TMRNUMBEROFRECORDS          equ     10

; Size of each timer record.  This consist of Status flag, HMS data and 9 character name.
TMRRECORDSIZE               equ     CTMRRECORDSIZE

; Size of the entire database allocated for 10 timer entries.
TMREEPROMDATABASEDATASIZE   equ     (TMRADDGENERICHEADERSIZE + TMRAPPSPECIFICHEADERSIZE + (TMRNUMBEROFRECORDS * TMRRECORDSIZE))

; Size allocated for the entire database with 64-byte per page in EEPROM.
TMREEPROMDBALLOCATIONSIZE   equ     (((TMREEPROMDATABASEDATASIZE/64) + 1) * 64)


;==============================================================================
;
; VARIABLE REDEFINITIONS 
;
;==============================================================================

