Timex M851 Watch User Manual


 
M851 WristApp Design Guide Rev 1.2
Timex Corporation 66
1 0x05
2 0x10
3 0x55
4 0x55
Sample code to use acceleration:
// Get the number of pulses detected during sample window
LReg = COREEventArgument;
// lookup the corresponding accelerated data from table
IXReg = &utlAccelerationTable - 1;
BReg = *(IXReg + Lreg);
4.21 Timeout Services
The kernel provides two resolutions for timeout services available for the applications. These are the low-
resolution timeouts that has a 1second resolution, and the other is the high-resolution timeout that has a
resolution of 125ms.
The kernel provides two macros to request timeouts.
Timeout Macros
CORE_REQ_TIMEOUT_LORES <Number_Of_Second_Interval>
CORE_REQ_TIMEOUT_HIRES <Number_Of_125msec_Interval>
When the timeout expires, the kernel will send an event (depending on the requested timeout resolution) to
the application. The two events are: COREEVENT_TIMEOUTDONE_LOWRES and
COREEVENT_TIMEOUTDONE_HIGHRES.
A special timeout macro is provided that works with the release of a switch during a specified timeout.
This timeout is invoked using the macro CORE_REQ_TIMEOUT_STICKY. When the swich that requested
this special timeout is release prior to the required duration, the system will send the event
COREEVENT_STICKY_TIMEOUTDONE when the timeout expires. If the switch remains depressed pass
the specified timeout duration and is released, then the switch release event will be passed to the
foreground application. The state handler must be able to handle both of these events.
4.22 Popups
Only timer resources can generate popup requests for processing by the application. This allows any
critical events generated by the resource to be acknowledged and processed by the owner application.
Popup priority is based according to the resource type: TIMER, STOPWATCH, SYNCHRO, BACKUP
and TIMEZONECHECK.
Applications not using the time zone check resource, timer resource, stopwatch resource and synchro
resource do not require a popup state.
Prior to giving control to the application popup state, the kernel will clean up the current active application
by calling the resource handler of the current application with the event COREEVENT_TASKEXIT. Then
it saves the current mode and state to return to after the application popup state completes its processing. In
most cases, the popup will return to the interrupted state of the application. In some cases, this poses a UI
problem and is recommended that the state handler specify the application state to popdown. This is done
through the macro CORE_SET_POPDOWN_STATE where its takes the application state index to return to
as its argument.