Timex M851 Watch User Manual


 
M851 WristApp Design Guide Rev 1.2
Timex Corporation 99
IF @DEF('SUBROUTINE')
UNDEF SUBROUTINE
ENDIF
DEFINE SUBROUTINE "'cntwaBannerStateManager'"
GLOBAL cntwaBannerStateManager
cntwaBannerStateManager:
car coreCommonBannerStateHandler
ret
NOTES:
GLOBAL FunctionName
This will indicate to the assembler and linker system that
this function is available to all files compiled in a project.
IF @DEF('SUBROUTINE')
UNDEF SUBROUTINE
ENDIF
DEFINE SUBROUTINE "'FunctioNname'"
This is a required code prior to a function. The APIs are
designed for the M851 OS and would require the
SUBROUTINE token to be defined.
5.10.4 Default State Handler
The following is the code for the Counter default state handler.
IF @DEF('SUBROUTINE')
UNDEF SUBROUTINE
ENDIF
DEFINE SUBROUTINE "'cntDefaultStateManager'"
GLOBAL cntDefaultStateManager
cntDefaultStateManager:
; Set IYReg the address of the counter ASD.
ld IY, [CORECurrentASDAddress]
; load in the system event to be processed
ld A, [CORECurrentEvent]
; Check if state entry event.
cp A, #CNT_STATEENTRY
jr Z, cntDefaultStateStateEntryEvent
; Check if start/split depress event.
cp A, #CNT_STARTSPLITDEPRESS
jr Z, cntDefaultStateStartSplitDepressEvent
; Check if stop/reset depress event.
cp A, #CNT_STOPRESETDEPRESS
jr Z, cntDefaultStateStopResetDepressEvent
; Check if stop/reset release event.
cp A, #CNT_STOPRESETRELEASE
jr Z, cntDefaultStateStopResetReleaseEvent
; Check if mode depress event.
cp A, #CNT_MODEDEPRESS
jr Z, cntDefaultStateModeDepressEvent
; Check if timeout hi-res done event.
cp A, #CNT_TIMEOUTDONEHIGHRES